Opened 12 years ago

Closed 12 years ago

Last modified 4 years ago

#713 closed bug (fixed)

SMP + FFI = crash...

Reported by: lipeng@… Owned by:
Priority: high Milestone: 6.6
Component: Runtime System Version: 6.5
Keywords: smp ffi crash Cc:
Operating System: Linux Architecture: x86
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

Source code will be attached. This is a modified version of bug #705: each thread calls a safe C function via FFI. The normal behavior of the program is to loop forever. The program works fine using +RTS -N1, but when using +RTS -N2 or more threads on a SMP machine, it crashes nondeterministically with all kinds of funny error messages. I can reproduce it on difference linux SMP machines.

Attachments (1)

smpbug.tar.gz (1.6 KB) - added by lipeng@… 12 years ago.

Download all attachments as: .zip

Change History (6)

Changed 12 years ago by lipeng@…

Attachment: smpbug.tar.gz added

comment:1 Changed 12 years ago by lipeng@…

By the way, I am using the 20050302 version of GHC.

comment:2 Changed 12 years ago by lipeng@…

sorry, it's ghc-6.5-20060302, not 2005 :)

comment:3 Changed 12 years ago by simonmar

Component: CompilerRuntime System
Milestone: 6.6
Priority: normalhigh

comment:4 Changed 12 years ago by simonmar

Resolution: fixed
Status: newclosed

Thank you, this was a really useful bug report. I found at least 2 bugs, one of which took more than a man day to find :-( There was no problem with the FFI, by the way - I removed the FFI call from your program and the crash still happened. The main bug was a subtle race in the runtime when two threads were evaluating the same thunk.

comment:5 Changed 4 years ago by Simon Marlow <simonmar@…>

Note: See TracTickets for help on using tickets.