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

random crashes on Win7 x64 #27

Closed
andyschmidt opened this issue Oct 9, 2015 · 33 comments
Closed

random crashes on Win7 x64 #27

andyschmidt opened this issue Oct 9, 2015 · 33 comments

Comments

@andyschmidt
Copy link

When I run watobo with a new version of fxruby on my windows box, watobo is crashing randomly, even without further interaction (after a new project is started).

Here's the crash output:

G:/Projects/watobo/lib/watobo/gui.rb:72: [BUG] Segmentation fault
ruby 2.0.0p647 (2015-08-18) [i386-mingw32]

-- Control frame information -----------------------------------------------
c:0004 p:---- s:0011 e:000010 CFUNC :run
c:0003 p:0097 s:0008 e:000007 METHOD G:/Projects/watobo/lib/watobo/gui.rb:72
c:0002 p:0154 s:0005 E:000348 EVAL watobo_gui.rb:21 [FINISH]
c:0001 p:0000 s:0002 E:00014c TOP [FINISH]

watobo_gui.rb:21:in <main>' G:/Projects/watobo/lib/watobo/gui.rb:72:instart'
G:/Projects/watobo/lib/watobo/gui.rb:72:in `run'

-- C level backtrace information -------------------------------------------
C:\Windows\SysWOW64\ntdll.dll(ZwWaitForSingleObject+0x15) [0x77CBF911]
C:\Windows\syswow64\kernel32.dll(WaitForSingleObjectEx+0x43) [0x75E21194]
C:\Windows\syswow64\kernel32.dll(WaitForSingleObject+0x12) [0x75E21148]
C:\Ruby200\bin\msvcrt-ruby200.dll(rb_vm_bugreport+0xa7) [0x66903317]
C:\Ruby200\bin\msvcrt-ruby200.dll(rb_name_err_mesg_new+0x69d) [0x667C131D]
C:\Ruby200\bin\msvcrt-ruby200.dll(rb_bug+0x2e) [0x667C213E]
C:\Ruby200\bin\msvcrt-ruby200.dll(rb_check_safe_str+0x37a) [0x6688636A]
[0x00401866]
C:\Windows\SysWOW64\ntdll.dll(RtlKnownExceptionFilter+0xb7) [0x77D1344F]

-------------------------------->8-----------------------

Watobo Version: 0.9.22
FXRuby Version: 1.6.33
Fox Version: 1.6.49

Any hints or tips?

If I use an older version of fxruby I get an error that runOnUiThread is an unknown method.

regards,

andy

@larskanis
Copy link
Owner

larskanis commented Oct 9, 2015 via email

@andyschmidt
Copy link
Author

Hi Lars,

any updates on this issue?
Is there a chance to narrow it down with debug symbols? Can you provide a fxruby version compiled with debug symbols?

-andy

@larskanis
Copy link
Owner

@andyschmidt Sorry, I'm currently very busy with work, so that I had to defer this. But thank you for the reminder! I'll try to have a look at it next week.

@andyschmidt
Copy link
Author

Hi Lars,

first of all I wish you a happy new year!

I just installed fxruby (watobo) on a fedora amd64 system and it's crashing all the time.

/home/znow/.rvm/gems/ruby-2.2.1/gems/watobo-0.9.21/lib/watobo/gui.rb:68: [BUG] Segmentation fault at 0x00000000000000
ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux]

-- Control frame information -----------------------------------------------
c:0009 p:---- s:0037 e:000036 CFUNC  :run
c:0008 p:0097 s:0034 e:000033 METHOD /home/znow/.rvm/gems/ruby-2.2.1/gems/watobo-0.9.21/lib/watobo/gui.rb:68
c:0007 p:0149 s:0031 e:000030 TOP    /home/znow/.rvm/gems/ruby-2.2.1/gems/watobo-0.9.21/bin/watobo_gui.rb:31 [FINISH]
c:0006 p:---- s:0028 e:000027 CFUNC  :require
c:0005 p:0113 s:0024 e:000023 METHOD /home/znow/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54
c:0004 p:0098 s:0014 e:000013 TOP    /home/znow/.rvm/gems/ruby-2.2.1/gems/watobo-0.9.21/bin/watobo:9 [FINISH]
c:0003 p:---- s:0010 e:000009 CFUNC  :load
c:0002 p:0135 s:0006 E:000bb0 EVAL   /home/znow/.rvm/gems/ruby-2.2.1/bin/watobo:23 [FINISH]
c:0001 p:0000 s:0002 E:000910 TOP    [FINISH]

-- Ruby level backtrace information ----------------------------------------
/home/znow/.rvm/gems/ruby-2.2.1/bin/watobo:23:in `<main>'
/home/znow/.rvm/gems/ruby-2.2.1/bin/watobo:23:in `load'
/home/znow/.rvm/gems/ruby-2.2.1/gems/watobo-0.9.21/bin/watobo:9:in `<top (required)>'
/home/znow/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/home/znow/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/home/znow/.rvm/gems/ruby-2.2.1/gems/watobo-0.9.21/bin/watobo_gui.rb:31:in `<top (required)>'
/home/znow/.rvm/gems/ruby-2.2.1/gems/watobo-0.9.21/lib/watobo/gui.rb:68:in `start'
/home/znow/.rvm/gems/ruby-2.2.1/gems/watobo-0.9.21/lib/watobo/gui.rb:68:in `run'

-- Machine register context ------------------------------------------------
 RIP: 0x00007f019f567c4e RBP: 0x00007ffee369a4a0 RSP: 0x00007ffee369a480
 RAX: 0x6f00002a20656c62 RBX: 0x0000000000000040 RCX: 0x0000000000000000
 RDX: 0x000000000020003d RDI: 0x0000000004309710 RSI: 0x00000000043691a0
  R8: 0x000000000020003d  R9: 0xc6a4a7935bd1e900 R10: 0x00007ffee369a6c0
 R11: 0x0000000000000000 R12: 0x00007ffee369aa40 R13: 0x000000000289d160
 R14: 0x00007f01ae59b600 R15: 0x000000000289d1d0 EFL: 0x0000000000010202

-- C level backtrace information -------------------------------------------
/home/znow/.rvm/rubies/ruby-2.2.1/lib/libruby.so.2.2(rb_vm_bugreport+0x4ea) [0x7f01ae2ae2ba] vm_dump.c:693
/home/znow/.rvm/rubies/ruby-2.2.1/lib/libruby.so.2.2(rb_bug_context+0xcb) [0x7f01ae1492eb] error.c:425
/home/znow/.rvm/rubies/ruby-2.2.1/lib/libruby.so.2.2(sigsegv+0x3e) [0x7f01ae2269ee] signal.c:879
/lib64/libpthread.so.0 [0x7f01adec19f0]
/usr/local/lib/libFOX-1.6.so.0(_ZN2FX8FXWindow8onUpdateEPNS_8FXObjectEjPv+0x7a) [0x7f019f567c4e]
/usr/local/lib/libFOX-1.6.so.0(_ZN2FX8FXWindow6handleEPNS_8FXObjectEjPv+0x97) [0x7f019f562337]
/usr/local/lib/libFOX-1.6.so.0(_ZN2FX7FXFrame6handleEPNS_8FXObjectEjPv+0xb0) [0x7f019f40d3d4]
/usr/local/lib/libFOX-1.6.so.0(_ZN2FX8FXHeader6handleEPNS_8FXObjectEjPv+0xb0) [0x7f019f431a1c]
/usr/local/lib/libFOX-1.6.so.0(_ZN2FX5FXApp12getNextEventER7_XEventb+0x700) [0x7f019f38e1d0]
/usr/local/lib/libFOX-1.6.so.0(_ZN2FX5FXApp11runOneEventEb+0x45) [0x7f019f393605]
/usr/local/lib/libFOX-1.6.so.0(_ZN2FX5FXApp3runEv+0x5d) [0x7f019f393325]
/home/znow/.rvm/gems/ruby-2.2.1/extensions/x86_64-linux/2.2.0/fxruby-1.6.33/fox16_c.so(_Z13FXApp_run_gvlPN2FX5FXAppE+0x18) [0x7f01a0358bc7]
/home/znow/.rvm/gems/ruby-2.2.1/extensions/x86_64-linux/2.2.0/fxruby-1.6.33/fox16_c.so [0x7f01a0356de0]
/home/znow/.rvm/rubies/ruby-2.2.1/lib/libruby.so.2.2(rb_thread_call_without_gvl+0x45) [0x7f01ae2bc615] thread.c:1274
/home/znow/.rvm/gems/ruby-2.2.1/extensions/x86_64-linux/2.2.0/fxruby-1.6.33/fox16_c.so(_Z9FXApp_runPN2FX5FXAppE+0x43) [0x7f01a03588f1]
/home/znow/.rvm/gems/ruby-2.2.1/extensions/x86_64-linux/2.2.0/fxruby-1.6.33/fox16_c.so [0x7f01a02c127d]
/home/znow/.rvm/rubies/ruby-2.2.1/lib/libruby.so.2.2(vm_call_cfunc+0x122) [0x7f01ae296462] vm_insnhelper.c:1382

Is there a chance that you get it fixed in the near future? Otherwise I have to do a rollback with the watobo project.

-andy

@larskanis
Copy link
Owner

Will have a look at it now (... and postpone PostgreSQL-9.5 additions to pg.gem).

@larskanis
Copy link
Owner

I can not get watobo to crash, by clicking through all the windows and dialogs. Is there any particular sequence I could use?

@larskanis
Copy link
Owner

Could you run watobo with valgrind and post a crash report of valgrind?

@andyschmidt
Copy link
Author

Not sure if I did it right ... got different crashes:

1.)

vex: the `impossible' happened:
   isZeroU
vex storage: T total 5514219552 bytes allocated
vex storage: P total 640 bytes allocated

valgrind: the 'impossible' happened:
   LibVEX called failure_exit().

host stacktrace:
==16661==    at 0x38083F98: show_sched_status_wrk (m_libcassert.c:343)
==16661==    by 0x380840B4: report_and_quit (m_libcassert.c:415)
==16661==    by 0x380842F1: panic (m_libcassert.c:491)
==16661==    by 0x380842F1: vgPlain_core_panic_at (m_libcassert.c:496)
==16661==    by 0x3808431A: vgPlain_core_panic (m_libcassert.c:501)
==16661==    by 0x3809F6B2: failure_exit (m_translate.c:740)
==16661==    by 0x38147FF8: vpanic (main_util.c:231)
==16661==    by 0x3815515D: isZeroU.isra.16.part.17 (ir_opt.c:1226)
==16661==    by 0x38159282: isZeroU (ir_opt.c:1525)
==16661==    by 0x38159282: fold_Expr (ir_opt.c:2308)
==16661==    by 0x38159EB6: subst_and_fold_Stmt (ir_opt.c:2585)
==16661==    by 0x38159EB6: cprop_BB (ir_opt.c:2794)
==16661==    by 0x3815BDC8: cheap_transformations (ir_opt.c:6414)
==16661==    by 0x3815CE16: do_iropt_BB (ir_opt.c:6608)
==16661==    by 0x38145DFC: LibVEX_Translate (main_main.c:916)
==16661==    by 0x380A1C3B: vgPlain_translate (m_translate.c:1765)
==16661==    by 0x380D294B: handle_chain_me (scheduler.c:1076)
==16661==    by 0x380D45AF: vgPlain_scheduler (scheduler.c:1420)
==16661==    by 0x380E3926: thread_wrapper (syswrap-linux.c:102)
==16661==    by 0x380E3926: run_a_thread_NORETURN (syswrap-linux.c:155)
==16661==    by 0x380E3DFA: vgModuleLocal_start_thread_NORETURN (syswrap-linux.c:324)
==16661==    by 0x3810C60D: ??? (in /usr/local/lib/valgrind/memcheck-amd64-linux)
==16661==    by 0xDEADBEEFDEADBEEE: ???
==16661==    by 0xDEADBEEFDEADBEEE: ???
==16661==    by 0xDEADBEEFDEADBEEE: ???

sched status:
  running_tid=40

Thread 1: status = VgTs_WaitSys (lwpid 16661)
==16661==    at 0x5313B10: pthread_cond_wait@@GLIBC_2.3.2 (in /usr/lib64/libpthread-2.22.so)
==16661==    by 0x502401A: native_cond_wait (thread_pthread.c:338)
==16661==    by 0x502401A: lock_func (thread.c:4268)
==16661==    by 0x502401A: rb_mutex_lock (thread.c:4342)
==16661==    by 0x50264E1: rb_mutex_synchronize (thread.c:4550)
==16661==    by 0x4FFD461: vm_call_cfunc_with_frame (vm_insnhelper.c:1382)
==16661==    by 0x4FFD461: vm_call_cfunc (vm_insnhelper.c:1475)
==16661==    by 0x5003BA6: vm_exec_core (insns.def:1024)
==16661==    by 0x50085F7: vm_exec (vm.c:1400)
==16661==    by 0x500D66B: invoke_block_from_c (vm.c:813)
==16661==    by 0x500E05A: vm_yield (vm.c:853)
==16661==    by 0x500E05A: rb_yield_0 (vm_eval.c:986)
==16661==    by 0x500E05A: rb_yield (vm_eval.c:996)
==16661==    by 0x4E63811: rb_ary_each (array.c:1803)
==16661==    by 0x4FFD461: vm_call_cfunc_with_frame (vm_insnhelper.c:1382)
==16661==    by 0x4FFD461: vm_call_cfunc (vm_insnhelper.c:1475)
==16661==    by 0x5003BA6: vm_exec_core (insns.def:1024)
==16661==    by 0x50085F7: vm_exec (vm.c:1400)
==16661==    by 0x500D66B: invoke_block_from_c (vm.c:813)
==16661==    by 0x500E095: vm_yield (vm.c:853)
==16661==    by 0x500E095: rb_yield_0 (vm_eval.c:986)
==16661==    by 0x500E095: rb_yield (vm_eval.c:993)
==16661==    by 0x4EB8EAF: rb_ensure (eval.c:907)
==16661==    by 0x4FFD461: vm_call_cfunc_with_frame (vm_insnhelper.c:1382)
==16661==    by 0x4FFD461: vm_call_cfunc (vm_insnhelper.c:1475)
==16661==    by 0x5003BA6: vm_exec_core (insns.def:1024)
==16661==    by 0x50085F7: vm_exec (vm.c:1400)
==16661==    by 0x500D66B: invoke_block_from_c (vm.c:813)
==16661==    by 0x500D83B: vm_invoke_proc (vm.c:878)
==16661==    by 0x500D927: rb_vm_invoke_proc (vm.c:897)
==16661==    by 0x4EBFA9F: proc_call (proc.c:731)
==16661==    by 0x4FFD461: vm_call_cfunc_with_frame (vm_insnhelper.c:1382)
==16661==    by 0x4FFD461: vm_call_cfunc (vm_insnhelper.c:1475)
==16661==    by 0x5003C51: vm_exec_core (insns.def:1054)
==16661==    by 0x50085F7: vm_exec (vm.c:1400)
==16661==    by 0x500A1D0: vm_call0_body.constprop.82 (vm_eval.c:180)
==16661==    by 0x500ABA5: vm_call0 (vm_eval.c:59)
==16661==    by 0x500ABA5: rb_call0 (vm_eval.c:348)
==16661==    by 0x500B243: rb_call (vm_eval.c:610)
==16661==    by 0x500B243: rb_funcall (vm_eval.c:812)
==16661==    by 0x186E86A3: handle_body(unsigned long) (in /home/znow/.rvm/gems/ruby-2.2.1/extensions/x86_64-linux/2.2.0/fxruby-1.6.33/fox16_c.so)
==16661==    by 0x186E8A22: FXRbHandleMessage_gvlcb(FX::FXObject*, unsigned long, FX::FXObject*, unsigned int, void*) (in /home/znow/.rvm/gems/ruby-2.2.1/extensions/x86_64-linux/2.2.0/fxruby-1.6.33/fox16_c.so)
==16661==    by 0x186EE724: void* gvl_FXRbHandleMessage_5_skeleton<FXRbObject*, unsigned long, FX::FXObject*, unsigned int, void*>(void*) (in /home/znow/.rvm/gems/ruby-2.2.1/extensions/x86_64-linux/2.2.0/fxruby-1.6.33/fox16_c.so)
==16661==    by 0x5022959: rb_thread_call_with_gvl (thread.c:1475)
==16661==    by 0x1870C971: long FXRbHandleMessage<FXRbObject*, unsigned long, FX::FXObject*, unsigned int, void*>(FXRbObject*, unsigned long, FX::FXObject*, unsigned int, void*) (in /home/znow/.rvm/gems/ruby-2.2.1/extensions/x86_64-linux/2.2.0/fxruby-1.6.33/fox16_c.so)
==16661==    by 0x186DD8EE: FXRbObject::handle(FX::FXObject*, unsigned int, void*) (in /home/znow/.rvm/gems/ruby-2.2.1/extensions/x86_64-linux/2.2.0/fxruby-1.6.33/fox16_c.so)
==16661==    by 0x195C2D44: FX::FXObject::tryHandle(FX::FXObject*, unsigned int, void*) (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==16661==    by 0x194AE62F: FX::FXApp::handleTimeouts() (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==16661==    by 0x194AFB20: FX::FXApp::getNextEvent(_XEvent&, bool) (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==16661==    by 0x194B5604: FX::FXApp::runOneEvent(bool) (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==16661==    by 0x194B5324: FX::FXApp::run() (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==16661==    by 0x187D0BC6: FXApp_run_gvl(FX::FXApp*) (in /home/znow/.rvm/gems/ruby-2.2.1/extensions/x86_64-linux/2.2.0/fxruby-1.6.33/fox16_c.so)
==16661==    by 0x187CEDDF: gvl_FXApp_run_skeleton(void*) (in /home/znow/.rvm/gems/ruby-2.2.1/extensions/x86_64-linux/2.2.0/fxruby-1.6.33/fox16_c.so)
==16661==    by 0x5023614: call_without_gvl (thread.c:1274)
==16661==    by 0x5023614: rb_thread_call_without_gvl (thread.c:1384)
==16661==    by 0x187D08F0: FXApp_run(FX::FXApp*) (in /home/znow/.rvm/gems/ruby-2.2.1/extensions/x86_64-linux/2.2.0/fxruby-1.6.33/fox16_c.so)
==16661==    by 0x1873927C: _wrap_FXApp_run(int, unsigned long*, unsigned long) (in /home/znow/.rvm/gems/ruby-2.2.1/extensions/x86_64-linux/2.2.0/fxruby-1.6.33/fox16_c.so)
==16661==    by 0x4FFD461: vm_call_cfunc_with_frame (vm_insnhelper.c:1382)
==16661==    by 0x4FFD461: vm_call_cfunc (vm_insnhelper.c:1475)
==16661==    by 0x501077D: vm_call_method (vm_insnhelper.c:1691)
==16661==    by 0x5003C51: vm_exec_core (insns.def:1054)
==16661==    by 0x50085F7: vm_exec (vm.c:1400)
==16661==    by 0x5009FB2: rb_iseq_eval_main (vm.c:1670)
==16661==    by 0x4EB5A2C: ruby_exec_internal (eval.c:252)
==16661==    by 0x4EB81DC: ruby_exec_node (eval.c:317)
==16661==    by 0x4EBAA5D: ruby_run_node (eval.c:309)
==16661==    by 0x4008BA: main (main.c:36)

Thread 2: status = VgTs_WaitSys (lwpid 16662)
==16661==    at 0x5D56FDD: ??? (in /usr/lib64/libc-2.22.so)
==16661==    by 0x501D760: timer_thread_sleep (thread_pthread.c:1432)
==16661==    by 0x501D760: thread_timer (thread_pthread.c:1543)
==16661==    by 0x530E609: start_thread (in /usr/lib64/libpthread-2.22.so)

2.)

vex: the `impossible' happened:
   isZeroU
vex storage: T total 5514219552 bytes allocated
vex storage: P total 640 bytes allocated

valgrind: the 'impossible' happened:
   LibVEX called failure_exit().

host stacktrace:
==16661==    at 0x38083F98: show_sched_status_wrk (m_libcassert.c:343)
==16661==    by 0x380840B4: report_and_quit (m_libcassert.c:415)
==16661==    by 0x380842F1: panic (m_libcassert.c:491)
==16661==    by 0x380842F1: vgPlain_core_panic_at (m_libcassert.c:496)
==16661==    by 0x3808431A: vgPlain_core_panic (m_libcassert.c:501)
==16661==    by 0x3809F6B2: failure_exit (m_translate.c:740)
==16661==    by 0x38147FF8: vpanic (main_util.c:231)
==16661==    by 0x3815515D: isZeroU.isra.16.part.17 (ir_opt.c:1226)
==16661==    by 0x38159282: isZeroU (ir_opt.c:1525)
==16661==    by 0x38159282: fold_Expr (ir_opt.c:2308)
==16661==    by 0x38159EB6: subst_and_fold_Stmt (ir_opt.c:2585)
==16661==    by 0x38159EB6: cprop_BB (ir_opt.c:2794)
==16661==    by 0x3815BDC8: cheap_transformations (ir_opt.c:6414)
==16661==    by 0x3815CE16: do_iropt_BB (ir_opt.c:6608)
==16661==    by 0x38145DFC: LibVEX_Translate (main_main.c:916)
==16661==    by 0x380A1C3B: vgPlain_translate (m_translate.c:1765)
==16661==    by 0x380D294B: handle_chain_me (scheduler.c:1076)
==16661==    by 0x380D45AF: vgPlain_scheduler (scheduler.c:1420)
==16661==    by 0x380E3926: thread_wrapper (syswrap-linux.c:102)
==16661==    by 0x380E3926: run_a_thread_NORETURN (syswrap-linux.c:155)
==16661==    by 0x380E3DFA: vgModuleLocal_start_thread_NORETURN (syswrap-linux.c:324)
==16661==    by 0x3810C60D: ??? (in /usr/local/lib/valgrind/memcheck-amd64-linux)
==16661==    by 0xDEADBEEFDEADBEEE: ???
==16661==    by 0xDEADBEEFDEADBEEE: ???
==16661==    by 0xDEADBEEFDEADBEEE: ???

sched status:
  running_tid=40

Thread 1: status = VgTs_WaitSys (lwpid 16661)
==16661==    at 0x5313B10: pthread_cond_wait@@GLIBC_2.3.2 (in /usr/lib64/libpthread-2.22.so)
==16661==    by 0x502401A: native_cond_wait (thread_pthread.c:338)
==16661==    by 0x502401A: lock_func (thread.c:4268)
==16661==    by 0x502401A: rb_mutex_lock (thread.c:4342)
==16661==    by 0x50264E1: rb_mutex_synchronize (thread.c:4550)
==16661==    by 0x4FFD461: vm_call_cfunc_with_frame (vm_insnhelper.c:1382)
==16661==    by 0x4FFD461: vm_call_cfunc (vm_insnhelper.c:1475)
==16661==    by 0x5003BA6: vm_exec_core (insns.def:1024)
==16661==    by 0x50085F7: vm_exec (vm.c:1400)
==16661==    by 0x500D66B: invoke_block_from_c (vm.c:813)
==16661==    by 0x500E05A: vm_yield (vm.c:853)
==16661==    by 0x500E05A: rb_yield_0 (vm_eval.c:986)
==16661==    by 0x500E05A: rb_yield (vm_eval.c:996)
==16661==    by 0x4E63811: rb_ary_each (array.c:1803)
==16661==    by 0x4FFD461: vm_call_cfunc_with_frame (vm_insnhelper.c:1382)
==16661==    by 0x4FFD461: vm_call_cfunc (vm_insnhelper.c:1475)
==16661==    by 0x5003BA6: vm_exec_core (insns.def:1024)
==16661==    by 0x50085F7: vm_exec (vm.c:1400)
==16661==    by 0x500D66B: invoke_block_from_c (vm.c:813)
==16661==    by 0x500E095: vm_yield (vm.c:853)
==16661==    by 0x500E095: rb_yield_0 (vm_eval.c:986)
==16661==    by 0x500E095: rb_yield (vm_eval.c:993)
==16661==    by 0x4EB8EAF: rb_ensure (eval.c:907)
==16661==    by 0x4FFD461: vm_call_cfunc_with_frame (vm_insnhelper.c:1382)
==16661==    by 0x4FFD461: vm_call_cfunc (vm_insnhelper.c:1475)
==16661==    by 0x5003BA6: vm_exec_core (insns.def:1024)
==16661==    by 0x50085F7: vm_exec (vm.c:1400)
==16661==    by 0x500D66B: invoke_block_from_c (vm.c:813)
==16661==    by 0x500D83B: vm_invoke_proc (vm.c:878)
==16661==    by 0x500D927: rb_vm_invoke_proc (vm.c:897)
==16661==    by 0x4EBFA9F: proc_call (proc.c:731)
==16661==    by 0x4FFD461: vm_call_cfunc_with_frame (vm_insnhelper.c:1382)
==16661==    by 0x4FFD461: vm_call_cfunc (vm_insnhelper.c:1475)
==16661==    by 0x5003C51: vm_exec_core (insns.def:1054)
==16661==    by 0x50085F7: vm_exec (vm.c:1400)
==16661==    by 0x500A1D0: vm_call0_body.constprop.82 (vm_eval.c:180)
==16661==    by 0x500ABA5: vm_call0 (vm_eval.c:59)
==16661==    by 0x500ABA5: rb_call0 (vm_eval.c:348)
==16661==    by 0x500B243: rb_call (vm_eval.c:610)
==16661==    by 0x500B243: rb_funcall (vm_eval.c:812)
==16661==    by 0x186E86A3: handle_body(unsigned long) (in /home/znow/.rvm/gems/ruby-2.2.1/extensions/x86_64-linux/2.2.0/fxruby-1.6.33/fox16_c.so)
==16661==    by 0x186E8A22: FXRbHandleMessage_gvlcb(FX::FXObject*, unsigned long, FX::FXObject*, unsigned int, void*) (in /home/znow/.rvm/gems/ruby-2.2.1/extensions/x86_64-linux/2.2.0/fxruby-1.6.33/fox16_c.so)
==16661==    by 0x186EE724: void* gvl_FXRbHandleMessage_5_skeleton<FXRbObject*, unsigned long, FX::FXObject*, unsigned int, void*>(void*) (in /home/znow/.rvm/gems/ruby-2.2.1/extensions/x86_64-linux/2.2.0/fxruby-1.6.33/fox16_c.so)
==16661==    by 0x5022959: rb_thread_call_with_gvl (thread.c:1475)
==16661==    by 0x1870C971: long FXRbHandleMessage<FXRbObject*, unsigned long, FX::FXObject*, unsigned int, void*>(FXRbObject*, unsigned long, FX::FXObject*, unsigned int, void*) (in /home/znow/.rvm/gems/ruby-2.2.1/extensions/x86_64-linux/2.2.0/fxruby-1.6.33/fox16_c.so)
==16661==    by 0x186DD8EE: FXRbObject::handle(FX::FXObject*, unsigned int, void*) (in /home/znow/.rvm/gems/ruby-2.2.1/extensions/x86_64-linux/2.2.0/fxruby-1.6.33/fox16_c.so)
==16661==    by 0x195C2D44: FX::FXObject::tryHandle(FX::FXObject*, unsigned int, void*) (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==16661==    by 0x194AE62F: FX::FXApp::handleTimeouts() (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==16661==    by 0x194AFB20: FX::FXApp::getNextEvent(_XEvent&, bool) (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==16661==    by 0x194B5604: FX::FXApp::runOneEvent(bool) (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==16661==    by 0x194B5324: FX::FXApp::run() (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==16661==    by 0x187D0BC6: FXApp_run_gvl(FX::FXApp*) (in /home/znow/.rvm/gems/ruby-2.2.1/extensions/x86_64-linux/2.2.0/fxruby-1.6.33/fox16_c.so)
==16661==    by 0x187CEDDF: gvl_FXApp_run_skeleton(void*) (in /home/znow/.rvm/gems/ruby-2.2.1/extensions/x86_64-linux/2.2.0/fxruby-1.6.33/fox16_c.so)
==16661==    by 0x5023614: call_without_gvl (thread.c:1274)
==16661==    by 0x5023614: rb_thread_call_without_gvl (thread.c:1384)
==16661==    by 0x187D08F0: FXApp_run(FX::FXApp*) (in /home/znow/.rvm/gems/ruby-2.2.1/extensions/x86_64-linux/2.2.0/fxruby-1.6.33/fox16_c.so)
==16661==    by 0x1873927C: _wrap_FXApp_run(int, unsigned long*, unsigned long) (in /home/znow/.rvm/gems/ruby-2.2.1/extensions/x86_64-linux/2.2.0/fxruby-1.6.33/fox16_c.so)
==16661==    by 0x4FFD461: vm_call_cfunc_with_frame (vm_insnhelper.c:1382)
==16661==    by 0x4FFD461: vm_call_cfunc (vm_insnhelper.c:1475)
==16661==    by 0x501077D: vm_call_method (vm_insnhelper.c:1691)
==16661==    by 0x5003C51: vm_exec_core (insns.def:1054)
==16661==    by 0x50085F7: vm_exec (vm.c:1400)
==16661==    by 0x5009FB2: rb_iseq_eval_main (vm.c:1670)
==16661==    by 0x4EB5A2C: ruby_exec_internal (eval.c:252)
==16661==    by 0x4EB81DC: ruby_exec_node (eval.c:317)
==16661==    by 0x4EBAA5D: ruby_run_node (eval.c:309)
==16661==    by 0x4008BA: main (main.c:36)

Thread 2: status = VgTs_WaitSys (lwpid 16662)
==16661==    at 0x5D56FDD: ??? (in /usr/lib64/libc-2.22.so)
==16661==    by 0x501D760: timer_thread_sleep (thread_pthread.c:1432)
==16661==    by 0x501D760: thread_timer (thread_pthread.c:1543)
==16661==    by 0x530E609: start_thread (in /usr/lib64/libpthread-2.22.so)

3.)

X Fatal error.
==16595== 
==16595== Process terminating with default action of signal 6 (SIGABRT)
==16595==    at 0x5C94A98: raise (in /usr/lib64/libc-2.22.so)
==16595==    by 0x5C96699: abort (in /usr/lib64/libc-2.22.so)
==16595==    by 0x196A15FB: FX::fxerror(char const*, ...) (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==16595==    by 0x194ACCA1: FX::xfatalerrorhandler(_XDisplay*) (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==16595==    by 0x1A2FD43D: _XIOError (in /usr/lib64/libX11.so.6.3.0)
==16595==    by 0x1A2FB499: _XReply (in /usr/lib64/libX11.so.6.3.0)
==16595==    by 0x1A2F83D8: XTranslateCoordinates (in /usr/lib64/libX11.so.6.3.0)
==16595==    by 0x1968B310: FX::FXWindow::translateCoordinatesFrom(int&, int&, FX::FXWindow const*, int, int) const (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==16595==    by 0x194AF5DD: FX::FXApp::enterWindow(FX::FXWindow*, FX::FXWindow*) (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==16595==    by 0x194B2A09: FX::FXApp::dispatchEvent(_XEvent&) (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==16595==    by 0x194B562F: FX::FXApp::runOneEvent(bool) (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==16595==    by 0x194B569A: FX::FXApp::runModal() (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==16595== 
==16595== HEAP SUMMARY:
==16595==     in use at exit: 55,291,743 bytes in 422,509 blocks
==16595==   total heap usage: 1,982,832 allocs, 1,560,323 frees, 198,842,500 bytes allocated
==16595== 
==16595== LEAK SUMMARY:
==16595==    definitely lost: 11,900 bytes in 129 blocks
==16595==    indirectly lost: 81,640 bytes in 467 blocks
==16595==      possibly lost: 9,843 bytes in 323 blocks
==16595==    still reachable: 55,188,360 bytes in 421,590 blocks
==16595==                       of which reachable via heuristic:
==16595==                         newarray           : 49,528 bytes in 3 blocks
==16595==         suppressed: 0 bytes in 0 blocks
==16595== Rerun with --leak-check=full to see details of leaked memory
==16595== 
==16595== For counts of detected and suppressed errors, rerun with: -v
==16595== Use --track-origins=yes to see where uninitialised values come from
==16595== ERROR SUMMARY: 499965 errors from 733 contexts (suppressed: 0 from 0)

Hope this helps

@larskanis
Copy link
Owner

@andyschmidt The valgrind stacktraces are very different to the ruby stacktrace above. So this doesn't help me, to figure out the root cause. Vagrind usually reports some invalid reads, before it shows the backtrace. How did you call valgrind and watobo?

According to the backtrace without valgrind, the crash then should be some where in FXWindow.Update . Is there a specific action, at which the crash happens?

@andyschmidt
Copy link
Author

@larskanis I called valgrind this way:
valgrind --main-stacksize=10000000 ruby Projects/watobo/bin/watobo_gui.rb

this crash happend after I did a curl request through watobo.

==2513== Thread 1:
==2513== Jump to the invalid address stated on the next line
==2513==    at 0x7FF: ???
==2513==    by 0x19684336: FX::FXWindow::handle(FX::FXObject*, unsigned int, void*) (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==2513==    by 0x1952F3D3: FX::FXFrame::handle(FX::FXObject*, unsigned int, void*) (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==2513==    by 0x19553A1B: FX::FXHeader::handle(FX::FXObject*, unsigned int, void*) (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==2513==    by 0x194AF610: FX::FXApp::enterWindow(FX::FXWindow*, FX::FXWindow*) (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==2513==    by 0x194B2A09: FX::FXApp::dispatchEvent(_XEvent&) (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==2513==    by 0x194B562F: FX::FXApp::runOneEvent(bool) (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==2513==    by 0x194B5324: FX::FXApp::run() (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==2513==    by 0x187D0BC6: FXApp_run_gvl(FX::FXApp*) (in /home/znow/.rvm/gems/ruby-2.2.1/extensions/x86_64-linux/2.2.0/fxruby-1.6.33/fox16_c.so)
==2513==    by 0x187CEDDF: gvl_FXApp_run_skeleton(void*) (in /home/znow/.rvm/gems/ruby-2.2.1/extensions/x86_64-linux/2.2.0/fxruby-1.6.33/fox16_c.so)
==2513==    by 0x5023614: call_without_gvl (thread.c:1274)
==2513==    by 0x5023614: rb_thread_call_without_gvl (thread.c:1384)
==2513==    by 0x187D08F0: FXApp_run(FX::FXApp*) (in /home/znow/.rvm/gems/ruby-2.2.1/extensions/x86_64-linux/2.2.0/fxruby-1.6.33/fox16_c.so)
==2513==  Address 0x7ff is not stack'd, malloc'd or (recently) free'd
==2513== 
/home/znow/Projects/watobo/lib/watobo/gui.rb:72: [BUG] Segmentation fault at 0x000000000007ff
ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux]

-- Control frame information -----------------------------------------------
c:0004 p:---- s:0011 e:000010 CFUNC  :run
c:0003 p:0097 s:0008 e:000007 METHOD /home/znow/Projects/watobo/lib/watobo/gui.rb:72
c:0002 p:0154 s:0005 E:002578 EVAL   Projects/watobo/bin/watobo_gui.rb:21 [FINISH]
c:0001 p:0000 s:0002 E:001790 TOP    [FINISH]

-- Ruby level backtrace information ----------------------------------------
Projects/watobo/bin/watobo_gui.rb:21:in `<main>'
/home/znow/Projects/watobo/lib/watobo/gui.rb:72:in `start'
/home/znow/Projects/watobo/lib/watobo/gui.rb:72:in `run'

-- Machine register context ------------------------------------------------
 RIP: 0x00000000000007ff RBP: 0x0000000ffeffee60 RSP: 0x0000000ffeffee18
 RAX: 0x00000000000007ff RBX: 0x00000000196c873c RCX: 0x00000000175ed570
 RDX: 0x00000000000a003d RDI: 0x000000001601a6a0 RSI: 0x000000001fa58800
  R8: 0x00000000000a003d  R9: 0x0000000ffeffee70 R10: 0x0000000000000000
 R11: 0x0000000017008600 R12: 0x0000000ffefff2c0 R13: 0x0000000013b581b0
 R14: 0x0000000005302600 R15: 0x000000001434bec0 EFL: 0x0000000000000000

-- C level backtrace information -------------------------------------------
==2513== Invalid read of size 1
==2513==    at 0x1B4B0D29: ??? (in /usr/lib64/libgcc_s-5.3.1-20151207.so.1)
==2513==    by 0x1B4B2647: _Unwind_Backtrace (in /usr/lib64/libgcc_s-5.3.1-20151207.so.1)
==2513==    by 0x5D70FA5: backtrace (in /usr/lib64/libc-2.22.so)
==2513==    by 0x50152B9: rb_print_backtrace (vm_dump.c:693)
==2513==    by 0x50152B9: rb_vm_bugreport (vm_dump.c:971)
==2513==    by 0x4EB02EA: rb_bug_context (error.c:425)
==2513==    by 0x4F8D9ED: sigsegv (signal.c:879)
==2513==    by 0x53179EF: ??? (in /usr/lib64/libpthread-2.22.so)
==2513==    by 0x7FE: ???
==2513==  Address 0x7ff is not stack'd, malloc'd or (recently) free'd
==2513== 
==2513== 
==2513== Process terminating with default action of signal 11 (SIGSEGV)
==2513==  Access not within mapped region at address 0x7FF
==2513==    at 0x1B4B0D29: ??? (in /usr/lib64/libgcc_s-5.3.1-20151207.so.1)
==2513==    by 0x1B4B2647: _Unwind_Backtrace (in /usr/lib64/libgcc_s-5.3.1-20151207.so.1)
==2513==    by 0x5D70FA5: backtrace (in /usr/lib64/libc-2.22.so)
==2513==    by 0x50152B9: rb_print_backtrace (vm_dump.c:693)
==2513==    by 0x50152B9: rb_vm_bugreport (vm_dump.c:971)
==2513==    by 0x4EB02EA: rb_bug_context (error.c:425)
==2513==    by 0x4F8D9ED: sigsegv (signal.c:879)
==2513==    by 0x53179EF: ??? (in /usr/lib64/libpthread-2.22.so)
==2513==    by 0x7FE: ???
==2513==  If you believe this happened as a result of a stack
==2513==  overflow in your program's main thread (unlikely but
==2513==  possible), you can try to increase the size of the
==2513==  main thread stack using the --main-stacksize= flag.
==2513==  The main thread stack size used in this run was 10002432.
==2513== 
==2513== HEAP SUMMARY:
==2513==     in use at exit: 100,610,657 bytes in 583,873 blocks
==2513==   total heap usage: 5,547,104 allocs, 4,963,231 frees, 517,143,085 bytes allocated
==2513== 
==2513== LEAK SUMMARY:
==2513==    definitely lost: 13,869 bytes in 157 blocks
==2513==    indirectly lost: 83,087 bytes in 513 blocks
==2513==      possibly lost: 22,959 bytes in 738 blocks
==2513==    still reachable: 100,490,742 bytes in 582,465 blocks
==2513==                       of which reachable via heuristic:
==2513==                         newarray           : 1,098,104 bytes in 4 blocks
==2513==         suppressed: 0 bytes in 0 blocks
==2513== Rerun with --leak-check=full to see details of leaked memory
==2513== 
==2513== For counts of detected and suppressed errors, rerun with: -v
==2513== Use --track-origins=yes to see where uninitialised values come from
==2513== ERROR SUMMARY: 645951 errors from 871 contexts (suppressed: 0 from 0)
Getötet
[znow@cR33d ~]$ 

@andyschmidt
Copy link
Author

no I got a crash with FX::FXWindow::onUpdate

[I] http://www.siberas.de/
==2876== Use of uninitialised value of size 8
==2876==    at 0x4ECCE4F: gc_aging (gc.c:4055)
==2876==    by 0x882006401: ???
==2876==    by 0x404201007FF7FFF: ???
==2876==    by 0x800450000200007: ???
==2876==    by 0x5FFE0F600030204B: ???
==2876==    by 0x1FFFFFFF: ???
==2876==    by 0x22040802E5160481: ???
==2876==    by 0xDE3000000027F: ???
==2876==    by 0xFFE1DE1025FEFFFF: ???
==2876==    by 0x800000000001FFFF: ???
==2876==    by 0xFFFFFFFFFFFFFDFC: ???
==2876==    by 0x23D9D2B8: ???
==2876== 
==2876== Use of uninitialised value of size 8
==2876==    at 0x4ECCE4F: gc_aging (gc.c:4055)
==2876==    by 0x800450000200007: ???
==2876==    by 0x5FFF0F600030204B: ???
==2876==    by 0x800450000200007: ???
==2876==    by 0x5FFE0F600030204B: ???
==2876==    by 0x1FFFFFFF: ???
==2876==    by 0x22040802E5160481: ???
==2876==    by 0xDE3000000027F: ???
==2876==    by 0xFFE1DE1025FEFFFF: ???
==2876==    by 0x800000000001FFFF: ???
==2876==    by 0xFFFFFFFFFFFFFDFC: ???
==2876==    by 0x23D9D2B8: ???
==2876== 
==2876== Use of uninitialised value of size 8
==2876==    at 0x4ECCE4F: gc_aging (gc.c:4055)
==2876==    by 0x435320981A20: ???
==2876==    by 0xFFE1DE1DE5FEFFFF: ???
==2876==    by 0x800450000200007: ???
==2876==    by 0x5FFE0F600030204B: ???
==2876==    by 0x1FFFFFFF: ???
==2876==    by 0x22040802E5160481: ???
==2876==    by 0xDE3000000027F: ???
==2876==    by 0xFFE1DE1025FEFFFF: ???
==2876==    by 0x800000000001FFFF: ???
==2876==    by 0xFFFFFFFFFFFFFDFC: ???
==2876==    by 0x23D9D2B8: ???
==2876== 
==2876== Use of uninitialised value of size 8
==2876==    at 0x4ED3FCB: gc_mark_set (gc.c:3956)
==2876==    by 0x4ED3FCB: gc_mark_ptr (gc.c:4077)
==2876==    by 0x4ED3FCB: gc_mark_maybe (gc.c:3942)
==2876==    by 0x4ED3FCB: mark_locations_array (gc.c:3689)
==2876==    by 0x4ED3FCB: gc_mark_locations (gc.c:3701)
==2876==    by 0x4ED3FCB: rb_gc_mark_machine_stack (gc.c:3919)
==2876==    by 0x435320981A20: ???
==2876==    by 0x7C8B000000D8E040: ???
==2876==    by 0x800000000001FFFF: ???
==2876==    by 0xFFFFFFFFFFFFFDFC: ???
==2876==    by 0x23D9D2B8: ???
==2876== 
==2876== Use of uninitialised value of size 8
==2876==    at 0x4ECCE4F: gc_aging (gc.c:4055)
==2876==    by 0x800008860C08001F: ???
==2876==    by 0x1740002E002: ???
==2876== 
==2876== Use of uninitialised value of size 8
==2876==    at 0x4ECCE4F: gc_aging (gc.c:4055)
==2876==    by 0x61100000C0DBFFF: ???
==2876==    by 0x180000005FFFF: ???
==2876== 
==2876== Thread 1:
==2876== Invalid read of size 8
==2876==    at 0x19689C17: FX::FXWindow::onUpdate(FX::FXObject*, unsigned int, void*) (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==2876==    by 0x19684336: FX::FXWindow::handle(FX::FXObject*, unsigned int, void*) (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==2876==    by 0x1952F3D3: FX::FXFrame::handle(FX::FXObject*, unsigned int, void*) (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==2876==    by 0x19553A1B: FX::FXHeader::handle(FX::FXObject*, unsigned int, void*) (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==2876==    by 0x194B01CF: FX::FXApp::getNextEvent(_XEvent&, bool) (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==2876==    by 0x194B5604: FX::FXApp::runOneEvent(bool) (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==2876==    by 0x194B5324: FX::FXApp::run() (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==2876==    by 0x187D0BC6: FXApp_run_gvl(FX::FXApp*) (in /home/znow/.rvm/gems/ruby-2.2.1/extensions/x86_64-linux/2.2.0/fxruby-1.6.33/fox16_c.so)
==2876==    by 0x187CEDDF: gvl_FXApp_run_skeleton(void*) (in /home/znow/.rvm/gems/ruby-2.2.1/extensions/x86_64-linux/2.2.0/fxruby-1.6.33/fox16_c.so)
==2876==    by 0x5023614: call_without_gvl (thread.c:1274)
==2876==    by 0x5023614: rb_thread_call_without_gvl (thread.c:1384)
==2876==    by 0x187D08F0: FXApp_run(FX::FXApp*) (in /home/znow/.rvm/gems/ruby-2.2.1/extensions/x86_64-linux/2.2.0/fxruby-1.6.33/fox16_c.so)
==2876==    by 0x1873927C: _wrap_FXApp_run(int, unsigned long*, unsigned long) (in /home/znow/.rvm/gems/ruby-2.2.1/extensions/x86_64-linux/2.2.0/fxruby-1.6.33/fox16_c.so)
==2876==  Address 0x16033f70 is 0 bytes inside a block of size 8 free'd
==2876==    at 0x4C2A184: operator delete(void*) (vg_replace_malloc.c:575)
==2876==    by 0x186F82D1: FXRbObject::~FXRbObject() (in /home/znow/.rvm/gems/ruby-2.2.1/extensions/x86_64-linux/2.2.0/fxruby-1.6.33/fox16_c.so)
==2876==    by 0x186A0B62: FXRbObject::freefunc(FX::FXObject*) (in /home/znow/.rvm/gems/ruby-2.2.1/extensions/x86_64-linux/2.2.0/fxruby-1.6.33/fox16_c.so)
==2876==    by 0x4ECEA50: run_final (gc.c:2463)
==2876==    by 0x4ECEA50: finalize_list (gc.c:2479)
==2876==    by 0x4ECF76F: finalize_deferred (gc.c:2500)
==2876==    by 0x4ECF76F: gc_finalize_deferred (gc.c:2509)
==2876==    by 0x501C3C2: rb_postponed_job_flush (vm_trace.c:1572)
==2876==    by 0x5022168: rb_threadptr_execute_interrupts.part.41 (thread.c:1971)
==2876==    by 0x50071A4: vm_exec_core (insns.def:1201)
==2876==    by 0x50085F7: vm_exec (vm.c:1400)
==2876==    by 0x500A1D0: vm_call0_body.constprop.82 (vm_eval.c:180)
==2876==    by 0x500ABA5: vm_call0 (vm_eval.c:59)
==2876==    by 0x500ABA5: rb_call0 (vm_eval.c:348)
==2876==    by 0x500B243: rb_call (vm_eval.c:610)
==2876==    by 0x500B243: rb_funcall (vm_eval.c:812)
==2876==  Block was alloc'd at
==2876==    at 0x4C29158: operator new(unsigned long) (vg_replace_malloc.c:333)
==2876==    by 0x18717D1E: new_FXObject() (in /home/znow/.rvm/gems/ruby-2.2.1/extensions/x86_64-linux/2.2.0/fxruby-1.6.33/fox16_c.so)
==2876==    by 0x1872A06C: _wrap_new_FXObject(int, unsigned long*, unsigned long) (in /home/znow/.rvm/gems/ruby-2.2.1/extensions/x86_64-linux/2.2.0/fxruby-1.6.33/fox16_c.so)
==2876==    by 0x4FFD461: vm_call_cfunc_with_frame (vm_insnhelper.c:1382)
==2876==    by 0x4FFD461: vm_call_cfunc (vm_insnhelper.c:1475)
==2876==    by 0x501077D: vm_call_method (vm_insnhelper.c:1691)
==2876==    by 0x5003D9B: vm_exec_core (insns.def:1072)
==2876==    by 0x50085F7: vm_exec (vm.c:1400)
==2876==    by 0x500A1D0: vm_call0_body.constprop.82 (vm_eval.c:180)
==2876==    by 0x500ABA5: vm_call0 (vm_eval.c:59)
==2876==    by 0x500ABA5: rb_call0 (vm_eval.c:348)
==2876==    by 0x4F1A7E0: rb_class_new_instance (object.c:1856)
==2876==    by 0x4FFD461: vm_call_cfunc_with_frame (vm_insnhelper.c:1382)
==2876==    by 0x4FFD461: vm_call_cfunc (vm_insnhelper.c:1475)
==2876==    by 0x5003C51: vm_exec_core (insns.def:1054)
==2876== 
==2876== Invalid read of size 8
==2876==    at 0x19689C1E: FX::FXWindow::onUpdate(FX::FXObject*, unsigned int, void*) (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==2876==    by 0x19684336: FX::FXWindow::handle(FX::FXObject*, unsigned int, void*) (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==2876==    by 0x1952F3D3: FX::FXFrame::handle(FX::FXObject*, unsigned int, void*) (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==2876==    by 0x19553A1B: FX::FXHeader::handle(FX::FXObject*, unsigned int, void*) (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==2876==    by 0x194B01CF: FX::FXApp::getNextEvent(_XEvent&, bool) (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==2876==    by 0x194B5604: FX::FXApp::runOneEvent(bool) (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==2876==    by 0x194B5324: FX::FXApp::run() (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==2876==    by 0x187D0BC6: FXApp_run_gvl(FX::FXApp*) (in /home/znow/.rvm/gems/ruby-2.2.1/extensions/x86_64-linux/2.2.0/fxruby-1.6.33/fox16_c.so)
==2876==    by 0x187CEDDF: gvl_FXApp_run_skeleton(void*) (in /home/znow/.rvm/gems/ruby-2.2.1/extensions/x86_64-linux/2.2.0/fxruby-1.6.33/fox16_c.so)
==2876==    by 0x5023614: call_without_gvl (thread.c:1274)
==2876==    by 0x5023614: rb_thread_call_without_gvl (thread.c:1384)
==2876==    by 0x187D08F0: FXApp_run(FX::FXApp*) (in /home/znow/.rvm/gems/ruby-2.2.1/extensions/x86_64-linux/2.2.0/fxruby-1.6.33/fox16_c.so)
==2876==    by 0x1873927C: _wrap_FXApp_run(int, unsigned long*, unsigned long) (in /home/znow/.rvm/gems/ruby-2.2.1/extensions/x86_64-linux/2.2.0/fxruby-1.6.33/fox16_c.so)
==2876==  Address 0x17 is not stack'd, malloc'd or (recently) free'd
==2876== 
/home/znow/Projects/watobo/lib/watobo/gui.rb:72: [BUG] Segmentation fault at 0x00000000000017
ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux]

-- Control frame information -----------------------------------------------
c:0004 p:---- s:0011 e:000010 CFUNC  :run
c:0003 p:0097 s:0008 e:000007 METHOD /home/znow/Projects/watobo/lib/watobo/gui.rb:72
c:0002 p:0154 s:0005 E:002578 EVAL   Projects/watobo/bin/watobo_gui.rb:21 [FINISH]
c:0001 p:0000 s:0002 E:001790 TOP    [FINISH]

-- Ruby level backtrace information ----------------------------------------
Projects/watobo/bin/watobo_gui.rb:21:in `<main>'
/home/znow/Projects/watobo/lib/watobo/gui.rb:72:in `start'
/home/znow/Projects/watobo/lib/watobo/gui.rb:72:in `run'

-- Machine register context ------------------------------------------------
 RIP: 0x0000000019689c1e RBP: 0x0000000ffeffed20 RSP: 0x0000000ffeffed00
 RAX: 0x0000000000000004 RBX: 0x0000000000000040 RCX: 0x0000000000000000
 RDX: 0x0000000000200000 RDI: 0x000000001fa0e6e0 RSI: 0x00000000175f7dd0
  R8: 0x0000000ffeffefc0  R9: 0xc6a4a7935bd1e995 R10: 0x0000000ffeffef40
 R11: 0x0000000000000000 R12: 0x0000000ffefff2c0 R13: 0x0000000016a10380
 R14: 0x0000000005302600 R15: 0x0000000016a10450 EFL: 0x0000000000000000

-- C level backtrace information -------------------------------------------
/home/znow/.rvm/rubies/ruby-2.2.1/lib/libruby.so.2.2(rb_vm_bugreport+0x4ea) [0x50152ba] vm_dump.c:693
/home/znow/.rvm/rubies/ruby-2.2.1/lib/libruby.so.2.2(rb_bug_context+0xcb) [0x4eb02eb] error.c:425
/home/znow/.rvm/rubies/ruby-2.2.1/lib/libruby.so.2.2(sigsegv+0x3e) [0x4f8d9ee] signal.c:879
/lib64/libpthread.so.0 [0x53179f0]
/usr/local/lib/libFOX-1.6.so.0(_ZN2FX8FXWindow8onUpdateEPNS_8FXObjectEjPv+0x4a) [0x19689c1e]
/usr/local/lib/libFOX-1.6.so.0(_ZN2FX8FXWindow6handleEPNS_8FXObjectEjPv+0x97) [0x19684337]
/usr/local/lib/libFOX-1.6.so.0(_ZN2FX7FXFrame6handleEPNS_8FXObjectEjPv+0xb0) [0x1952f3d4]
/usr/local/lib/libFOX-1.6.so.0(_ZN2FX8FXHeader6handleEPNS_8FXObjectEjPv+0xb0) [0x19553a1c]
/usr/local/lib/libFOX-1.6.so.0(_ZN2FX5FXApp12getNextEventER7_XEventb+0x700) [0x194b01d0]
/usr/local/lib/libFOX-1.6.so.0(_ZN2FX5FXApp11runOneEventEb+0x45) [0x194b5605]
/usr/local/lib/libFOX-1.6.so.0(_ZN2FX5FXApp3runEv+0x5d) [0x194b5325]
/home/znow/.rvm/gems/ruby-2.2.1/extensions/x86_64-linux/2.2.0/fxruby-1.6.33/fox16_c.so(_Z13FXApp_run_gvlPN2FX5FXAppE+0x18) [0x187d0bc7]
/home/znow/.rvm/gems/ruby-2.2.1/extensions/x86_64-linux/2.2.0/fxruby-1.6.33/fox16_c.so [0x187cede0]
/home/znow/.rvm/rubies/ruby-2.2.1/lib/libruby.so.2.2(rb_thread_call_without_gvl+0x45) [0x5023615] thread.c:1274
/home/znow/.rvm/gems/ruby-2.2.1/extensions/x86_64-linux/2.2.0/fxruby-1.6.33/fox16_c.so(_Z9FXApp_runPN2FX5FXAppE+0x43) [0x187d08f1]
/home/znow/.rvm/gems/ruby-2.2.1/extensions/x86_64-linux/2.2.0/fxruby-1.6.33/fox16_c.so [0x1873927d]
/home/znow/.rvm/rubies/ruby-2.2.1/lib/libruby.so.2.2(vm_call_cfunc+0x122) [0x4ffd462] vm_insnhelper.c:1382
/home/znow/.rvm/rubies/ruby-2.2.1/lib/libruby.so.2.2(vm_call_method+0x11e) [0x501077e] vm_insnhelper.c:1691
/home/znow/.rvm/rubies/ruby-2.2.1/lib/libruby.so.2.2(vm_exec_core+0x1302) [0x5003c52] insns.def:1054
/home/znow/.rvm/rubies/ruby-2.2.1/lib/libruby.so.2.2(vm_exec+0x78) [0x50085f8] vm.c:1400
/home/znow/.rvm/rubies/ruby-2.2.1/lib/libruby.so.2.2(rb_iseq_eval_main+0x203) [0x5009fb3] vm.c:1670
/home/znow/.rvm/rubies/ruby-2.2.1/lib/libruby.so.2.2(ruby_exec_internal+0xbd) [0x4eb5a2d] eval.c:252
/home/znow/.rvm/rubies/ruby-2.2.1/lib/libruby.so.2.2(ruby_exec_node+0x1d) [0x4eb81dd] eval.c:317
/home/znow/.rvm/rubies/ruby-2.2.1/lib/libruby.so.2.2(ruby_run_node+0x1e) [0x4ebaa5e] eval.c:309
/home/znow/.rvm/rubies/ruby-2.2.1/bin/ruby(main+0x4b) [0x4008bb] main.c:36

@andyschmidt
Copy link
Author

crasj summary:

==2876== 
==2876== Process terminating with default action of signal 6 (SIGABRT)
==2876==    at 0x5C94A98: raise (in /usr/lib64/libc-2.22.so)
==2876==    by 0x5C96699: abort (in /usr/lib64/libc-2.22.so)
==2876==    by 0x4EB02F7: die (error.c:395)
==2876==    by 0x4EB02F7: rb_bug_context (error.c:427)
==2876==    by 0x4F8D9ED: sigsegv (signal.c:879)
==2876==    by 0x53179EF: ??? (in /usr/lib64/libpthread-2.22.so)
==2876==    by 0x19689C1D: FX::FXWindow::onUpdate(FX::FXObject*, unsigned int, void*) (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==2876== 
==2876== HEAP SUMMARY:
==2876==     in use at exit: 69,878,943 bytes in 450,226 blocks
==2876==   total heap usage: 11,391,617 allocs, 10,941,391 frees, 1,151,328,192 bytes allocated
==2876== 
==2876== LEAK SUMMARY:
==2876==    definitely lost: 13,981 bytes in 160 blocks
==2876==    indirectly lost: 83,375 bytes in 519 blocks
==2876==      possibly lost: 30,947 bytes in 1,014 blocks
==2876==    still reachable: 69,750,640 bytes in 448,533 blocks
==2876==                       of which reachable via heuristic:
==2876==                         newarray           : 2,196,208 bytes in 8 blocks
==2876==         suppressed: 0 bytes in 0 blocks
==2876== Rerun with --leak-check=full to see details of leaked memory
==2876== 
==2876== For counts of detected and suppressed errors, rerun with: -v
==2876== Use --track-origins=yes to see where uninitialised values come from
==2876== ERROR SUMMARY: 911280 errors from 935 contexts (suppressed: 0 from 0)
'''

@andyschmidt
Copy link
Author

Hi Lars, any news on this?
I cleaned up my code a bit and looked for "illegal" GUI actions. But now, even if it seems to be clean I get the crashes :(

@andyschmidt
Copy link
Author

my last crashes on linux (inside a vm) happend always at the same address (0xb). The crashes were happening randomly, without a specific interaction.

==20319== Invalid read of size 4
==20319==    at 0xAC1C342: FX::FXWindow::onUpdate(FX::FXObject*, unsigned int, void*) (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==20319==    by 0xAC176DD: FX::FXWindow::handle(FX::FXObject*, unsigned int, void*) (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==20319==    by 0xAAE2D62: FX::FXFrame::handle(FX::FXObject*, unsigned int, void*) (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==20319==    by 0xAB03ADC: FX::FXHeader::handle(FX::FXObject*, unsigned int, void*) (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==20319==    by 0xAA6F601: FX::FXApp::getNextEvent(_XEvent&, bool) (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==20319==    by 0xAA73552: FX::FXApp::runOneEvent(bool) (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==20319==    by 0xAA73296: FX::FXApp::run() (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==20319==    by 0xA3C7445: FXApp_run_gvl(FX::FXApp*) (in /usr/share/watobo/rvm/gems/ruby-2.0.0-p643/gems/fxruby-1.6.33/lib/fox16_c.so)
==20319==    by 0xA3C579D: gvl_FXApp_run_skeleton(void*) (in /usr/share/watobo/rvm/gems/ruby-2.0.0-p643/gems/fxruby-1.6.33/lib/fox16_c.so)
==20319==    by 0x41F558A: call_without_gvl (thread.c:1225)
==20319==    by 0x41F558A: rb_thread_call_without_gvl (thread.c:1335)
==20319==    by 0xA3C7177: FXApp_run(FX::FXApp*) (in /usr/share/watobo/rvm/gems/ruby-2.0.0-p643/gems/fxruby-1.6.33/lib/fox16_c.so)
==20319==    by 0xA34E104: _wrap_FXApp_run(int, unsigned long*, unsigned long) (in /usr/share/watobo/rvm/gems/ruby-2.0.0-p643/gems/fxruby-1.6.33/lib/fox16_c.so)
==20319==  Address 0x6138de8 is 0 bytes inside a block of size 4 free'd
==20319==    at 0x4029560: operator delete(void*) (vg_replace_malloc.c:575)
==20319==    by 0xA20D408: FXRbObject::~FXRbObject() (in /usr/share/watobo/rvm/gems/ruby-2.0.0-p643/gems/fxruby-1.6.33/lib/fox16_c.so)
==20319==    by 0xA14B4B5: FXRbObject::freefunc(FX::FXObject*) (in /usr/share/watobo/rvm/gems/ruby-2.0.0-p643/gems/fxruby-1.6.33/lib/fox16_c.so)
==20319==    by 0x40B4902: run_final (gc.c:1418)
==20319==    by 0x40B4902: finalize_list (gc.c:1432)
==20319==    by 0x40B565E: finalize_deferred (gc.c:1452)
==20319==    by 0x40B565E: rb_gc_finalize_deferred (gc.c:1461)
==20319==    by 0x41F3A5C: rb_threadptr_execute_interrupts.part.30 (thread.c:1959)
==20319==    by 0x41F3F87: rb_threadptr_execute_interrupts (thread.c:1901)
==20319==    by 0x41F3F87: set_unblock_function (thread.c:303)
==20319==    by 0x41F3F87: blocking_region_begin.constprop.42 (thread.c:1163)
==20319==    by 0x41F4280: rb_thread_call_with_gvl (thread.c:1437)
==20319==    by 0xA22709E: unsigned long FXRbLookupHandler<FXRbText*, unsigned int>(FXRbText*, unsigned int) (in /usr/share/watobo/rvm/gems/ruby-2.0.0-p643/gems/fxruby-1.6.33/lib/fox16_c.so)
==20319==    by 0xA1F768D: FXRbText::handle(FX::FXObject*, unsigned int, void*) (in /usr/share/watobo/rvm/gems/ruby-2.0.0-p643/gems/fxruby-1.6.33/lib/fox16_c.so)
==20319==    by 0xAB66991: FX::FXObject::tryHandle(FX::FXObject*, unsigned int, void*) (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==20319==    by 0xAC1C369: FX::FXWindow::onUpdate(FX::FXObject*, unsigned int, void*) (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==20319==  Block was alloc'd at
==20319==    at 0x4028660: operator new(unsigned int) (vg_replace_malloc.c:327)
==20319==    by 0xA32E499: new_FXObject() (in /usr/share/watobo/rvm/gems/ruby-2.0.0-p643/gems/fxruby-1.6.33/lib/fox16_c.so)
==20319==    by 0xA33FD00: _wrap_new_FXObject(int, unsigned long*, unsigned long) (in /usr/share/watobo/rvm/gems/ruby-2.0.0-p643/gems/fxruby-1.6.33/lib/fox16_c.so)
==20319==    by 0x41CBEC2: call_cfunc_m1 (vm_insnhelper.c:1369)
==20319==    by 0x41CF29E: vm_call_cfunc_with_frame (vm_insnhelper.c:1513)
==20319==    by 0x41DE4AF: vm_call_cfunc (vm_insnhelper.c:1603)
==20319==    by 0x41DE4AF: vm_call_method (vm_insnhelper.c:1797)
==20319==    by 0x41D34E5: vm_exec_core (insns.def:1039)
==20319==    by 0x41D8663: vm_exec (vm.c:1270)
==20319==    by 0x41D964E: vm_call0_body.constprop.61 (vm_eval.c:170)
==20319==    by 0x41DA9D4: vm_call0 (vm_eval.c:49)
==20319==    by 0x41DA9D4: rb_call0 (vm_eval.c:324)
==20319==    by 0x40A1ED2: rb_obj_call_init (eval.c:1236)
==20319==    by 0x40F8ADB: rb_class_new_instance (object.c:1799)
==20319== 
==20319== Invalid read of size 4
==20319==    at 0xAC1C347: FX::FXWindow::onUpdate(FX::FXObject*, unsigned int, void*) (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==20319==    by 0xAC176DD: FX::FXWindow::handle(FX::FXObject*, unsigned int, void*) (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==20319==    by 0xAAE2D62: FX::FXFrame::handle(FX::FXObject*, unsigned int, void*) (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==20319==    by 0xAB03ADC: FX::FXHeader::handle(FX::FXObject*, unsigned int, void*) (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==20319==    by 0xAA6F601: FX::FXApp::getNextEvent(_XEvent&, bool) (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==20319==    by 0xAA73552: FX::FXApp::runOneEvent(bool) (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==20319==    by 0xAA73296: FX::FXApp::run() (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==20319==    by 0xA3C7445: FXApp_run_gvl(FX::FXApp*) (in /usr/share/watobo/rvm/gems/ruby-2.0.0-p643/gems/fxruby-1.6.33/lib/fox16_c.so)
==20319==    by 0xA3C579D: gvl_FXApp_run_skeleton(void*) (in /usr/share/watobo/rvm/gems/ruby-2.0.0-p643/gems/fxruby-1.6.33/lib/fox16_c.so)
==20319==    by 0x41F558A: call_without_gvl (thread.c:1225)
==20319==    by 0x41F558A: rb_thread_call_without_gvl (thread.c:1335)
==20319==    by 0xA3C7177: FXApp_run(FX::FXApp*) (in /usr/share/watobo/rvm/gems/ruby-2.0.0-p643/gems/fxruby-1.6.33/lib/fox16_c.so)
==20319==    by 0xA34E104: _wrap_FXApp_run(int, unsigned long*, unsigned long) (in /usr/share/watobo/rvm/gems/ruby-2.0.0-p643/gems/fxruby-1.6.33/lib/fox16_c.so)
==20319==  Address 0xb is not stack'd, malloc'd or (recently) free'd
==20319== 
/usr/share/watobo/rvm/gems/ruby-2.0.0-p643/gems/watobo-0.9.22/lib/watobo/gui.rb:74: [BUG] Segmentation fault
ruby 2.0.0p643 (2015-02-25 revision 49749) [i686-linux]

@larskanis
Copy link
Owner

The above stack trace looks promising, because it shows, where the illegal access happened, where the memory was free'd and where it was allocated. I'll have a look at it now.

It's almost always a GC issue, when ruby crashes randomly. And the fox toolkit isn't built with a GC in mind....

@larskanis
Copy link
Owner

Damn - I don't get it! The crash happens, because of an event is sent to a FXWindow object, whose target pointer is no longer valid. The target pointer is most likely a FXPseudoTarget object and this is always assigned to an instance variable of the FXWindow object. Therefore ruby usually should not GC the FXPseudoTarget alone without the FXWindow object. However it seems that exactly this happens.

The only idea I have, is that the whole FXWindow object is orphaned (and the FXPseudoTarget with it), but ruby chose to free the FXPseudoTarget first, and then went back to ruby code, so that the next event is delivered to an half deleted object. This however shouldn't happen, because any orphaned FXWindow object should decoupled from the message queue.

I need a way to reproduce this! Without further possibility to debug it, I fear to be unable to fix this issue.

@andyschmidt
Copy link
Author

No good news :(
Reproducing seems to be very hard. The old FXRuby verion 1.6.28 was more stable allthough I got crashes when closing the application. Is there anything obvious you changed which could lead to this behaviour?
FXRuby has also the function addChore, which seems to be very similar to runOnUiThread. Can I use this instead?

@larskanis
Copy link
Owner

I guess addChore will work reasonable on MRI, because of MRI's internal locking (GVL). However it is not written to be thread safe on the C++ side. In contrast runOnUiThread is fully thread safe.

I did another longer scan and test session with watobo, but it is - well - stable as a rock! This is on native running Ubuntu-15.10 and ruby-2.2.4, installed per rvm.

@andyschmidt
Copy link
Author

good to hear that it's stable on your side :)
Do you use the git version of watobo?
I get crashes on windows and linux and it drives me crazy ... will do more checks on this next week.

@larskanis
Copy link
Owner

It's the latest github state. I'm not sure, what I did exactly, but I did various scans on my web applications with watobo. This program is huge - really awesome! And it didn't crash a single time.

Maybe it's an issue related to the ruby version. You seem to use ruby-2.0 both on Windows and on Linux. I'll try this version too and maybe also Rubinius, as well.

@andyschmidt
Copy link
Author

I tested on ruby 2.2.4 via rvm (Kali 2016) and it's still crashing. I'm using foxlibs 1.6.50 and FXScintilla 2.28.0. To ./configure fxscintilla I use the switch --enable-shared. Are there any differences here?

@andyschmidt
Copy link
Author

Hi Lars,

any news on this?
Here's my latest crash on a Ubuntu 15.10 (amd64) system:

Ruby Version: 2.2.4
Ruby Platform: x86_64-linux
FXRuby Version: 1.6.33
Fox Version: 1.6.50
Watobo Version: latest git

==16194== Thread 1:
==16194== Use of uninitialised value of size 8
==16194==    at 0x4ED74EB: gc_mark_set (gc.c:3955)
==16194==    by 0x4ED74EB: gc_mark_ptr (gc.c:4076)
==16194==    by 0x4ED74EB: gc_mark_maybe (gc.c:3941)
==16194==    by 0x4ED74EB: mark_locations_array (gc.c:3688)
==16194==    by 0x4ED74EB: gc_mark_locations (gc.c:3700)
==16194==    by 0x4ED74EB: rb_gc_mark_machine_stack (gc.c:3918)
==16194==    by 0x1E000C00C2FF: ???
==16194==    by 0x6200000027FFFFFF: ???
==16194==    by 0xA0000000032FFFFF: ???
==16194==    by 0xFFFFFFFFFFDFDFFE: ???
==16194==    by 0x18EB336F: ???
==16194==    by 0xFFEFFD99F: ???
==16194== 
==16194== Use of uninitialised value of size 8
==16194==    at 0x4ED033F: gc_aging (gc.c:4054)
==16194==    by 0xE0007A0002500001: ???
==16194==    by 0x6FDD9C8028888887: ???
==16194==    by 0x128046000000000: ???
==16194==    by 0x1000318000012FF: ???
==16194==    by 0x4F98C21: st_lookup (st.c:388)
==16194== 
==16194== Use of uninitialised value of size 8
==16194==    at 0x4ED033F: gc_aging (gc.c:4054)
==16194==    by 0x42890608409123: ???
==16194==    by 0xFDBEBDFBFF6DBB7E: ???
==16194==    by 0x616BABF: ???
==16194==    by 0xD79631FF1A000E03: ???
==16194==    by 0x603738F: ???
==16194==    by 0x220: ???
==16194==    by 0x20200200200C0807: ???
==16194==    by 0xD79631FF1A000E03: ???
==16194==    by 0x6E0603732F: ???
==16194==    by 0x60000001C2E17C1F: ???
==16194==    by 0x1A17EA5F: ???
==16194== 
==16194== Use of uninitialised value of size 8
==16194==    at 0x4ED033F: gc_aging (gc.c:4054)
==16194==    by 0x18008000FFFF: ???
==16194==    by 0x5B7D46197EFFF8BD: ???
==16194==    by 0x3E9000008260AC04: ???
==16194==    by 0x5B7D46197EFFF8BD: ???
==16194==    by 0x16DB64DF: ???
==16194==    by 0xFFEFFD93F: ???
==16194== 
==16194== Use of uninitialised value of size 8
==16194==    at 0x4ED033F: gc_aging (gc.c:4054)
==16194==    by 0xA000B50200001183: ???
==16194==    by 0x421D4A5042685A39: ???
==16194==    by 0x3E9000008260AC04: ???
==16194==    by 0x5B7D46197EFFF8BD: ???
==16194==    by 0x16DB64DF: ???
==16194==    by 0xFFEFFD93F: ???
==16194== 
==16194== Use of uninitialised value of size 8
==16194==    at 0x4ED74EB: gc_mark_set (gc.c:3955)
==16194==    by 0x4ED74EB: gc_mark_ptr (gc.c:4076)
==16194==    by 0x4ED74EB: gc_mark_maybe (gc.c:3941)
==16194==    by 0x4ED74EB: mark_locations_array (gc.c:3688)
==16194==    by 0x4ED74EB: gc_mark_locations (gc.c:3700)
==16194==    by 0x4ED74EB: rb_gc_mark_machine_stack (gc.c:3918)
==16194==    by 0x1E00CBFFFFFF: ???
==16194==    by 0x6200000027FFFFFF: ???
==16194==    by 0xA0000000032FFFFF: ???
==16194==    by 0xFFFFFFFFFFFFFFFE: ???
==16194==    by 0x18EB336F: ???
==16194==    by 0xFFEFFE55F: ???
==16194== 
==16194== Use of uninitialised value of size 8
==16194==    at 0x4ED033F: gc_aging (gc.c:4054)
==16194==    by 0xE0007A0002FFFFFF: ???
==16194==    by 0x6FDD9C8028888887: ???
==16194==    by 0x128046000000000: ???
==16194==    by 0x1000318000012FF: ???
==16194==    by 0x4F98C21: st_lookup (st.c:388)
==16194== 
==16194== Use of uninitialised value of size 8
==16194==    at 0x4ED033F: gc_aging (gc.c:4054)
==16194==    by 0x400000010800027F: ???
==16194==    by 0xB9CCCCCCF4CBD7BA: ???
==16194==    by 0x17950C0F: ???
==16194==    by 0xD79631FF1A000E03: ???
==16194== 

[I] https://m140a1-pentest1-421.if-etaps.de:443/de/home/login-online-...
==16194== Invalid read of size 8
==16194==    at 0x11F77951: FX::FXWindow::onUpdate(FX::FXObject*, unsigned int, void*) (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==16194==    by 0x11F71F9C: FX::FXWindow::handle(FX::FXObject*, unsigned int, void*) (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==16194==    by 0x11E151F3: FX::FXFrame::handle(FX::FXObject*, unsigned int, void*) (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==16194==    by 0x11E3A4F9: FX::FXHeader::handle(FX::FXObject*, unsigned int, void*) (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==16194==    by 0x11D91748: FX::FXApp::getNextEvent(_XEvent&, bool) (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==16194==    by 0x11D96E59: FX::FXApp::runOneEvent(bool) (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==16194==    by 0x11D96AEB: FX::FXApp::run() (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==16194==    by 0x113A4B4E: FXApp_run_gvl(FX::FXApp*) (in /home/siberas/.rvm/gems/ruby-2.2.4/gems/fxruby-1.6.33/lib/fox16_c.so)
==16194==    by 0x113A2349: gvl_FXApp_run_skeleton(void*) (in /home/siberas/.rvm/gems/ruby-2.2.4/gems/fxruby-1.6.33/lib/fox16_c.so)
==16194==    by 0x5025214: call_without_gvl (thread.c:1274)
==16194==    by 0x5025214: rb_thread_call_without_gvl (thread.c:1384)
==16194==    by 0x113A474C: FXApp_run(FX::FXApp*) (in /home/siberas/.rvm/gems/ruby-2.2.4/gems/fxruby-1.6.33/lib/fox16_c.so)
==16194==    by 0x10D3C25E: _wrap_FXApp_run(int, unsigned long*, unsigned long) (in /home/siberas/.rvm/gems/ruby-2.2.4/gems/fxruby-1.6.33/lib/fox16_c.so)
==16194==  Address 0x10184d30 is 0 bytes inside a block of size 8 free'd
==16194==    at 0x4C2D184: operator delete(void*) (vg_replace_malloc.c:575)
==16194==    by 0x10E2173F: FXRbObject::~FXRbObject() (in /home/siberas/.rvm/gems/ruby-2.2.4/gems/fxruby-1.6.33/lib/fox16_c.so)
==16194==    by 0x10DB39E4: FXRbObject::freefunc(FX::FXObject*) (in /home/siberas/.rvm/gems/ruby-2.2.4/gems/fxruby-1.6.33/lib/fox16_c.so)
==16194==    by 0x4ED1F40: run_final (gc.c:2459)
==16194==    by 0x4ED1F40: finalize_list (gc.c:2475)
==16194==    by 0x4ED2C8F: finalize_deferred (gc.c:2496)
==16194==    by 0x4ED2C8F: gc_finalize_deferred (gc.c:2505)
==16194==    by 0x501DF72: rb_postponed_job_flush (vm_trace.c:1574)
==16194==    by 0x5023D68: rb_threadptr_execute_interrupts.part.41 (thread.c:1971)
==16194==    by 0x500955B: vm_exec_core (insns.def:1200)
==16194==    by 0x500AA5A: vm_exec (vm.c:1435)
==16194==    by 0x500C1D0: vm_call0_body.constprop.84 (vm_eval.c:180)
==16194==    by 0x500CC15: vm_call0 (vm_eval.c:59)
==16194==    by 0x500CC15: rb_call0 (vm_eval.c:349)
==16194==    by 0x500D1B3: rb_call (vm_eval.c:616)
==16194==    by 0x500D1B3: rb_funcall (vm_eval.c:818)
==16194==  Block was alloc'd at
==16194==    at 0x4C2C158: operator new(unsigned long) (vg_replace_malloc.c:333)
==16194==    by 0x10D180D2: new_FXObject() (in /home/siberas/.rvm/gems/ruby-2.2.4/gems/fxruby-1.6.33/lib/fox16_c.so)
==16194==    by 0x10D2B6F5: _wrap_new_FXObject(int, unsigned long*, unsigned long) (in /home/siberas/.rvm/gems/ruby-2.2.4/gems/fxruby-1.6.33/lib/fox16_c.so)
==16194==    by 0x4FFF831: vm_call_cfunc_with_frame (vm_insnhelper.c:1380)
==16194==    by 0x4FFF831: vm_call_cfunc (vm_insnhelper.c:1473)
==16194==    by 0x501254D: vm_call_method (vm_insnhelper.c:1689)
==16194==    by 0x50062A4: vm_exec_core (insns.def:1088)
==16194==    by 0x500AA5A: vm_exec (vm.c:1435)
==16194==    by 0x500C1D0: vm_call0_body.constprop.84 (vm_eval.c:180)
==16194==    by 0x500CC15: vm_call0 (vm_eval.c:59)
==16194==    by 0x500CC15: rb_call0 (vm_eval.c:349)
==16194==    by 0x4F1E790: rb_class_new_instance (object.c:1862)
==16194==    by 0x4FFF831: vm_call_cfunc_with_frame (vm_insnhelper.c:1380)
==16194==    by 0x4FFF831: vm_call_cfunc (vm_insnhelper.c:1473)
==16194==    by 0x5006152: vm_exec_core (insns.def:1070)
==16194== 
==16194== Invalid read of size 8
==16194==    at 0x11F77958: FX::FXWindow::onUpdate(FX::FXObject*, unsigned int, void*) (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==16194==    by 0x11F71F9C: FX::FXWindow::handle(FX::FXObject*, unsigned int, void*) (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==16194==    by 0x11E151F3: FX::FXFrame::handle(FX::FXObject*, unsigned int, void*) (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==16194==    by 0x11E3A4F9: FX::FXHeader::handle(FX::FXObject*, unsigned int, void*) (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==16194==    by 0x11D91748: FX::FXApp::getNextEvent(_XEvent&, bool) (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==16194==    by 0x11D96E59: FX::FXApp::runOneEvent(bool) (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==16194==    by 0x11D96AEB: FX::FXApp::run() (in /usr/local/lib/libFOX-1.6.so.0.0.50)
==16194==    by 0x113A4B4E: FXApp_run_gvl(FX::FXApp*) (in /home/siberas/.rvm/gems/ruby-2.2.4/gems/fxruby-1.6.33/lib/fox16_c.so)
==16194==    by 0x113A2349: gvl_FXApp_run_skeleton(void*) (in /home/siberas/.rvm/gems/ruby-2.2.4/gems/fxruby-1.6.33/lib/fox16_c.so)
==16194==    by 0x5025214: call_without_gvl (thread.c:1274)
==16194==    by 0x5025214: rb_thread_call_without_gvl (thread.c:1384)
==16194==    by 0x113A474C: FXApp_run(FX::FXApp*) (in /home/siberas/.rvm/gems/ruby-2.2.4/gems/fxruby-1.6.33/lib/fox16_c.so)
==16194==    by 0x10D3C25E: _wrap_FXApp_run(int, unsigned long*, unsigned long) (in /home/siberas/.rvm/gems/ruby-2.2.4/gems/fxruby-1.6.33/lib/fox16_c.so)
==16194==  Address 0x17 is not stack'd, malloc'd or (recently) free'd
==16194== 
/home/siberas/watobo/lib/watobo/gui.rb:74: [BUG] Segmentation fault at 0x00000000000017
ruby 2.2.4p230 (2015-12-16 revision 53155) [x86_64-linux]

-- Control frame information -----------------------------------------------
c:0004 p:---- s:0011 e:000010 CFUNC  :run
c:0003 p:0097 s:0008 e:000007 METHOD /home/siberas/watobo/lib/watobo/gui.rb:74
c:0002 p:0154 s:0005 E:002348 EVAL   watobo_gui.rb:21 [FINISH]
c:0001 p:0000 s:0002 E:001040 TOP    [FINISH]

@larskanis
Copy link
Owner

any news on this?

Not much. I tested with Rubinius and it was equally stable. It only consumed more memory and felt somewhat slower. I used the fox toolkit and fxscintilla from the Ubuntu-15.10 repository.

However thank you for the stack traces based on ruby-2.2! They look very similar. How long do you work with watobo, until it crashes?

@andyschmidt
Copy link
Author

Hi Lars,

sorry for my late response, I've been on vacation.
sometimes watobo crashes after a view seconds, sometimes after 20minutes or even hours.
seems like it depends on how many requests are made through it.

@andyschmidt
Copy link
Author

mmmhhh ... I could crash it without making a single request through it, just by clicking/switching between plugins, views, etc. (tested on windows) - after I started a new project!

@andyschmidt
Copy link
Author

I now removed all addTimeouts and replaced them with a threaded loop which calls runOnUiThread, but without any success.
At the moment it's crashing every minute :(

@andyschmidt
Copy link
Author

ok, now I switched back to old-style Timeouts/Chors and FXRuby 1.6.29.
no more crashes so far :)

@larskanis
Copy link
Owner

I'm almost sure, that this commit is causing your troubles. I'm still unable to reproduce this on Linux (and Windows isn't very helpful, because I can not debug these kind of issues seriously). If you can find a more minimalist example to get this crash, it would still be useful.

@andyschmidt
Copy link
Author

ok, I'll let you know.

@larskanis
Copy link
Owner

I pushed fxruby-1.6.37.rc1 to rubygems.org which should fix this issue. Can you please test against your applications, if everything runs as expected?

@larskanis
Copy link
Owner

@andyschmidt Does fxruby-1.6.37 fix this issue?

@andyschmidt
Copy link
Author

Hi I run some some tests on win and linux. got one crash on linux so far ... but it was a different one. no crash on windows :)

good job! Thanks a lot! :)

@larskanis
Copy link
Owner

libfox isn't built with garbage collection in mind. This and the additional layer of SWIG makes it very difficult to handle all edge cases of object access and memory handling correctly. Nevertheless I'm quite happy with the current solution. When I started with fxruby internals, I didn't believe that we'll be able to handle these cases cleanly.

When I find some free time, I'll have a look at the "crash at exit" issues. Thank you for following up!

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

2 participants