You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello
while fiddling with the toy js parser I have made, i came across weird 139 (that is, Segmentation fault) errors which are driving me nuts. I've pruned every unnecessary part of the parser and looks like i have been able to isolate the error-causing case. i have very little experience using debugging tools to delve in this issue all by myself; i would hence be glad if someone could help me find out what is going on .
i have been experiencing it on 5.6.0 and up (i.e, even with the latest stable 5.9.* which i even built from source)
Thanks a lot reading this far, and I hope you could reproduce the error case. Simply run the "run.sh" thing 40-times or so, and the read the "lubelean.log"; please note, though, that the "lubelean.log" already contains the logs I received by running 'run.sh' which means if you need your own logs, you must delete it and then run 'run.sh'.
Thanks for such a quick reply!
Actually, the reason lubelean.js is so big is because i thought someone might want to use other cases (that is, other js code snippets than the default one i have provided.) I'd be glad to make it smaller if it is necessary.
@icefapper I got this stack trace by running node inside a debugger (e.g lldb -- node lubelean.js). This shows that the segfault crash occurs while gc is iterating some objects. I am continuing to look into this further.
Reacted by icefapper, Sean Vieira, Will Bartlett and YehonataNN
@ChALkeR funny, I thought the segv error is due to the stack getting repeatedly pushd and popd as the precedences fluctuated (in prseNonSeqExpr); you've proven me wrong :)
laugh at me, but aside from the prevalent 139 i frequently got, there was also a 132 error (i.e, "invalid instruction") occasionally showing up, this time coupled with a core dump, and "slice" was always the first frame that appeard in the dump; now i'm not telling the slice is the culprit, but it just makes me quite suspicious about it
Very curious. I see a bunch of deadbeef, and kin, in the area of the heap around we die while doing a GC walk. This is the only area on this heap page that I found deadbeef. https://gist.github.com/ofrobots/2e1c02541bfc0ebb675c
@icefapper I haven't been able to reproduce the invalid instruction crashes. That is interesting. These kinds of symptoms would indicate a memory-corruption type failure to me. If you do have those core dumps still available, I would be interested in know about what is in memory around the instruction the processor was trying to execute. I can give you the commands to run to get this data.
Activity
ChALkeR commentedon Mar 25, 2016
I can reproduce a segfault with just
node lubelean.js, with this file: https://raw.githubusercontent.com/icefapper/lubejs/fd592cd28796cf3f557853b5011abcade6ea29fd/lubelean.jsRequires several runs, though.
It doesn't use any modules or Node.js API, except for the console. Most probably this is a v8 issue.
@icefapper could you try to produce a smaller testcase?
icefapper commentedon Mar 25, 2016
Thanks for such a quick reply!
Actually, the reason lubelean.js is so big is because i thought someone might want to use other cases (that is, other js code snippets than the default one i have provided.) I'd be glad to make it smaller if it is necessary.
Regards,
Neni
ChALkeR commentedon Mar 25, 2016
@icefapper I've done some initial cleanup in https://github.com/ChALkeR/lubejs/blob/master/lubelean.js.
Just removing methods that were not being called reduced the line count about three times.
icefapper commentedon Mar 25, 2016
WoW! I just did some leaning myself; I confess though, it is by no means leaner than yours :
https://github.com/icefapper/lubejs/raw/master/lubelean.js
ofrobots commentedon Mar 25, 2016
Stack trace:
icefapper commentedon Mar 25, 2016
@ofrobots sorry for asking a newbieish thing, but, could i ask what it means and how you acquird it? thanks a lot
ofrobots commentedon Mar 25, 2016
@icefapper I got this stack trace by running node inside a debugger (e.g
lldb -- node lubelean.js). This shows that the segfault crash occurs while gc is iterating some objects. I am continuing to look into this further.ofrobots commentedon Mar 25, 2016
EDIT: v8 print is not to be trusted.
ChALkeR commentedon Mar 25, 2016
I performed a bit more cleanup, the result is at https://github.com/ChALkeR/lubejs
ofrobots commentedon Mar 25, 2016
@ChALkeR thanks! I can reproduce the crash with vanilla d8; replacing
console.logwithprint.icefapper commentedon Mar 25, 2016
@ChALkeR funny, I thought the segv error is due to the stack getting repeatedly pushd and popd as the precedences fluctuated (in prseNonSeqExpr); you've proven me wrong :)
icefapper commentedon Mar 25, 2016
laugh at me, but aside from the prevalent 139 i frequently got, there was also a 132 error (i.e, "invalid instruction") occasionally showing up, this time coupled with a core dump, and "slice" was always the first frame that appeard in the dump; now i'm not telling the slice is the culprit, but it just makes me quite suspicious about it
ofrobots commentedon Mar 25, 2016
Very curious. I see a bunch of
deadbeef, and kin, in the area of the heap around we die while doing a GC walk. This is the only area on this heap page that I founddeadbeef. https://gist.github.com/ofrobots/2e1c02541bfc0ebb675c@icefapper I haven't been able to reproduce the invalid instruction crashes. That is interesting. These kinds of symptoms would indicate a memory-corruption type failure to me. If you do have those core dumps still available, I would be interested in know about what is in memory around the instruction the processor was trying to execute. I can give you the commands to run to get this data.
20 remaining items
deps: fix segfault during gc
ofrobots commentedon Jun 15, 2016
The problem still exist on on
v4.xandv5.x.ChALkeR commentedon Jun 15, 2016
@ofrobots
Is there anything actionable here (i.e. is it feasible to backport the fix)?Edit: ah, I see the PR for 4.x.
ofrobots commentedon Jun 15, 2016
Yes, I opened the PR for
v4.xhere: #7303.I am not sure there is enough runway left on
v5.xfor it to be worth fixing on that branch.deps: backport e7cc609 from upstream V8
deps: fix segfault during gc
deps: backport e7cc609 from upstream V8
deps: fix segfault during gc
targos commentedon Jul 13, 2016
Can we close this? The fix has landed in
v4.x-stagingand I don't think we will be doing any new release of v5.MylesBorins commentedon Jul 13, 2016
v5 is eol. closing.
deps: port d9e9d9f to deps/v8z
deps: port 1164f54 to deps/v8z
dalvizu commentedon Jan 6, 2017
In case anyone was wondering what the fixed versions were I believe this is it: