Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upProcesses seem to be able to kill themselves #628
Comments
evancz
added
the
bug
label
May 27, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
alphalambda
May 30, 2016
A workaround that stops the crashes is to change line 132 in src/Native/Scheduler.js from
while (numSteps < MAX_STEPS)
into
while (numSteps < MAX_STEPS && process.root)
alphalambda
commented
May 30, 2016
|
A workaround that stops the crashes is to change line 132 in src/Native/Scheduler.js from |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jagare
Jun 13, 2016
I don't think the process is killing itself.
From what I can see in the debugger the process is killed from here:
https://github.com/elm-lang/animation-frame/blob/1.0.0/src/AnimationFrame.elm#L84
But it is not done from the process when it is running!
In my case, adding a few logs, the process with id 840 was killed by pid 3. However there where still a message for pid 840 in the workQueue. In fact after killing pid 840, pid 0 and pid 3 processed one message each before pid 840 was to process a message after it has been killed, which results in the exception.
So it appears to me as if the problem is that the problem comes from that there are messages for the kill process left in the workerQueue. I guess one solution can be to just replace
numSteps = step(numSteps, process);
with
if (process.root) { numSteps = step(numSteps, process); }
Since we want to continue processing the rest of the messages in the workQueue.
jagare
commented
Jun 13, 2016
•
|
I don't think the process is killing itself.
|
jvoigtlaender
referenced this issue
Jun 26, 2016
Closed
Runtime Error: Subscription to Time.every x where x is computed based on the model #1426
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
w0rm
Jul 6, 2016
I just ran into the same issue when trying to stop AnimationFrame. I need this to suspend a game, so that then it can be restored by a message from a port.
UPD: currently I'm patching generated elm.js in the way suggested by @jagare and it seems to be working.
w0rm
commented
Jul 6, 2016
•
|
I just ran into the same issue when trying to stop AnimationFrame. I need this to suspend a game, so that then it can be restored by a message from a port. UPD: currently I'm patching generated elm.js in the way suggested by @jagare and it seems to be working. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
OvermindDL1
Aug 3, 2016
Similar issue (though with subscriptions being turned on/off) at: elm-lang/animation-frame#7
OvermindDL1
commented
Aug 3, 2016
|
Similar issue (though with subscriptions being turned on/off) at: elm-lang/animation-frame#7 |
OvermindDL1
referenced this issue
Aug 4, 2016
Closed
Program gets stuck attempting to swap Subs #612
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
evancz
Aug 4, 2016
Member
I think @jagare has the right idea for the fix. I'll look into it a bit more now.
|
I think @jagare has the right idea for the fix. I'll look into it a bit more now. |
evancz
closed this
in
9320969
Aug 4, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
evancz
Aug 4, 2016
Member
Can people check if elm-lang@9320969 fixes it for them?
If so, I'll do a patch release. Thanks again @jagare!
|
Can people check if elm-lang@9320969 fixes it for them? If so, I'll do a patch release. Thanks again @jagare! |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
OvermindDL1
Aug 4, 2016
That is precisely what I've been doing to my generated javascript (prior to finding this issue, would have saved me time if I'd found it before...) and it works, and based on that processes can be killed it looks like the right thing to do too. I'd love a patch release! ^.^
OvermindDL1
commented
Aug 4, 2016
|
That is precisely what I've been doing to my generated javascript (prior to finding this issue, would have saved me time if I'd found it before...) and it works, and based on that processes can be killed it looks like the right thing to do too. I'd love a patch release! ^.^ |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
evancz
Aug 4, 2016
Member
Cool, thanks for confirming this. I'll do a bit more testing myself and then do a patch.
|
Cool, thanks for confirming this. I'll do a bit more testing myself and then do a patch. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
evancz
Aug 4, 2016
Member
Okay, core 4.0.4 should be out. Thanks again to everyone who helped sort this out!
|
Okay, core 4.0.4 should be out. Thanks again to everyone who helped sort this out! |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
OvermindDL1
Aug 4, 2016
Upgraded, tried my code at work as well as tests and all passed without me needing to mess with the output javascript. Thanks much! ^.^
OvermindDL1
commented
Aug 4, 2016
|
Upgraded, tried my code at work as well as tests and all passed without me needing to mess with the output javascript. Thanks much! ^.^ |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
w0rm
commented
Aug 4, 2016
|
Thanks! |
evancz commentedMay 27, 2016
•
edited
Edited 1 time
-
evancz
edited Aug 4, 2016 (most recent)
@alphalambda made a http://sscce.org/ in which you can trigger a runtime error if you click
PauseandResumea bunch of times.https://gist.github.com/alphalambda/448099e95858b0ffc91fd41fdb1b437a
Looking at where the error happens, it seems that the currently running process is killed while it is running. This suggests to me that the process is somehow killing itself. I don't know how that can be possible.
Update: @jagare says
Suggesting that kill either needs to clear the messages to that node, or that there's some check needed when you start handling a node that isn't there already.