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

Benoît Minisini gambas at ...1...
Wed Oct 5 20:35:09 CEST 2011


> 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




More information about the Devel mailing list