Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Profiler-Option causing Tango-Runtime crash (include_ex/compiler/dmd/rt/trace.d)

Moderators: kris

Posted: 11/11/09 12:57:17

Problematic Versions:

  • DMD 1.050 (probably also more early releases)
  • Tango 0.98 (with 7 additional patches)
  • and DUnit as Testing Framework

Activating the Profiler Option for the Compiler let our applications crash.

We have a continuous integration system, doing unit-testing and profiling in one step. So we added --profiler that our code gets compiled with profiler-hooks. This mostly works very well. We had good experience with this, but now we run into a constellation where it crashes. We cannot us explain why. We cannot find any mistake in our code and we also cannot find a mistake in DUnit. We also cannot get more debug information of the crashed code, because the dmd compiler still seem to be broken for this. So we just could post the Backtraces of the crashes. The crashes just appear, when we compile with --profile.

We run into two problems.

  • an endless loop
  • a segmentation fault

Endless loop in include_ex/compiler/dmd/rt/trace.d:trace_term(). Just one Thread is as this moment active.

        #0  0x0813de66 in trace_term ()                                                                       
        #1  0x0813da64 in _staticDtor2 ()                                                                     
        #2  0x0813e628 in _D2rt5trace9__moddtorFZv ()                                                         
        #3  0x08140805 in _moduleDtor ()                                                                      
        #4  0x0813c0e2 in _D2rt6dmain24mainUiPPaZi6runAllMFZv ()                                              
        #5  0x0813bff5 in _D2rt6dmain24mainUiPPaZi7tryExecMFDFZvZv ()                                         
        #6  0x0813bfa4 in main ()  

Segmentation Fault in include_ex/compiler/dmd/rt/trace.d:_trace_epi_n(). In this case 3 Threads were active. And another Thread was exactly at this moment within Method trace.d:QueryPerformanceCounter().

        #0  0x0813e284 in trace_epi ()
        #1  0x0813e5ee in _trace_epi_n ()
        #2  0xb7ca1000 in ?? ()
        #3  0xb7c9a5a0 in ?? ()
        #4  0xb444139c in ?? ()
        #5  0xb4441394 in ?? ()
        #6  0x081ac7b4 in ?? ()
        #7  0xb7c9a5a0 in ?? ()
        #8  0xb7c9a5a0 in ?? ()
        #9  0xb7c9a5a0 in ?? ()
        #10 0x08082b20 in _D4util10concurrent13BlockingQueue22__T13BlockingQueueTAhZ13BlockingQueue11__invariantMFZv ()
        #11 0x0813eb9a in _D9invariant12_d_invariantFC6ObjectZv ()
        #12 0x08082c92 in _D4util10concurrent13BlockingQueue22__T13BlockingQueueTAhZ13BlockingQueue3putMFAhZv ()
        #13 0x0809c606 in _D17displaycontroller9operation3net21SenderReceiverControl21SenderReceiverControl12onDisconnectMFZv ()
        #14 0x0809cf2b in _D17displaycontroller9operation3net18AbstractConnection27__T18AbstractConnectionTAhZ18AbstractConnection10disconnectMFZv ()
        #15 0x0809cd41 in _D17displaycontroller9operation3net18AbstractConnection27__T18AbstractConnectionTAhZ18AbstractConnection14receiveForeverMFZv ()
        #16 0x08138cf1 in _D5tango4core6Thread6Thread3runMFZv ()
        #17 0x081382c2 in thread_entryPoint ()
        #18 0xb7ed52ab in start_thread () from /lib/
        #19 0xb7e3eb9e in clone () from /lib/

best regards


Author Message

Posted: 11/11/09 21:50:24

Hi Stefan,

0.99.8 and this recent compiler isn't a tried and tested combination. In addition to that, 1.048 to 1.050 has been known to not work at all with Tango trunk. Maybe you should try again using 1.051?

Posted: 11/13/09 18:56:05 -- Modified: 11/13/09 18:56:43 by

Hi Larsivi,

I tried today DMD 1.051. Similar result. Also Segmentation Faults in trace.d.


Posted: 11/14/09 11:32:17

Could you please create a minimal example that is possible to test with trunk? Or test with trunk yourself.