[Gambas-user] Weird Timer Problem

Gareth Bult gareth at ...1689...
Sun Jan 20 22:48:39 CET 2008


Well .. (!)

If I run the code without the stop/start components, I don't see a problem with "Doit" at all.
(and I've now had the code running for hours non-stop)

If I run from the command line, it bombs on 11 iterations.

If I run through valgrind - it doesn't crash ...

Any other ideas?

Note the code fragment is complete and libvirt is a fairly stable / standard library.
(and of course it doesn't crash without the stop/start, OR when called outside the timer)

???

(I'm still watching Valgrind print out "Help me!" ...)

----- Original Message -----
step 3.: "Benoit Minisini" <gambas at ...1...>
To: "mailing list for gambas users" <gambas-user at lists.sourceforge.net>
Sent: 20 January 2008 21:04:46 o'clock (GMT) Europe/London
Subject: Re: [Gambas-user] Weird Timer Problem

On dimanche 20 janvier 2008, Gareth Bult wrote:
> Ok, I finally managed to reproduce my problem in a code snippet.
> Essentially this is a new project, stock V2 gambas, with a blank form and
> one element, a timer called "killer".
>
> If I run the code, it works fine.
> If I insert the killer.stop and killer.start lines, the program crashes
> with a signal #11 after about 5 to 10 iterations.
>
> Help!
>
> ----
>
> ' Gambas class file
> PUBLIC EXTERN virConnectOpenReadOnly(host AS String) AS Pointer IN
> "libvirt" PUBLIC EXTERN virDomainLookupByID(con AS Pointer, id AS Integer)
> AS Pointer IN "libvirt" PUBLIC EXTERN virDomainGetInfo(dom AS Pointer, inf
> AS Pointer) AS Integer IN "libvirt"
>
> PUBLIC SUB killer_Timer()
>
> 'killer.Stop() 'Adding these lines causes Sig#11 after 5-10 iterations
> PRINT "Help me!"
> DoIt()
> 'killer.Start() 'Adding these lines causes Sig#11 after 5-1- iterations
>
> END
>
> PUBLIC SUB DoIt()
>
> DIM node AS Pointer
> DIM domain AS Pointer
> DIM info AS Pointer = Alloc(24)
>
> node = virConnectOpenReadOnly("xen+tls://nodeb/default")
> domain = virDomainLookupByID(node, 0)
> virDomainGetInfo(domain, info)
>
> END
>

No problem there. I think that the crash comes from DoIt() instead. 

Try to remove the call DoIt() and keep the calls to Killer.Stop() and 
Killer.Start(), and tell me if it crashes.

I don't know at all the extern functions you are calling, so I suggest that 
you run your project into valgrind to see when the memory is corrupted. To do 
that, open a terminal inside your project directory, and type:

$ valgrind --num-callers=80 gbx2 -p

Regards,

-- 
Benoit Minisini

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Gambas-user mailing list
Gambas-user at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user




More information about the User mailing list