#5003: test 4038 (ghci) fails on OS X 64 bit.
-------------------------------+--------------------------------------------
    Reporter:  gwright         |       Owner:  gwright      
        Type:  bug             |      Status:  new          
    Priority:  normal          |   Component:  GHCi         
     Version:  7.0.2           |    Keywords:               
    Testcase:                  |   Blockedby:               
          Os:  MacOS X         |    Blocking:               
Architecture:  x86_64 (amd64)  |     Failure:  Runtime crash
-------------------------------+--------------------------------------------

Comment(by altaic):

 Compiling and running your modified test on OS X (ghc-stage2 built with
 `-Rghc-timing -O0 -DDEBUG -debug`) fails similarly:
 {{{
 [...]
 first: 501
 second: 501

 Program received signal EXC_BAD_ACCESS, Could not access memory.
 Reason: KERN_PROTECTION_FAILURE at address: 0x00007fff5f3fe8a0
 0x000000010031ac72 in stg_ap_p_info ()
 }}}

 Interestingly, the failure occurs more quickly in ghci:
 {{{
 [...]
 first: 908
 second: 908

 Program received signal EXC_BAD_ACCESS, Could not access memory.
 Reason: KERN_INVALID_ADDRESS at address: 0x00000001037ff720
 [Switching to process 27370 thread 0x2003]
 0x0000000101b7331a in stg_ap_p_info ()
 }}}

 Note that all the failures in `stg_ap_p_info` happen at the same
 instruction:
 {{{
 0x0000000101b7331a <stg_ap_p_info+890>: mov    %rax,0x40(%rsp)
 }}}

 ----

 Using ghc-stage2 built with `BuildFlavour = perf`, the modified test fails
 somewhat differently.

 ghci:
 {{{
 [...]
 first: 296
 second: 296

 Program received signal EXC_BAD_ACCESS, Could not access memory.
 Reason: KERN_PROTECTION_FAILURE at address: 0x0000000103700fd0
 [Switching to process 5685 thread 0x2003]
 0x0000000101aad47e in stg_takeMVarzh ()
 }}}

 But similarly, the instruction is the first access of `rsp`:
 {{{
 0x0000000101aad47e <stg_takeMVarzh+6>:  mov    %rax,0x40(%rsp)
 }}}

 ----

 And using ghc-stage2 built with `BuildFlavour = devel2`...

 ghci:
 {{{
 first: 1000
 second: 1000

 Program received signal EXC_BAD_ACCESS, Could not access memory.
 Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000000
 [Switching to process 21612 thread 0x2103]
 0x0000000000000000 in ?? ()
 (gdb) bt
 #0  0x0000000000000000 in ?? ()
 #1  0x00000001037de4dd in ?? ()
 #2  0x0000000104a1d9c8 in ?? ()
 Previous frame inner to this frame (gdb could not unwind past this frame)
 (gdb) frame 1
 #1  0x00000001037de4dd in ?? ()
 (gdb) disas $rip $rip+1
 Dump of assembler code from 0x1037de4dd to 0x1037de4de:
 0x00000001037de4dd:     mov    0x50(%rsp),%rcx
 End of assembler dump.
 (gdb) p $rsp
 $1 = (void *) 0x10397ce60
 }}}

 ----

 Finally, using ghc built with `-Rghc-timing -O0 -DDEBUG`, the original
 test fails as originally reported (note: callq accesses `rsp`).

 ghci:
 {{{
 Program received signal EXC_BAD_ACCESS, Could not access memory.
 Reason: KERN_PROTECTION_FAILURE at address: 0x0000000103900f88
 [Switching to process 21633 thread 0x2103]
 0x0000000101b5197b in stg_makeStablePtrzh ()
 (gdb) disas $rip $rip+1
 Dump of assembler code from 0x101b5197b to 0x101b5197c:
 0x0000000101b5197b <stg_makeStablePtrzh+51>:    callq  0x101b34f80
 <getStablePtr>
 End of assembler dump.
 (gdb) p $rsp
 $1 = (void *) 0x103900f90
 }}}

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5003#comment:6>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to