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

Ron ron at ...572...
Tue Jan 4 15:24:18 CET 2011


On 31-12-2010 14:40, Benoît Minisini wrote:
>> Benoît,
>>
>> trying to debug this problem, but if I follow your instructions, I get
>> this right away.. are you sure they are correct?
>>
>> on at ...218...:~/domotiga/DomotiGaServer$ gdb gbx2
>> GNU gdb (GDB) 7.1-ubuntu
>> Copyright (C) 2010 Free Software Foundation, Inc.
>> License GPLv3+: GNU GPL version 3 or later
>> <http://gnu.org/licenses/gpl.html>  This is free software: you are free to
>> change and redistribute it. There is NO WARRANTY, to the extent permitted
>> by law.  Type "show copying" and "show warranty" for details.
>> This GDB was configured as "i486-linux-gnu".
>> For bug reporting instructions, please see:
>> <http://www.gnu.org/software/gdb/bugs/>...
>> Reading symbols from /usr/local/bin/gbx2...done.
>> (gdb) break THROW
>> Breakpoint 1 at 0x804be2e: file gb_error.c, line 273.
>> (gdb) run
>> Starting program: /usr/local/bin/gbx2
>> [Thread debugging using libthread_db enabled]
>>
>> Breakpoint 1, THROW (code=13) at gb_error.c:273
>> 273	void THROW(int code, ...)
>> (gdb) bt
>> #0  THROW (code=13) at gb_error.c:273
>> #1  0x08057162 in get_stream (value=0x807fad0, can_default=<value
>> optimized out>) at gbx_subr_file.c:146
>> #2  0x0805717c in SUBR_close () at gbx_subr_file.c:187
>> #3  0x0806b0f3 in EXEC_loop () at gbx_exec_loop.c:476
>> #4  0x0804f533 in EXEC_function_loop () at gbx_exec.c:703
>> #5  0x0804f809 in EXEC_function_real () at gbx_exec.c:690
>> #6  0x08061c29 in main (argc=134739048, argv=0xbffff544) at gbx.c:349
>>
>> I guess it stops at every error now, even known ones...
>>
>> Regards,
>> Ron_2nd.
>>
> This is not your error (42). THROW is raised a lot of time, but you may not
> see it because a TRY or a CATCH can intercept it, or because the interpreter
> internally catches it.
>
> To catch only system errors. Add that to the THROW() function, in gb_error.c,
> at line 278:
>
> 	if (code == 42) BREAKPOINT();
>
> Compile and install again.
>
> Then run your program into gdb until it stops at that line.
>
> Once done, don't forget to remove that line, otherwise your program will stop
> at that line even outside of the debugger.
>
> Regards,
>
>

Ok this is funny.

I ran my project for days in a row, to see if the system error #42 ever 
comes again.  After an uptime of 5 days I finally got one.
But it didn't ran inside a gdb session ;-(

I added the breakpoint line to gb_error.c like you described above, 
started the project inside gdb and it occurred right away... lucky ;-)

See attached gdb output.
Hope you can find the bug with it, if not will get some more info.
It has to do with a TCP socket _Ready event and getting some data, I 
think, but I have several sockets.
This code was running: 
http://www.domotiga.nl/browser/tags/0.1.193/DomotiGaServer

Regards,
Ron_2nd.

BTW: Is't a command line program running gb.qt on Ubuntu 10.04 32 bits 
and Gambas2 rev 3346

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: gdb output.txt
URL: <http://lists.gambas-basic.org/pipermail/devel/attachments/20110104/7b5262db/attachment.txt>


More information about the Devel mailing list