Opened 3 years ago

Last modified 2 months ago

#8406 infoneeded bug

Invalid object in isRetainer() or Segfault

Reported by: crockeea Owned by:
Priority: normal Milestone:
Component: Runtime System Version: 7.8.3
Keywords: Cc: bgamari@…, simonmar, maoe
Operating System: Linux Architecture: x86_64 (amd64)
Type of failure: Runtime crash Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description (last modified by JamesM)

When compiling with -rtsopts -threaded -prof -fprof-auto -caf-all

and running with -N4 -hr

I get a "Segmentation fault" every time.

If I run with -N4 -qg1 -hr, I either get a segfault or internal error: Invalid object in isRetainer(): 40

When the segfault happens, it happens quickly. If the segfault doesn't happen, the program runs for about 5 seconds and I get "invalid object" error (always 40).

Without -hr, I have never gotten a segfault.

Edit (1/2015): This is still occurring under multiple threads in ghc 7.8.3. GHC options: -Wall -prof -fprof-auto -threaded -rtsopts Runtime Options: -N4 -hr -L1000

Change History (20)

comment:1 Changed 3 years ago by crockeea

I forgot to add that if I don't specify either of "-N4" or "-qg1" (but still compile with -threaded), the program runs as expected and does not crash. The problem also occurred with GHC-7.6.2.

Last edited 3 years ago by crockeea (previous) (diff)

comment:2 Changed 3 years ago by thoughtpolice

Does this happen for all programs, or only a specific one? Can you provide a small testcase, if possible? Thanks!

comment:3 Changed 3 years ago by crockeea

It just happened for one program I'm profiling at the moment. It's quite large, so I may not be able to get a small test case.

comment:4 Changed 3 years ago by bgamari

  • Cc bgamari@… added

comment:5 Changed 3 years ago by simonmar

  • Status changed from new to infoneeded

We had a similar problem a while back - #5909, but that was fixed in 7.6.2. Are you sure you're using 7.6.3?

If so, we'll need some repro instructions.

comment:6 Changed 3 years ago by crockeea

I had the problem in 7.6.2, then specifically upgraded to 7.6.3 in the hopes it would be fixed. No dice.

comment:7 Changed 22 months ago by thoughtpolice

  • Milestone set to 7.10.1

Moving to 7.10.1.

comment:8 Changed 18 months ago by thomie

  • Cc simonmar added
  • Component changed from Compiler to Runtime System

crockeea: could you try to compile your program with 7.8.3? Without a testcase it's hard to do anything. Should we keep this ticket open?

comment:9 Changed 18 months ago by crockeea

I won't be able to come up with an testcase anymore. My guess is that there was (is?) a problem with -hr and multithreading, but I no longer have the code and the problem does not occur in 7.8.3 with a simple single-threaded example.

comment:10 Changed 18 months ago by thomie

  • Resolution set to worksforme
  • Status changed from infoneeded to closed

Let's close it then, things have changed quite a bit since 7.6.3. If the problems shows up again, please do re-open.

comment:11 Changed 16 months ago by JamesM

  • Description modified (diff)
  • Resolution worksforme deleted
  • Status changed from closed to new
  • Version changed from 7.6.3 to 7.8.3

This is still occurring for me. However, it is only problematic when using multiple threads changing from -N4 to -N1 removes the issue:

par-simulator: internal error: Invalid object in isRetainer(): 39

(GHC version 7.8.3 for x86_64_apple_darwin) Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug

Abort trap: 6

comment:12 Changed 15 months ago by thoughtpolice

  • Milestone changed from 7.10.1 to 7.10.2
  • Status changed from new to infoneeded

Can we still get a testcase if at all possible? As long as it has reproducible build instructions - without that, there's very little hope of us being able to do much here.

FWIW, it looks unlikely this will make 7.10, so I'm moving out to a later milestone for a future bugfix release.

comment:13 Changed 12 months ago by thoughtpolice

  • Milestone changed from 7.10.2 to 7.12.1

(Moving to 7.12.1, as lack of updates means this is unlikely to be slated for 7.10.2)

comment:14 Changed 8 months ago by thoughtpolice

  • Milestone changed from 7.12.1 to 8.0.1

Milestone renamed

comment:15 Changed 8 months ago by pallly

I have the same problem, here is my code: http://hub.darcs.net/pallly/hdur

When I run the executable with +RTS -hr, it crashes with the "Invalid object in isRetainer(): 8" error. (Maybe you'll need to press the 'o' key).

If you'll have dependency problems with hsqml and GHC 7.10, pull it from the repo http://hub.darcs.net/komadori/HsQML/ and setup the cabal sandbox to use the pulled package

Last edited 8 months ago by pallly (previous) (diff)

comment:16 Changed 3 months ago by thomie

pally: I can not reproduce your problem. Which platform are you on? And how long does it take before your program crashes?

Here's what I tried:

  • I'm using Ubuntu 14.04 Linux, x86-64.
  • I installed the following packages, after some trial and error: libfftw3-dev libopenal-dev qtchooser qtbase5-dev qtdeclarative5-dev qtdeclarative5-qtquick2-plugin darcs
  • cabal sandbox init
  • darcs get http://hub.darcs.net/pallly/hdur
  • darcs get http://hub.darcs.net/komadori/HsQML
  • cabal install HsQML/
  • cabal install hdur/
  • .cabal-sandbox/bin/hdur # Fails with some module not found error (frustrating! please fix, cabal install should have caught that)
  • I then installed qml-module-qtquick2 from 15.04 (vivid). This also upgraded most other qt related packages
  • .cabal-sandbox/bin/hdur
  • I see a grey window with the subtext "foobar". When I press 'o', a black squiggly line appears on a white background.
  • No crash.

Edit: +RTS -hr yields invalid heap profile option: -hr. Can not reproduce with +RTS -N4 either.

Last edited 3 months ago by thomie (previous) (diff)

comment:17 Changed 3 months ago by thomie

  • Milestone 8.0.1 deleted

comment:18 Changed 3 months ago by pallly

In the time of writing my first comment I was using Gentoo Linux, I have just managed to reproduce the problem using Arch Linux (synchronized today) x86-64. Here is how I did it:

  • cabal sandbox init
  • darcs get http://hub.darcs.net/pallly/hdur
  • darcs get http://hub.darcs.net/komadori/HsQML
  • cabal sandbox add-source HsQML/
  • cabal install hdur/ --enable-executable-profiling --enable-library-profiling
  • .cabal-sandbox/bin/hdur +RTS -hr

After spawning the last command the application mostly crashes within a second. If it doesn't, I press 'o' and then it always crashes within a second. Here's the message:

hdur: internal error: Invalid object in isRetainer(): 8
    (GHC version 7.10.3 for x86_64_unknown_linux)
    Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug

If this doesn't help, I could try to reproduce the problem on a fresh debian virtual machine and share the installation/reproduction script.

EDIT: It seems to me now that pressing 'o' is irrelevant for reproducing the problem. It just always crashes in about a second.

Last edited 3 months ago by pallly (previous) (diff)

comment:19 Changed 3 months ago by thomie

Thanks, I can reproduce it now.

comment:20 Changed 2 months ago by maoe

  • Cc maoe added
Note: See TracTickets for help on using tickets.