Need help with debugging Segfault

Maxim Fomin maxim at maxim-fomin.ru
Sat Dec 1 23:50:35 PST 2012


On Sunday, 2 December 2012 at 04:45:13 UTC, d coder wrote:
> Greetings
>
> I have a code that crashes with current github dmd snapshot 
> with a
> segfault. It compiles and runs fine with the released versions 
> of DMD. I am
> using lots of structs and classes in the code and I believe the 
> problem
> could be related with the other issues that are there with 
> structs. When I
> give the compiled binary to valgrind, the report suggests that 
> the segfault
> might be related to garbage collector. I wanted to isolate the 
> issue and
> report it on bugzilla. Can somebody help me with the valgrind 
> trace below
> here, and guide me where to look for the problem? My actual 
> code is
> thousands of lines big and I am at a loss as to how I should 
> isolate and
> report this issue.
>
> Regards
> - Puneet
>
> ==4453== Invalid read of size 8
> ==4453==    at 0x44EFF5: _D4nett5mule5Mule3esl6__dtorMFZv
> (../src/nett/mule.d:115)
> ==4453==    by 0x471124: 
> _D4nett5mule5Mule9EslDomain11__fieldDtorMFZv
> (../src/nett/mule.d:7923)
> ==4453==    by 0x4AD845: rt_finalize2 (in
> /home/pgoel/mule/examples/test_code)
> ==4453==    by 0x4ABC92: _D2gc3gcx3Gcx11fullcollectMFZm (in
> /home/pgoel/mule/examples/test_code)
> ==4453==    by 0x4A9BBA: _D2gc3gcx2GC18fullCollectNoStackMFZv 
> (in
> /home/pgoel/mule/examples/test_code)
> ==4453==    by 0x4A7F2C: gc_term (in 
> /home/pgoel/mule/examples/test_code)
> ==4453==    by 0x48661B: 
> _D2rt6dmain211_d_run_mainUiPPaPUAAaZiZi6runAllMFZv
> (in /home/pgoel/mule/examples/test_code)
> ==4453==    by 0x4860F5:
> _D2rt6dmain211_d_run_mainUiPPaPUAAaZiZi7tryExecMFMDFZvZv (in
> /home/pgoel/mule/examples/test_code)
> ==4453==    by 0x4860B1: _d_run_main (in
> /home/pgoel/mule/examples/test_code)
> ==4453==    by 0x485EF2: main (in 
> /home/pgoel/mule/examples/test_code)
> ==4453==  Address 0x2c0 is not stack'd, malloc'd or (recently) 
> free'd

In addition to accessing reclaimed by GC objects in class 
destructors you may encounter segfaults with structs 
(http://forum.dlang.org/thread/50B3859D.7060900@webdrake.net  and 
http://forum.dlang.org/thread/mailman.2410.1354281296.5162.digitalmars-d@puremagic.com).




More information about the Digitalmars-d mailing list