Opened 9 months ago

Closed 8 months ago

Last modified 7 months ago

#14705 closed bug (fixed)

ghc-iserv sometimes segfaults in profiled way

Reported by: bgamari Owned by: simonmar
Priority: highest Milestone: 8.4.2
Component: Profiling Version: 8.5
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Runtime crash Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s): Phab:D4437
Wiki Page:

Description

I have seen a few testsuite failures due to ghc-iserv crashes like these,

--- ./profiling/should_run/T5363.run/T5363.stdout.normalised	2018-01-22 18:57:49.401773263 +0000
+++ ./profiling/should_run/T5363.run/T5363.run.stdout.normalised	2018-01-22 18:57:49.401773263 +0000
@@ -1 +1 @@
-1250030000000
+ghc-stage2: ghc-iserv terminated (-7)
*** unexpected failure for T5363(ghci-ext-prof)

Actual stdout output differs from expected:
--- ./profiling/should_run/scc001.run/scc001.stdout.normalised	2018-01-22 18:57:45.177724120 +0000
+++ ./profiling/should_run/scc001.run/scc001.run.stdout.normalised	2018-01-22 18:57:45.177724120 +0000
@@ -1,3 +1,3 @@
 True
 3
-'a'
+ghc-stage2: ghc-iserv terminated (-11)
*** unexpected failure for scc001(ghci-ext-prof)

Change History (8)

comment:1 Changed 9 months ago by bgamari

Looking at scc001, it looks like we get into trouble in the interpreter,

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff647f700 (LWP 108910)]
interpretBCO (cap=0x216c5c0 <MainCapability>) at rts/Interpreter.c:395
395	    switch ( get_itbl(obj)->type ) {
(gdb) print obj
$1 = <optimized out>
(gdb) print get_itbl(obj)
value has been optimized out
(gdb) print get_itbl(obj)->type
value has been optimized out
(gdb) info locals
Sp = 0x420029fcc0
SpLim = 0x42002980d0
tagged_obj = 0x1c7b9b8 <stg_ctoi_R1p_info>
obj = <optimized out>
n = <optimized out>
m = <optimized out>

For future reference, getting here involved,

$ source inplace/bin/ghc-stage2
$ cd testsuite/tests/profiling/should_run/
$ make test TEST=scc001 VERBOSE=4 CLEANUP=NO
$ gdb --args $HOME/project/inplace/lib/bin/ghc-stage2 -B$HOME/project/inplace/lib scc001.hs -dcore-lint -ddump-bcos -v -fexternal-interpreter -prof -fno-state-hack -fno-full-laziness --interactive
...
(gdb) set follow-fork-mode child
(gdb) run
...
*Main> :main
Last edited 9 months ago by bgamari (previous) (diff)

comment:2 Changed 9 months ago by Ben Gamari <ben@…>

In 55aea8f/ghc:

testsuite: Mark scc001 and T5363 as broken due to #14705

These two tests have been failing on CircleCI.

comment:3 Changed 8 months ago by simonmar

Differential Rev(s): Phab:D4437
Milestone: 8.4.1
Owner: set to simonmar
Priority: normalhighest

comment:4 Changed 8 months ago by simonmar

FYI @bgamari, in the future we need to consider these things to be release-blocking. Running the interpreter with profiling is supposed to work (and we rely on it heavily at FB), but unfortunately we only have a few tests for it. Basically what should have happened here is that CI should have picked up the failing tests on the diff that broke it - so this is an argument for keeping profiling turned on in our new CircleCI setup.

comment:5 Changed 8 months ago by bgamari

Duly noted.

comment:6 Changed 8 months ago by Ben Gamari <ben@…>

In 488d63d6/ghc:

Fix interpreter with profiling

This was broken by D3746 and/or D3809, but unfortunately we didn't
notice because CI at the time wasn't building the profiling way.

Test Plan:
```
cd testsuite/test/profiling/should_run
make WAY=ghci-ext-prof
```

Reviewers: bgamari, michalt, hvr, erikd

Subscribers: rwbarton, thomie, carter

GHC Trac Issues: #14705

Differential Revision: https://phabricator.haskell.org/D4437

comment:7 Changed 8 months ago by bgamari

Resolution: fixed
Status: newclosed

Merged for 8.4.1 as well.

comment:8 Changed 7 months ago by bgamari

Milestone: 8.4.18.4.2

Unfortunately due to an oversight in the release preparation process, the fix for this issue was not included in the 8.4.1 release. It will, however, be present in the soon-to-arrive 8.4.2.

Note: See TracTickets for help on using tickets.