Ticket #677 (closed bug: fixed)

Opened 7 years ago

Last modified 7 years ago

segfault with C<->Haskell ping-pong, should be stack overflow

Reported by: as49@… Owned by:
Priority: normal Milestone:
Component: Runtime System Version: 6.4
Keywords: GC FFI Cc:
Operating System: Linux Architecture: x86
Type of failure: Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

Maybe this relates to bug #370. In the infinite sequence:

Haskell function f: alloca memory then call C func g C function g: call Haskell function f

The program terminates with a segmentation fault, rather than a stack overflow. I think I experience this problem in a real program which has a finite ping-pong sequence. I think there is actually a bug in the GC, since the segfault occurs after a very varying number of steps. It works with both, 6.2.2 and 6.4.

The three files  membug.h  membug.c  MemBug.hs show this behaviour (nothing deep, but saves typing).

Compile with:

ghc-6.4 -fffi -c MemBug.hs membug.c

Link with:

ghc-6.4 MemBug.o membug.o MemBug_stub.o

Run with:

./a.out +RTS -H5m -G1

Note that any other opetions would do, too.

Axel.

Attachments

membug.c Download (198 bytes) - added by simonmar 7 years ago.
membug.h Download (93 bytes) - added by simonmar 7 years ago.
MemBug.hs Download (403 bytes) - added by simonmar 7 years ago.

Change History

Changed 7 years ago by simonmar

Changed 7 years ago by simonmar

Changed 7 years ago by simonmar

Changed 7 years ago by simonmar

  • status changed from new to closed
  • resolution set to fixed

I believe this bug is fixed in 6.4.1. I've been running the test for a couple of minutes now without failure using 6.4.1.

Note: See TracTickets for help on using tickets.