#11190 closed bug (invalid)

Hello "schedule: re-entered unsafely."

Reported by: Chobbes Owned by:
Priority: normal Milestone:
Component: Compiler Version: 7.10.2
Keywords: Cc:
Operating System: Linux Architecture: arm
Type of failure: Runtime crash Test Case:
Blocked By: Blocking:
Related Tickets: #951, #9920 Differential Rev(s):
Wiki Page:

Description

After compiling the following program on ARM:

main = putStrLn "Hello, world!"

using ghc hello.hs I receive the following error when running the compiled code:

$ ./hello
hello: schedule: re-entered unsafely.
   Perhaps a 'foreign import unsafe' should be 'safe'?

I'm trying to get GHC running on my Raspberry Pi 2, running Raspbian Jessie Light, which can be found here:

https://www.raspberrypi.org/downloads/raspbian/

I was following the instructions for installing the compiler on a freshly flashed RPI2 from here:

http://statusfailed.com/blog/2015/11/29/haskell-and-servant-on-scaleway-arm-servers.html

This was using the Linux ARMv7 binaries:

https://www.haskell.org/ghc/download_ghc_7_10_3#linux_armv7 https://www.haskell.org/ghc/download_ghc_7_10_2#linux_armv7

Additionally trying to upgrade cabal with cabal install cabal-install seems to hang forever. It gets stuck in various Setup.hs files and doesn't seem to progress. No CPU is taken up using this.

Some summary information:

  • llvm 3.5
  • gcc 4.9.2
  • original GHC from Raspbian is 7.6.3
  • cabal-install from Raspbian is 1.20.0.3
  • cabal is 1.20.0.2
  • This same problem affects both 7.10.2, and 7.10.3

Change History (6)

comment:1 Changed 23 months ago by bgamari

Status: newinfoneeded

I believe I encountered the same issue not so long ago when using Debian's LLVM 3.5 version, which is unfortunately missing some rather critical fixes (see #9920 for details).

Can you reproduce this with LLVM 3.5.2?

comment:2 in reply to:  1 Changed 23 months ago by Chobbes

Replying to bgamari:

I believe I encountered the same issue not so long ago when using Debian's LLVM 3.5 version, which is unfortunately missing some rather critical fixes (see #9920 for details).

Can you reproduce this with LLVM 3.5.2?

I have been trying a number of things desperately (don't judge), so I am a bit turned around as to what I have tried. I might not have done this on the Pi yet.

I noticed this issue in trac as well, so I have been trying higher LLVM versions where possible. It did seem like a different error, however. Do you have a program which can reproduce the results in #9920?

Currently I have tested with Gentoo LLVM versions 3.5.0, 3.5.2, and 3.6.2 which have all had the same problem. This is in a fresh qemu-user-arm chroot (as described in the above post). This is also using the ARMv7 binaries provided for GHC 7.10.3.

I will try to get LLVM 3.5.2 on my pi tomorrow to confirm.

comment:3 Changed 23 months ago by Chobbes

comment:4 in reply to:  1 Changed 22 months ago by Chobbes

Resolution: fixed
Status: infoneededclosed

Replying to bgamari:

I believe I encountered the same issue not so long ago when using Debian's LLVM 3.5 version, which is unfortunately missing some rather critical fixes (see #9920 for details).

Can you reproduce this with LLVM 3.5.2?

Turns out you were completely correct!

I had mistakenly not cleaned object files left over from previous runs. This is now working with LLVM 3.5.2. My apologies for the mistake, and thank you very much for pointing out the issue.

I can now generate executables in my QEMU environment for the RPI2, which work :).

Thanks again, cheers!

comment:5 Changed 22 months ago by bgamari

Resolution: fixed
Status: closednew

comment:6 Changed 22 months ago by bgamari

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.