[Issue 16638] New: segfault if a single lib is passed without sources

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed Oct 26 08:52:45 PDT 2016


https://issues.dlang.org/show_bug.cgi?id=16638

          Issue ID: 16638
           Summary: segfault if a single lib is passed without sources
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: john.loughran.colvin at gmail.com

dmd -lib blah.a

segfaults. blah.a doesn't have to exist.

* thread #1: tid = 0x878e, 0x00000001000e8408
dmd`D4ddmd3lib7Library11setFilenameMFPxaPxaZv + 136 at lib.d:89, queue =
'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
    frame #0: 0x00000001000e8408 dmd`D4ddmd3lib7Library11setFilenameMFPxaPxaZv
+ 136 at lib.d:89
   86              if (!arg || !*arg)
   87              {
   88                  // Generate lib file name from first obj name
-> 89                  const(char)* n = (*global.params.objfiles)[0];
   90                  n = FileName.name(n);
   91                  arg = FileName.forceExt(n, global.lib_ext);
   92              }
(lldb) bt
* thread #1: tid = 0x878e, 0x00000001000e8408
dmd`D4ddmd3lib7Library11setFilenameMFPxaPxaZv + 136 at lib.d:89, queue =
'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
  * frame #0: 0x00000001000e8408 dmd`D4ddmd3lib7Library11setFilenameMFPxaPxaZv
+ 136 at lib.d:89
    frame #1: 0x00000001000ed513 dmd`D4ddmd4mars7tryMainFmPPxaZi + 14523 at
mars.d:1448
    frame #2: 0x00000001000033c3 dmd`_Dmain + 39 at mars.d:1618
    frame #3: 0x0000000100264740
dmd`D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZ9__lambda1MFZv + 40
    frame #4: 0x0000000100264668
dmd`D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ7tryExecMFMDFZvZv + 32
    frame #5: 0x00000001002646e5
dmd`D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZv + 45
    frame #6: 0x0000000100264668
dmd`D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ7tryExecMFMDFZvZv + 32
    frame #7: 0x00000001002645db dmd`_d_run_main + 459
    frame #8: 0x000000010000347e dmd`main + 34
    frame #9: 0x00000001000016a4 dmd`start + 52

--


More information about the Digitalmars-d-bugs mailing list