Skip to content
This repository was archived by the owner on Apr 22, 2023. It is now read-only.

Segfault when 0.12.2 built with gcc 5.1.0 on illumos #25281

Closed
alhazred opened this issue May 12, 2015 · 16 comments
Closed

Segfault when 0.12.2 built with gcc 5.1.0 on illumos #25281

alhazred opened this issue May 12, 2015 · 16 comments
Assignees
Milestone

Comments

@alhazred
Copy link

# ./node
Segmentation Fault (core dumped)
# mdb core
Loading modules: [ libumem.so.1 libc.so.1 ld.so.1 ]
> $G
C++ symbol demangling enabled
> $c
v8::internal::String::WriteToFlat<unsigned short>+0x7fc(9e025971, 9e026d36, 1f, 3c, 804787c, 6a7)
_ZN2v88internalL39StringReplaceGlobalAtomRegExpWithStringINS0_16SeqTwoByteStringEEEPNS0_6ObjectEPNS0_7IsolateENS0_6HandleINS0_6StringEEENS7_
INS0_8JSRegExpEEES9_NS7_INS0_7JSArrayEEE.constprop.415+0x15f(9044008, 80479a8, 80479a4, 80479a0, 804799c, 8)
v8::internal::Runtime_StringReplaceGlobalRegExpWithString+0x50f(4, 80479a8, 9044008, bcb0a361, 8047980, 80479d8)
0xbcb0a3d6(98a69809, 9ff234f1, 9e026bf9, 9e025971, 98a08091, 98a08091)
0xbcb5bab3(9ff234f1, 9e026bf9, 9e025971, 98a2f271, 9ff360d5, 98a3978d)
0xbcb591c8(98a410b1, 98a3978d, 98a08091, 98a08091, 98a08091, 98a08091)
0xbcb4da13(98a364f1, 98a410b1, 98a41115, 98a40ff5, 8047a6c, bcb46f15)
0xbcb4d0ec(98a41139, 98a364f1, 98a41115, bcb46e81, 10, 0)
0xbcb46f15(0, 0, bcb25601, 0, 0, 0)
0xbcb256aa(bcb4cae0, 9e041d65, 98a364f1, 1, 8047c0c, 90b9cb8)
v8::internal::Execution::Call+0x129(8047b3c, 9044008, 908d014, 908d018, 1, 8047c0c)
v8::Function::Call+0x99(8047bb0, 908d014, 908d018, 1, 8047c0c, 908d050)
node::LoadEnvironment+0x278(909cac8, 0, 9043fd8, 833535f)
node::Start+0x14d(1, 8047d20, 8047cf8, 8324a2a, feffb0a4, 8047d00)
main+0x1b(8047cdc, fe8586e8, 8047d14, 8239df3, 1, 8047d20)
_start+0x83(1, 8047de0, 0, 8047de7, 8047df8, 8047e03)
@misterdjules
Copy link

It seems that it might be related to #9227 and https://code.google.com/p/chromium/issues/detail?id=152407#c11.

Could you please show us the complete log of the build process. I'm especially interested in seeing the optimization flags used by g++ to build V8.

Are you able to reproduce the problem with gcc 4.x?

@alhazred
Copy link
Author

On 13 May 2015 at 02:44:25, Julien Gilli (notifications@github.com) wrote:
It seems that it might be related to #9227 and https://code.google.com/p/chromium/issues/detail?id=152407#c11.

Could you please show us the complete log of the build process. I'm especially interested in seeing the optimization flags used by g++ to build V8.

Are you able to reproduce the problem with gcc 4.x?

You can find build log on Dropbox: https://www.dropbox.com/s/fsyqp9g9t2gqbyv/log5?dl=0
No problem with using gcc 4.8.1. Looks like there are no different flags when building with 4.8.1 or 5.1.0.

But problem is gone when I use -gO2 instead of -gO3.

Alexander


Reply to this email directly or view it on GitHub.

@misterdjules
Copy link

Thank you. Can you try building io.js, which comes with a newer V8, with GCC 5.1 and -O3, and let us know if you get the same problem?

@alhazred
Copy link
Author

No, io.js doesn't have such problem ;)

@misterdjules
Copy link

This issue in Chromium seems like it could be related too: https://code.google.com/p/chromium/issues/detail?id=412967.

@joyent/node-tsc I don't have the time to investigate potential fixes right now, but if we can validate that the fix mentioned above fixes this specific issue (using GCC 5.1.0 on SmartOS 32 bits), then we should also investigate what other platforms are affected and the extent of the problem.

@misterdjules misterdjules added this to the 0.12.6 milestone Jun 16, 2015
@misterdjules
Copy link

@joyent/node-tsc Set P-1 because I suspect we would get a lot more reporters of this problem if it affects every recent version of GCC on 32 bits systems. If it turns out this issue is more specific to a single platform or a restricted set of GCC versions, then we can lower the priority.

@misterdjules
Copy link

@orangemocha That's potentially related to the issues you're seeing on the build platform.

@orangemocha
Copy link
Contributor

The stack trace is very similar to the issue described https://code.google.com/p/chromium/issues/detail?id=412967. It's almost certainly the same issue.

I am going to investigate a couple of options:

  1. Backporting the patches listed in the Chromium issue
  2. build deps/v8 with -fvect-cost-model=cheap. @joaocgreis verified this solves the issue. But it might have performance implications.

@misterdjules
Copy link

@alhazred Do you have some time to try the fix in #25556?

@alhazred
Copy link
Author

I've built janeasystems/node with 5.1, unfortunately same core.

@misterdjules
Copy link

@alhazred Did you build the joaocgreis-pick-v8-smartos branch from janeasystems/node?

@alhazred
Copy link
Author

Ah.. End of the day :) give me a min

@misterdjules
Copy link

@alhazred No worries, your help is very much appreciated 👍

@alhazred
Copy link
Author

Bingo! Thank you very much for this :)

@misterdjules
Copy link

That's all thanks to @joaocgreis' work :)

@alhazred Thank you very much to you for helping us solve this! 👍

joaocgreis pushed a commit that referenced this issue Jul 1, 2015
Fixes segfault in 32bit SmartOS when built with GCC 4.9.

This is the first of two backports from upstream v8:
1. v8/v8@90dc5c9
2. v8/v8@7cb82a7

Original commit message:

  Do not use wide reads in CopyCharsUnsigned.

  R=jkummerow@chromium.org
  BUG=chromium:412967
  LOG=Y

  Review URL: https://codereview.chromium.org/566583002

  git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@23876 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

V8 issue: https://code.google.com/p/chromium/issues/detail?id=412967

Fixes #25281

Reviewed-By: Julien Gilli <julien.gilli@joyent.com>
PR-URL: #25556
joaocgreis pushed a commit that referenced this issue Jul 1, 2015
Fixes segfault in 32bit SmartOS when built with GCC 4.9.

This is the second of two backports from upstream v8:
1. v8/v8@90dc5c9
2. v8/v8@7cb82a7

Original commit message:

  Reland "Remove V8_HOST_CAN_READ_UNALIGNED and its uses."

  BUG=chromium:412967
  LOG=N
  R=jkummerow@chromium.org

  Review URL: https://codereview.chromium.org/571903002

  git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@23938 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

V8 issue: https://code.google.com/p/chromium/issues/detail?id=412967

Fixes #25281

Reviewed-By: Julien Gilli <julien.gilli@joyent.com>
PR-URL: #25556
@joaocgreis
Copy link
Member

Fixed by 48b0ca2 and 13ea50e

@misterdjules misterdjules modified the milestones: 0.12.6, 0.12.7 Jul 6, 2015
@misterdjules misterdjules removed this from the 0.12.6 milestone Jul 6, 2015
jBarz pushed a commit to ibmruntimes/node that referenced this issue Nov 4, 2016
Fixes segfault in 32bit SmartOS when built with GCC 4.9.

This is the first of two backports from upstream v8:
1. v8/v8@90dc5c9
2. v8/v8@7cb82a7

Original commit message:

  Do not use wide reads in CopyCharsUnsigned.

  R=jkummerow@chromium.org
  BUG=chromium:412967
  LOG=Y

  Review URL: https://codereview.chromium.org/566583002

  git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@23876 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

V8 issue: https://code.google.com/p/chromium/issues/detail?id=412967

Fixes nodejs#25281

Reviewed-By: Julien Gilli <julien.gilli@joyent.com>
PR-URL: nodejs#25556
jBarz pushed a commit to ibmruntimes/node that referenced this issue Nov 4, 2016
Fixes segfault in 32bit SmartOS when built with GCC 4.9.

This is the second of two backports from upstream v8:
1. v8/v8@90dc5c9
2. v8/v8@7cb82a7

Original commit message:

  Reland "Remove V8_HOST_CAN_READ_UNALIGNED and its uses."

  BUG=chromium:412967
  LOG=N
  R=jkummerow@chromium.org

  Review URL: https://codereview.chromium.org/571903002

  git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@23938 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

V8 issue: https://code.google.com/p/chromium/issues/detail?id=412967

Fixes nodejs#25281

Reviewed-By: Julien Gilli <julien.gilli@joyent.com>
PR-URL: nodejs#25556
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants