Ticket #3001 (closed bug: fixed)

Opened 4 years ago

Last modified 4 years ago

Biographical profiling segfaults

Reported by: nad Owned by: igloo
Priority: high Milestone: 6.10.2
Component: Compiler Version:
Keywords: Cc:
Operating System: Linux Architecture: x86
Type of failure: Difficulty: Unknown
Test Case: T3001 T3001-2 Blocked By:
Blocking: Related Tickets:

Description

$ echo "main = print $ replicate 40000 'x'" > Test.hs
$ ghc-6.10.1 --make -prof Test.hs -o test
[1 of 1] Compiling Main             ( Test.hs, Test.o )
Linking test ...
$ ./test +RTS -hb
Segmentation fault

Change History

Changed 4 years ago by igloo

  • priority changed from normal to high
  • difficulty set to Unknown
  • milestone set to 6.10.2

Thanks for the report; we'll take a look.

Changed 4 years ago by igloo

  • owner set to igloo

Changed 4 years ago by igloo

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

Fixed in HEAD and 6.10:

Wed Feb 11 07:34:57 PST 2009  Ian Lynagh <igloo@earth.li>
  * Fix trac #3001: Biographical profiling segfaults
  We were zeroing the wrong memory

Changed 4 years ago by simonmar

  • status changed from closed to reopened
  • resolution fixed deleted

Nice catch Ian. We should add this as a test, clearly the existing test for bio profiling didn't catch the bug.

Changed 4 years ago by nad

  • version 6.10.1 deleted

Biographical profiling still causes segfaults for me, but not on the simple example above. With http://www.haskell.org/ghc/dist/stable/dist/ghc-6.10.1.20090214-src.tar.bz2 and binary-0.4.4 I can trigger a segfault using the following program:

import Data.Binary

main = do
  encodeFile "test.bin" $ replicate 10000 'x'
  print =<< (decodeFile "test.bin" :: IO String)

Changed 4 years ago by igloo

  • status changed from reopened to closed
  • testcase set to T3001 T3001-2
  • resolution set to fixed

Thanks for the follow-up, nad. I've fixed this second problem in HEAD and 6.10-branch:

Wed Feb 18 23:56:20 GMT 2009  Ian Lynagh <igloo@earth.li>
  * Fix an off-by-one; fixes the second bug in trac #3001

and added test cases for them both (T3001, T3001-2).

Note: See TracTickets for help on using tickets.