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

Crash in the Guitar Tuner example #22

Open
bergie opened this issue Jul 25, 2012 · 4 comments
Open

Crash in the Guitar Tuner example #22

bergie opened this issue Jul 25, 2012 · 4 comments

Comments

@bergie
Copy link
Contributor

bergie commented Jul 25, 2012

I ported the guitar tuner example from GNOME developer docs to node-gir and CoffeeScript:

https://github.com/bergie/node-gir/blob/master/examples/guitartuner.coffee

When I try to make GStreamer to play a sound (by clicking a button), there is a segfault. Backtrace is:

(gdb) run guitartuner.js
Starting program: /usr/bin/node guitartuner.js
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff63a8700 (LWP 14064)]
[New Thread 0x7fffee905700 (LWP 14065)]
[New Thread 0x7fffed093700 (LWP 14066)]
369.23

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff5769d60 in g_base_info_equal () from /usr/lib/libgirepository-1.0.so.1
(gdb) bt full
#0  0x00007ffff5769d60 in g_base_info_equal () from /usr/lib/libgirepository-1.0.so.1
No symbol table info available.
#1  0x00007ffff599f21b in gir::GIRObject::New(_GObject*, _GIBaseInfoStub*) () from /home/bergie/Projects/node-gir/build/Release/lib.target/girepository.node
No symbol table info available.
#2  0x00007ffff599c358 in gir::Args::FromGType(_GIArgument*, _GIBaseInfoStub*, int) () from /home/bergie/Projects/node-gir/build/Release/lib.target/girepository.node
No symbol table info available.
#3  0x00007ffff599d35b in gir::Func::Call(_GObject*, _GIBaseInfoStub*, v8::Arguments const&, bool) ()
   from /home/bergie/Projects/node-gir/build/Release/lib.target/girepository.node
No symbol table info available.
#4  0x00007ffff599de75 in gir::GIRObject::CallStaticMethod(v8::Arguments const&) () from /home/bergie/Projects/node-gir/build/Release/lib.target/girepository.node
No symbol table info available.
#5  0x0000000000592b62 in ?? ()
piotras added a commit to piotras/node-gir that referenced this issue Jul 25, 2012
@bergie
Copy link
Contributor Author

bergie commented Jul 25, 2012

After this commit from @piotras it doesn't crash on the first button press, but does crash on the second. Backtrace:

Program received signal SIGSEGV, Segmentation fault.
0x00000000005761f2 in v8::Value::IsFunction() const ()
(gdb) bt full
#0  0x00000000005761f2 in v8::Value::IsFunction() const ()
No symbol table info available.
#1  0x00007ffff599eb24 in gir::GIRObject::Emit(v8::Handle<v8::Value>*, int) () from /home/bergie/Projects/node-gir/build/Release/lib.target/girepository.node
No symbol table info available.
#2  0x00007ffff599ec9d in gir::GIRObject::SignalCallback(_GClosure*, _GValue*, unsigned int, _GValue const*, void*, void*) ()
   from /home/bergie/Projects/node-gir/build/Release/lib.target/girepository.node
No symbol table info available.
#3  0x00007ffff5521ca2 in g_closure_invoke () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
No symbol table info available.
#4  0x00007ffff5532fdd in ?? () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
No symbol table info available.
#5  0x00007ffff553b099 in g_signal_emit_valist () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
No symbol table info available.
#6  0x00007ffff553b242 in g_signal_emit () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
No symbol table info available.
#7  0x00007ffff3e0f0b8 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
No symbol table info available.
#8  0x00007ffff5521ca2 in g_closure_invoke () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
No symbol table info available.
#9  0x00007ffff5533179 in ?? () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
No symbol table info available.
#10 0x00007ffff553b099 in g_signal_emit_valist () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
No symbol table info available.
#11 0x00007ffff553b242 in g_signal_emit () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
No symbol table info available.
#12 0x00007ffff3e0d7f7 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
No symbol table info available.
#13 0x00007ffff3ece501 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
No symbol table info available.
#14 0x00007ffff5521eca in ?? () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
No symbol table info available.
#15 0x00007ffff553a741 in g_signal_emit_valist () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
No symbol table info available.
#16 0x00007ffff553b242 in g_signal_emit () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
No symbol table info available.
#17 0x00007ffff3ff97e9 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
No symbol table info available.
#18 0x00007ffff3ecc3ab in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
---Type <return> to continue, or q <return> to quit---
No symbol table info available.
#19 0x00007ffff3ece0c1 in gtk_main_do_event () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
No symbol table info available.
#20 0x00007ffff3b1dd32 in ?? () from /usr/lib/x86_64-linux-gnu/libgdk-3.so.0
No symbol table info available.
#21 0x00007ffff5264d53 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
No symbol table info available.
#22 0x00007ffff52650a0 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
No symbol table info available.
#23 0x00007ffff526549a in g_main_loop_run () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
No symbol table info available.
#24 0x00007ffff3ecd42d in gtk_main () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
No symbol table info available.
#25 0x00007ffff4ac7a14 in ffi_call_unix64 () from /usr/lib/x86_64-linux-gnu/libffi.so.6
No symbol table info available.
#26 0x00007ffff4ac7435 in ffi_call () from /usr/lib/x86_64-linux-gnu/libffi.so.6
No symbol table info available.
#27 0x00007ffff576aa59 in ?? () from /usr/lib/libgirepository-1.0.so.1
No symbol table info available.
#28 0x00007ffff576be0e in g_function_info_invoke () from /usr/lib/libgirepository-1.0.so.1
No symbol table info available.
#29 0x00007ffff599d294 in gir::Func::Call(_GObject*, _GIBaseInfoStub*, v8::Arguments const&, bool) ()
   from /home/bergie/Projects/node-gir/build/Release/lib.target/girepository.node
No symbol table info available.
#30 0x00007ffff59a34bb in gir::GIRFunction::Execute(v8::Arguments const&) () from /home/bergie/Projects/node-gir/build/Release/lib.target/girepository.node
No symbol table info available.

Also, no sound is emitted.

@JumpLink
Copy link

I think the problem is not the second button, the problem are on all buttons.
You example crash on repeated click on any button, too.
The same on my programm.

If I click on the pdf button, the function generate_pdf dosn't work correctly and my app crash on the second click.

pdf_button.on("clicked", function(){
    generate_pdf('test.pdf');
});

If I change "generate_pdf('test.pdf');" to a simple console.log, my programm works fine.
I think anything is wrong with the button-signal.
Maybe gir think the function is finished and delete anything before he is finished?

@JumpLink
Copy link

JumpLink commented Aug 1, 2012

Its very crazy, I have a gtk-program with 2 buttons. The first create a string and run exec, the second create new gtk.widget's. If I click on any button, my program is crashing, but If I comment out the first on-clicked function, my programm works.. So my program are only working if I have not more than 1 on-button-clicked-signals and I run only 1 function they is a non-gir function or I run only gir-functions (more or less).

I hope this is helpful.

@piotras
Copy link
Collaborator

piotras commented Aug 10, 2012

Crash is caused by exception being thrown in callback. This exception is completely silent. In case of guitar example,you can add try catch block:

try {
    return pipeline.set_state(gst.State.PLAYING);
} catch (err) {
    console.log(err);
}

It doesn't solve the problem, but at least crash goes away and we have proper human readable message.
I am investigating it, cause for some reason playing state is introspectable as interface. Which is obviously wrong as it's enum.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants