www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 15180] New: [REG2.069.0-b1] Segfault with empty struct used

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

          Issue ID: 15180
           Summary: [REG2.069.0-b1] Segfault with empty struct used as UDA
           Product: D
           Version: D2
          Hardware: x86
                OS: Mac OS X
            Status: NEW
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: doob me.com

The following code will result in "Segmentation fault: 11" on OS X:

struct foo { }
 foo bar () { }

Backtrace:

Process 73487 launched:
'/Users/jacob/.dvm/compilers/dmd-2.069.0-b1/osx/bin/dmd' (x86_64)
Process 73487 stopped
* thread #1: tid = 0x554c57, 0x0000000100161921
dmd`objc_isUdaSelector(StructDeclaration*) + 9, queue =
'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x8)
    frame #0: 0x0000000100161921 dmd`objc_isUdaSelector(StructDeclaration*) + 9
dmd`objc_isUdaSelector(StructDeclaration*):
->  0x100161921 <+9>:  movq   0x8(%rdi), %rax
    0x100161925 <+13>: leaq   0x1b1dec(%rip), %rcx      ; Id::udaSelector
    0x10016192c <+20>: cmpq   (%rcx), %rax
    0x10016192f <+23>: jne    0x100161938               ; <+32>
(lldb) bt
* thread #1: tid = 0x554c57, 0x0000000100161921
dmd`objc_isUdaSelector(StructDeclaration*) + 9, queue =
'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x8)
  * frame #0: 0x0000000100161921 dmd`objc_isUdaSelector(StructDeclaration*) + 9
    frame #1: 0x0000000100161887
dmd`objc_FuncDeclaration_semantic_setSelector(FuncDeclaration*, Scope*) + 175
    frame #2: 0x00000001000b9276 dmd`FuncDeclaration::semantic2(Scope*) + 30
    frame #3: 0x000000010000b0da dmd`AttribDeclaration::semantic2(Scope*) + 98
    frame #4: 0x000000010000e076
dmd`UserAttributeDeclaration::semantic2(Scope*) + 94
    frame #5: 0x0000000100061bfa dmd`Module::semantic2() + 90
    frame #6: 0x00000001000f6abd dmd`tryMain(unsigned long, char const**) +
29045
    frame #7: 0x0000000100002eeb dmd`_Dmain + 47
    frame #8: 0x0000000100227158
dmd`D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZ9__lambda1MFZv + 40
    frame #9: 0x000000010022709d
dmd`D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ7tryExecMFMDFZvZv + 45
    frame #10: 0x00000001002270fd
dmd`D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZv + 45
    frame #11: 0x000000010022709d
dmd`D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ7tryExecMFMDFZvZv + 45
    frame #12: 0x0000000100227013 dmd`_d_run_main + 499
    frame #13: 0x0000000100002f88 dmd`main + 20
    frame #14: 0x00000001000013ed dmd`_start + 203
    frame #15: 0x0000000100001321 dmd`start + 33

--
Oct 09 2015