Opened 9 years ago

Closed 9 years ago

#4967 closed bug (worksforme)

internal error: stg_ap_v_ret on forkProcess + executeFile

Reported by: udoprog Owned by: simonmar
Priority: high Milestone: 7.2.1
Component: Compiler Version: 6.12.1
Keywords: forkProcess stg_ap_v_ret Cc:
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

I've so far been unable to reproduce the bug, due to my inexperience in haskell as a Language, so I apoligize beforehand about the amount of code related. On request I will keep trying to isolate it and update this ticket, or If one of you point out some obvious ignorance on my part.

To reproduce this problem, build the project at: https://github.com/udoprog/gabriel/tree/unix-experimental

Create a new directory:

#> mkdir test
#> cd test

Run a test application in gabriel:

#> gabriel -- cat
gabriel[cat][28108]: STARTING cat
gabriel[cat][28108]: EXITED Terminated 15
gabriel[cat][28108]: WAITING 5 seconds
gabriel[cat][28108]: STARTING cat
gabriel: internal error: stg_ap_v_ret
    (GHC version 6.12.1 for x86_64_unknown_linux)
    Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
gabriel[cat][28108]: EXITED Terminated 6
gabriel[cat][28108]: WAITING 5 seconds
^Cgabriel[cat][28108]: Nu child process running
gabriel[cat][28108]: WAIT was Interrupted
gabriel[cat][28108]: Shutting Down

Gabriel will create a subprocess of 'cat' and wrap it, the 'EXITED Terminated 15' is reproduced by finding out the pid of the child process 'ps faux | grep cat' and killing it 'kill <pid>'. The point is that gabriel should restart the process, but unfortunately that is not what happens.

Other than that, I opted to implement my own fork/exec over the System.Process(createProcess) which can be found in Gabriel/SubProcess.hs since I wanted to be able to send custom signals to the process. I believe that the error can somehow be reproduced by focusing on this code.

Change History (5)

comment:1 Changed 9 years ago by igloo

Milestone: 7.2.1
Status: newinfoneeded

I'm a little confused: Can you reproduce this problem?

If so, if you are able to remove dependencies on other packages (e.g. does it still happen if you just print messages, rather than using hsyslog?), that would make it easier for us to look into.

If it only happened once, then there's not much we can do without a way to reproduce it.

comment:2 Changed 9 years ago by simonmar

Status: infoneedednew
Type of failure: None/UnknownRuntime crash

No response from submitter, but he provided enough info and code for us to reproduce, so we should try.

comment:3 Changed 9 years ago by simonmar

Owner: set to simonmar
Priority: normalhigh

comment:4 Changed 9 years ago by udoprog

I was unable to reproduce the problem using only my custom fork/exec code, which can be found with a simple example here:

http://toolchain.eu/open/Main.hs

Tested with both ghc-6.12.1 and ghc-6.12.3

This indicates that the problem must be a combination either of that very specific case I linked above on the github branch, it seems to work fine without daemonization so there might be some issues in combination with the following package:

http://hackage.haskell.org/package/hdaemonize

Other than that, the branch I posted builds and runs fine with ghc-6.12.3. Since my package maintainer saw it fit to upgrade, retrying the whole build chain with ghc-6.12.1 is a bit difficult for me atm.

So now it might be possible to reproduce if the following criterias are met:

Preferably stdout should be redirected somewhere sane, so it can be examined later, otherwise 'daemonize' will simply close it.

Hope this either enables you to close this bug, or check if it is valid.

comment:5 Changed 9 years ago by simonmar

Resolution: worksforme
Status: newclosed

I can't reproduce this with 7.0.3 on Linux/x86_64:

May 26 09:21:39 cam-04-unx gabriel[cat][8723]: Running cat
May 26 09:21:48 cam-04-unx gabriel[cat][8723]: Process exited with code ExitFailure 15
May 26 09:21:48 cam-04-unx gabriel[cat][8723]: Process unexpectedly terminated
May 26 09:21:48 cam-04-unx gabriel[cat][8723]: WAITING 5 seconds
May 26 09:21:53 cam-04-unx gabriel[cat][8723]: Running cat
May 26 09:21:56 cam-04-unx gabriel[cat][8723]: Process exited with code ExitFailure 15
May 26 09:21:56 cam-04-unx gabriel[cat][8723]: Process unexpectedly terminated
May 26 09:21:56 cam-04-unx gabriel[cat][8723]: WAITING 5 seconds
May 26 09:22:01 cam-04-unx gabriel[cat][8723]: Running cat

It could be related to #4449.

Note: See TracTickets for help on using tickets.