Opened 15 months ago

Last modified 8 months ago

#12581 new bug

Testsuite segfaults on OS X

Reported by: bgamari Owned by:
Priority: normal Milestone: 8.4.1
Component: Compiler Version: 8.1
Keywords: Cc: thomie
Operating System: MacOS X Architecture: x86_64 (amd64)
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description (last modified by bgamari)

derefnull fails with,

=====> derefnull(normal) 1 of 3 [0, 0, 0]
cd "./rts/derefnull.run" &&  "/Users/bgamari/ghc/inplace/test   spaces/ghc-stage2" -o derefnull derefnull.hs -dcore-lint -dcmm-lint -dno-debug-output -no-user-package-db -rtsopts -fno-warn-missed-specialisations -fshow-warning-groups  

cd "./rts/derefnull.run" && ./derefnull  
Actual stderr output differs from expected:
--- /dev/null   2016-09-09 02:44:22.000000000 +0300
+++ ./rts/derefnull.run/derefnull.run.stderr.normalised 2016-09-09 02:44:24.000000000 +0300
@@ -0,0 +1 @@
+/bin/sh: line 1: 91959 Segmentation fault: 11  ./derefnull

and divbyzero fails with,

=====> divbyzero(normal) 2 of 3 [0, 1, 0]
cd "./rts/divbyzero.run" &&  "/Users/bgamari/ghc/inplace/test   spaces/ghc-stage2" -o divbyzero divbyzero.hs -dcore-lint -dcmm-lint -dno-debug-output -no-user-package-db -rtsopts -fno-warn-missed-specialisations -fshow-warning-groups  
cd "./rts/divbyzero.run" && ./divbyzero  
Actual stderr output differs from expected:
--- /dev/null   2016-09-09 02:44:24.000000000 +0300
+++ ./rts/divbyzero.run/divbyzero.run.stderr.normalised 2016-09-09 02:44:24.000000000 +0300
@@ -0,0 +1 @@
+/bin/sh: line 1: 91975 Floating point exception: 8   ./divbyzero

Bisection log

git bisect start
# bad: [34010dbe77ac405da6c671c3feb3573d0d025379] Derive the Generic instance in perf/compiler/T5642
git bisect bad 34010dbe77ac405da6c671c3feb3573d0d025379
# good: [b4dfe04aa77bb2d0ce2c7d82cab5e4425e0b738c] Fix kind generalisation for pattern synonyms
git bisect good b4dfe04aa77bb2d0ce2c7d82cab5e4425e0b738c
# skip: [39103062e50249da857761d0eaca325aa428e446] Add -XStaticPointers to the flag reference.
git bisect skip 39103062e50249da857761d0eaca325aa428e446
# good: [0c0129b6a82a87a9bba19f27a4b19fec9ccc5a8d] RtsUtils: Use `size_t` instead of `int` where appropriate
git bisect good 0c0129b6a82a87a9bba19f27a4b19fec9ccc5a8d
# good: [bdb0d24be9c83b08fd3f4b870a17f6be31a24b1b] Remote GHCi: separate out message types
git bisect good bdb0d24be9c83b08fd3f4b870a17f6be31a24b1b
# bad: [4036c1f110578f8e2813295116b79a5a06e2bf59] Testsuite: fix T10482a
git bisect bad 4036c1f110578f8e2813295116b79a5a06e2bf59
# bad: [6cedef01e00e95517a546a72592ba6ff07bac605] Test Trac #12133
git bisect bad 6cedef01e00e95517a546a72592ba6ff07bac605
# bad: [9854f14ef0a3a6f399a1aa4c141c5e3dddcd77ff] Add a new determinism test
git bisect bad 9854f14ef0a3a6f399a1aa4c141c5e3dddcd77ff
# good: [206b4a1d0e82e8f0f40f6e36cf657146a8d4b36a] Testsuite: simplify extra_file handling
git bisect good 206b4a1d0e82e8f0f40f6e36cf657146a8d4b36a
# bad: [dc62a22279846abe7e84ef57896f0a38f6b7b845] Wibble error message for #11471
git bisect bad dc62a22279846abe7e84ef57896f0a38f6b7b845
# bad: [6b3b631e90aa5f6f9322efcb81e9b13d14d087f0] Testsuite: run all indexed-types ways on ./validate --slow
git bisect bad 6b3b631e90aa5f6f9322efcb81e9b13d14d087f0
# bad: [58f0086b70f2f409b9f88de1611efcf18756f9e5] Testsuite: open/close stdin/stdout/stderr explicitly
git bisect bad 58f0086b70f2f409b9f88de1611efcf18756f9e5
# good: [bafd615e40c2a11af1390e736f6122033eecc4c6] Testsuite: do not print timeout message
git bisect good bafd615e40c2a11af1390e736f6122033eecc4c6
# first bad commit: [58f0086b70f2f409b9f88de1611efcf18756f9e5] Testsuite: open/close stdin/stdout/stderr explicitly

Change History (6)

comment:1 Changed 15 months ago by bgamari

Description: modified (diff)

comment:2 Changed 15 months ago by bgamari

Description: modified (diff)

comment:3 Changed 15 months ago by bgamari

While I was expecting the backtrace to place the problem in the RTS, it appears that this isn't the case,

ghc-mini:rts bgamari$ sudo lldb ./derefnull 
(lldb) target create "./derefnull"
Current executable set to './derefnull' (x86_64).
(lldb) run
Process 92160 launched: './derefnull' (x86_64)
Process 92160 stopped
* thread #1: tid = 0xa865a5, 0x000000010003f435 derefnull`c6ba_info + 21, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
    frame #0: 0x000000010003f435 derefnull`c6ba_info + 21
derefnull`c6ba_info:
->  0x10003f435 <+21>: movq   (%rax), %rax
    0x10003f438 <+24>: leaq   0x30ad31(%rip), %rbx      ; ghczmprim_GHCziTypes_Izh_con_info
    0x10003f43f <+31>: movq   %rbx, -0x8(%r12)
    0x10003f444 <+36>: movq   %rax, (%r12)
(lldb) bt
* thread #1: tid = 0xa865a5, 0x000000010003f435 derefnull`c6ba_info + 21, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
  * frame #0: 0x000000010003f435 derefnull`c6ba_info + 21
    frame #1: 0x00000001000683f8 derefnull`base_GHCziBase_bindIO1_info + 64
    frame #2: 0x00000001003c25d1 derefnull`s1Y5_closure + 1
    frame #3: 0x0000000100371cc0 derefnull`stg_catch_frame_info_dsp + 16

comment:4 Changed 15 months ago by bgamari

Cc: thomie added

Ahh, but this test is indeed supposed to crash (via peek nullPtr) and is intended to test the RTS's signal handler. I guess this 58f0086b70f2f409b9f88de1611efcf18756f9e5 somehow broke this.

comment:5 Changed 15 months ago by bgamari

Ahh, well, I suppose the problem is pretty obvious; the patch in question changes the redirection behavior and the failures are stderr mismatches.

comment:6 Changed 8 months ago by bgamari

Milestone: 8.2.18.4.1

Given that 8.2.1-rc1 is imminent, I'm bumping these off to the 8.4

Note: See TracTickets for help on using tickets.