Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation fault (core dumped) - Debug on Ubuntu #1355

Open
bknill opened this issue Aug 4, 2019 · 15 comments
Open

Segmentation fault (core dumped) - Debug on Ubuntu #1355

bknill opened this issue Aug 4, 2019 · 15 comments
Labels
bug Something isn't working

Comments

@bknill
Copy link

bknill commented Aug 4, 2019

Hi,

I'm getting a crash with an error message

Segmentation fault (core dumped)

Is there anyway to debug this?

Thanks

@avaer
Copy link
Member

avaer commented Aug 4, 2019

Yes, you can use gdb with node to get a backtrace (bt) to see what's hanging it up.

@bknill
Copy link
Author

bknill commented Aug 4, 2019

Sorry @modulesio I've been trying to get this running on Ubuntu but it's failing because of the Node version check doesn't appear to return what you need in index line 3.

Break on start in file:///home/owner/workspace/client/exokit/src/index.js:3
1
2

3 if (require.main === module && !/^1[12]./.test(process.versions.node)) {
4 throw new Error('node 11 or 12 required');
5 }

Do you know how to get this running?

@avaer
Copy link
Member

avaer commented Aug 4, 2019

Node 12 is required before building.

On Ubuntu, the best way to get the right version of node is probably https://github.com/nvm-sh/nvm.

@bknill
Copy link
Author

bknill commented Aug 4, 2019

Yes I have node 12. Exokit is running normally just crashing with the above error. I've had it running my app before, just can't find what the problem is right now.

@avaer
Copy link
Member

avaer commented Aug 4, 2019

Interesting, when you run node what do you get with:

process.versions.node

@bknill
Copy link
Author

bknill commented Aug 5, 2019

Hmm this is with node inspect which is throwing errors when I try and console log that.

Bit new to node.

@avaer
Copy link
Member

avaer commented Aug 5, 2019

You can just run node regularly with node, which will give you a CLI. Then you can log what the version of node is. (we're trying to figure out why, if you have node 12, that check is failing)

@bknill
Copy link
Author

bknill commented Aug 5, 2019

Running 12.2.0

@avaer
Copy link
Member

avaer commented Aug 5, 2019

Oh wait, are we simply running everything in node inspect without continuing the breakpoint? Then the node inspector is probably just waiting for continue in the interface.

Either way, to debug a segfault we would need gdb (not node inspect).

gdb node
run . /home/owner/workspace/client/exokit/src/index.js
c
bt

Or similar.

@bknill
Copy link
Author

bknill commented Aug 5, 2019

Yes! Sorry found it.. just had to type run and I'm off.

Found the error - relates to the Redux websocket connection to the debugger.

Have now found another load of errors which I'll try and fix. Thanks

@bknill bknill closed this as completed Aug 5, 2019
@avaer
Copy link
Member

avaer commented Aug 5, 2019

Awesome, let us know if you get stuck!

@bknill bknill reopened this Aug 5, 2019
@bknill
Copy link
Author

bknill commented Aug 5, 2019

Ha yep stuck!

This error:

Thread 12 "node" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffd7fe8700 (LWP 21194)]
0x00000000040fc360 in ?? ()

This from the backtrace

#0  0x00000000040fc360 in ?? ()
#1  0x00007fffde249d27 in glfwMakeContextCurrent () from /home/owner/workspace/client/exokit/build/Release/exokit.node
#2  0x00007fffde1f692a in glfw::SetCurrentWindowContext(GLFWwindow*) () from /home/owner/workspace/client/exokit/build/Release/exokit.node
#3  0x00007fffde1f6be5 in glfw::InitWindow2D(Nan::FunctionCallbackInfo<v8::Value> const&) () from /home/owner/workspace/client/exokit/build/Release/exokit.node
#4  0x00007fffde1f0fbf in Nan::imp::FunctionCallbackWrapper () from /home/owner/workspace/client/exokit/build/Release/exokit.node
#5  0x0000000000b8ed76 in v8::internal::MaybeHandle<v8::internal::Object> v8::internal::(anonymous namespace)::HandleApiCallHelper<false>(v8::internal::Isolate*, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::FunctionTemplateInfo>, v8::internal::Handle<v8::internal::Object>, v8::internal::BuiltinArguments) ()
#6  0x0000000000b90c89 in v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) ()
#7  0x0000000001a86142 in Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_NoBuiltinExit () at ../../deps/v8/src/builtins/base.tq:1866
#8  0x00000000019f05c4 in Builtins_InterpreterEntryTrampoline () at ../../deps/v8/src/builtins/base.tq:107

Mean anything?

@avaer
Copy link
Member

avaer commented Aug 5, 2019

It means that something is wrong with the OpenGL context creation, since it cannot switch to the context that was made.

Do you have a reproduction HTML file for this?

@bknill
Copy link
Author

bknill commented Aug 5, 2019

No sorry. It's just local at the moment. I'll try and get a build done to a test host.

It's opening 2 Exokit windows, is that correct?

And it's running some of the time.

@avaer
Copy link
Member

avaer commented Aug 5, 2019

I can't tell from that stack trace alone what the issue is, but Exokit opens one window for every context, depending on visibility.

If you could get any kind of HTML reproduction that crashes on the system, that would be helpful for debugging.

It could very well be a race condition.

@avaer avaer added the bug Something isn't working label Aug 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants