Uh oh!
There was an error while loading. Please reload this page.
v8: fix segmentation faults caused by IntegerValue - #2722
Conversation
rvagg
commented
Sep 7, 2015
Weird, I'd love to lgtm this but I don't see why it would optimise that into a buggy state. Anyone else? @indutny, @bnoordhuis perhaps? |
evanlucas
commented
Sep 7, 2015
Switch from |
Fishrock123
commented
Sep 7, 2015
This needs to be upstreamed to V8 for us to accept it. One of the two already cc'd people should be abel to help with that. :) |
silverwind
commented
Sep 7, 2015
Both patches fix the segfaults for me. While it should be upstreamed, I'd much prefer if we float this now. |
mscdex
commented
Sep 7, 2015
+1 to floating in the meantime or using @evanlucas's proposed change on our side, especially if we want to get 4.0.0 out today/tomorrow. |
silverwind
commented
Sep 7, 2015
ping @pmq20: care to change it to @evanlucas's suggestion? |
brody2consult
commented
Sep 7, 2015
I just issued #2726 with the workaround solution by @evanlucas on the v4.0.0-rc branch. I hope we can get them to fix it in v8 in the near future. |
evanlucas
commented
Sep 7, 2015
This is a bug in child_process, _validateStdio specifically. #2727 |
indutny
commented
Sep 7, 2015
I don't like landing things that I do not understand. May I ask you to dump assembly output from this function before and after your patch? |
evanlucas
commented
Sep 7, 2015
@indutny sure, know of the best way to do that on OS X? In short, |
indutny
commented
Sep 7, 2015
Oh, this is reproducible on mac? I'll do the dumps myself then. |
evanlucas
commented
Sep 7, 2015
Yes |
indutny
commented
Sep 7, 2015
This is a somewhat better fix for this problem: #2730 . This removes the cause of the problem. The problem itself is not yet clear to me, but I hope it fixes the crashes. |
indutny
commented
Sep 7, 2015
Nevermind that PR. @evanlucas already figured it out, I just didn't listen well to him. I think I know what the problem is... investigating! |
indutny
commented
Sep 7, 2015
Please do not land it yet, I'm very close to the resolution. The problem is with the handle zapping, and this PR is somewhat a solution for this, but I want to be sure before we do anything like this. |
indutny
commented
Sep 7, 2015
After some thinking, I think we should land: #2727 , and submit this patch to the v8 team. Please let me know if you need help setting up the environment for this. I'm against landing it without v8 team review, but overall I think that this is the right solution for the problem. |
indutny
commented
Sep 7, 2015
Also, please cc me on that CL. I will provide all required information to the v8 team. |
bnoordhuis
commented
Sep 7, 2015
I left a comment here with details but in a nutshell, I think this PR is correct in that it fixes an insidious scope bug in the |
rvagg
commented
Sep 7, 2015
OK folks, we have this, #2727 and #2731 with none resolved. From what I can see from the discussion, both this and #2727 look like candidates for landing and have close enough to approval to go in and #2731 seems to have approval although is apparently not the appropriate fix for the bug, just a nice thing to have. We have to get v4.0.0 out, the timeline we are working to now has ~12 hours less, could owners of these issues or other collaborators involved who understand the issue please step up and merge what should be merged and close anything that shouldn't be merged. I'll push out an rc.3 if we get this done in enough time to bother. |
indutny
commented
Sep 8, 2015
@rvagg#2727 is almost good to go. If @evanlucas won't have to fix it himself - I'll do it for him. #2731 is not bad to have, but is not a fix for this problem either. and this PR is a "no go" in our repo, it should be submitted and landed in V8, #2727 is enough to fix the problem on our side. |
indutny
commented
Sep 8, 2015
indutny
commented
Sep 8, 2015
I'd still look into landing #2731, though, but this depends on @bnoordhuis availability. |
silverwind
commented
Sep 8, 2015
Looks this PR is obsolete now, Thanks for your work in discovering this thought, @pmq20. |
indutny
commented
Sep 8, 2015
@pmq20 let's work together to submit this to v8 team. |
pmq20
commented
Sep 8, 2015
@indutny@silverwind Sorry for the delayed reply. I work in the +8 time zone and just woke up so there's a lot for me to catch up. |
pmq20
commented
Sep 8, 2015
@indutny OK, I'll write a test to reproduce the bug on the sole v8 land. |
indutny
commented
Sep 8, 2015
@pmq20 take a look at cctest-api. This is something that you might be interested in, also your test should call |
pmq20
commented
Sep 8, 2015
@indutny Thanks for the hint! Looking into it |
pmq20
commented
Sep 8, 2015
I have added a v8 test and submitted a CL, let's continue the discussion there. |
indutny
commented
Sep 8, 2015
Yay, thank you! |
This PR fixes#2721 and adds a test to guard it.
Investigations show that the problem was caused by -O3 optimisations of the compiler. When building a debug version the segmentation fault won't be triggered. Moving the return statement inside the inner scope somehow fixes the malicious optimisation.