[Gambas-devel] System error... (42)

Ron ron at ...572...
Sat Oct 8 11:59:27 CEST 2011


It took much longer than normal, but I got a hit...

THROW system error from ?

Program received signal SIGTRAP, Trace/breakpoint trap.
THROW (code=42) at gb_error.c:285
285 va_start(args, code);
(gdb) bt
#0  THROW (code=42) at gb_error.c:285
#1  0x00000000004053af in THROW_SYSTEM (err=0, path=0x0) at gb_error.c:325
#2  0x000000000042b03e in do_loop (wait=0x0) at gbx_watch.c:504
#3  0x000000000042b0a0 in WATCH_loop () at gbx_watch.c:530
#4  0x000000000042ca1d in main (argc=1, argv=0x7fffffffe3b8) at gbx.c:352
(gdb)
(gdb) p DEBUG_get_position(EXEC_current.cp, EXEC_current.fp,
EXEC_current.pc)
$1 = 0x43e540 "?"


Anything else I can get from this?

Regards,
Ron.



2011/10/5 Benoît Minisini <gambas at ...1...>

> > Benoit,
> >
> > I got this just now after uncommenting the lines in gb_error.c:
> >
> > THROW system error from ?
> > ERROR: #42: System error. Success
> >
> > Program exited with code 01.
> > (gdb) bt
> > No stack.
> > (gdb)
> >
> > So clearly  DEBUG_get_current_position() returns only a ?
> > And no backtrace/stack.
> > What does this mean?
> > What can we get for other info?
> > Do we need to print debug info earlier in the code?
> >
> > It does this several times a day, so we should be able to get more info
> > this time...
> >
> > To be clear, it's  the latest Gambas2 code on 64 bit ubuntu natty,
> > DomotiGaServer is a command line project.
> > The GUI project DomotiGa (which also has most of the DomotiGaServer code
> in
> > it), doesn't have this problem...
> >
> > Any pointers are welcome...
> >
> > Regards,
> > Ron.
> >
>
> You have to compile the interpreter with no optimizations, and put that in
> the
> THROW function:
>
>        if (code == E_SYSTEM)
>        {
>     fprintf(stderr, "THROW system error from %s\n",
>            DEBUG_get_current_position());
>           BREAKPOINT();
>        }
>
> It's the same thing as the code you already uncommented, with the
> 'BREAKPOINT()' macro added.
>
> Then you must run your program into gdb, and wait for the BREAKPOINT() line
> to
> be reached. Then gdb will stop that, and the 'bt' will be useful (which is
> not, of course, when then program is terminated!)
>
> Regards,
>
> --
> Benoît Minisini
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/devel/attachments/20111008/97a2c843/attachment.html>


More information about the Devel mailing list