Ticket #951 (new bug)

Opened 2 years ago

Last modified 1 year ago

stage2 on sparc dies with "schedule: re-entered unsafely"

Reported by: duncan Assigned to:
Priority: normal Milestone: _|_
Component: Runtime System Version: 6.6
Severity: major Keywords:
Cc: duncan.coutts@worc.ox.ac.uk Difficulty: Unknown
Test Case: N/A Architecture: sparc
Operating System: Multiple

Description

Building a registerised GHC-6.6 on Sparc Solaris or Sparc Linux gives a stage2 with the following problem:

$ ghc --version
ghc-6.6: schedule: re-entered unsafely.
   Perhaps a 'foreign import unsafe' should be 'safe'?

This happens for Christian Maeder on Solaris and for me on Linux. It does not seem to be related to SPLIT_OBJS= in the mk/build.mk.

Christian reports that it works for him with gcc-4.0.3 but not gcc-3.4.4, though that was not the only thing different between the two configurations:

It works with gcc_4.0.3_s10 on
"SunOS leo 5.10 Generic_118833-20 sun4u sparc SUNW,Sun-Fire-280R"

It crashes as above on
"SunOS cni 5.10 Generic_118833-24 sun4u sparc SUNW,Sun-Fire-V240"
with gcc_3.4.4_s10.

My results do not contradict this as I am using gcc-3.4.6 on Sparc Linux.

Attachments

cni-warnings.txt (2.5 kB) - added by maeder@tzi.de on 10/19/06 01:32:58.
Warning messages of failing build
leo-warnings.txt (1.4 kB) - added by maeder@tzi.de on 10/19/06 01:35:18.
warning messages of successful build

Change History

10/18/06 03:50:24 changed by simonmar

  • milestone set to 6.6.1.

This should be debuggable. First try to find a program that isn't ghc and still crashes - start with testsuite/tests/ghc-regress/codeGen. You'll need to run them the threaded1 way: make WAY=threaded1.

When you find a test that crashes, run it with +RTS -Ds. Take a look with gdb and see if you can see where the cap->in_haskell field is not being set as it should be - there are only two places in the RTS where it gets set to true, both in rts/Schedule.c.

10/19/06 01:32:58 changed by maeder@tzi.de

  • attachment cni-warnings.txt added.

Warning messages of failing build

10/19/06 01:35:18 changed by maeder@tzi.de

  • attachment leo-warnings.txt added.

warning messages of successful build

10/19/06 10:07:35 changed by maeder@tzi.de

I could reproduce the error on leo (both machines) by using gcc_3.4.4_s10, so I suppose gcc is the problem (and not NumCPU or something else).

10/21/06 13:14:11 changed by igloo

  • testcase set to N/A.

11/08/06 09:43:13 changed by maeder@tzi.de

  • cc set to duncan.coutts@worc.ox.ac.uk.

I was able to locally install gcc-4.0.3 (with -enable-language=c only) and create a working stage2 compiler (on our machine named cni)!

N.B. The old compiler gcc_3.4.4 that caused "schedule: re-entered unsafely" even generates a seg-faulting stage2 compiler if "-threaded" is commented out in the compiler Makefiles.

I've now idea why these gcc versions behave that different.

11/17/06 09:27:06 changed by maeder@tzi.de

if I use

SRC_HC_OPTS += -threaded -debug -optl-L/usr/local/lib -optl-lbfd -optl-liberty

in compiler/Makefile.ghcbin then the error is gone.

11/17/06 10:07:31 changed by guest

Without -threaded in compiler/Makefile.ghcbin gdb shows:

Starting program: /home/maeder/haskell/V240-solaris/ghc/compiler/stage2/ghc-6.7
warning: Lowest section in /lib/libdl.so.1 is .dynamic at 00000094

Program received signal SIGSEGV, Segmentation fault.
0x00da4ca8 in stg_ap_v_fast ()

-debug without -threaded also works

01/18/07 19:07:36 changed by igloo

  • milestone changed from 6.6.1 to _|_.

Set milestone to _|_ as this is a registerised bug in a non-actively-maintained port.