Opened 12 years ago

Closed 12 years ago

Last modified 48 years ago

#394 closed bug (Fixed)

program seqfaults when translated with profiling

Reported by: c_maeder Owned by: nobody
Priority: normal Milestone:
Component: Compiler Version: 6.4
Keywords: Cc:
Operating System: Architecture:
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


The following program seqfaults when translated with
profiling under linux und with ghc-6.4 and ghc-6.4.1.

If I omit the last element of the string list or if I
use the list directly (without the definitiion of the
constant "mainS") the problem is gone. Also ghc-6.2.2
does not have the problem.

maeder@jupiter -> ghc --version
The Glorious Glasgow Haskell Compilation System,

maeder@jupiter -> ghc --make -prof -auto-all
seqfault.hs -no-recomp
Chasing modules from: seqfault.hs
Compiling Main             ( seqfault.hs, seqfault.o )
Linking ...

maeder@jupiter -> ./a.out
Segmentation fault

maeder@jupiter -> uname -a
Linux jupiter 2.6.8-24.14-smp #1 SMP Tue Mar 29
09:27:43 UTC 2005 i686 i686 i386GNU/Linux

Attachments (1)

seqfault.2.hs (1.3 KB) - added by c_maeder 12 years ago.

Download all attachments as: .zip

Change History (2)

Changed 12 years ago by c_maeder

Attachment: seqfault.2.hs added

comment:1 Changed 12 years ago by simonmar

Status: assignedclosed
Logged In: YES 

This is an interesting bug.

The code generated for the program with profiling on causes
the gcc to use up more than the available 8k of C stack
space we reserve for it.

There are various workarounds: using gcc-4.0.0 works, also
using -fasm works (and the code generated by the NCG is much
better than gcc, incedentally).

Just bumping the 8k would just make the bug less likely to
happen.    I've installed an error message in the mangler to
help catch this in the future.  This isn't a fix as such,
but it means we won't get segfaults in the future.

Note: See TracTickets for help on using tickets.