Skip to content

Instantly share code, notes, and snippets.

@mattn
Created September 23, 2017 12:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattn/a4d949ce93080b0b70250311d69fab72 to your computer and use it in GitHub Desktop.
Save mattn/a4d949ce93080b0b70250311d69fab72 to your computer and use it in GitHub Desktop.
ruby: [BUG] Segmentation fault
ruby 2.4.0p0 (2016-12-24 revision 57164) [x64-mingw32]
-- Control frame information -----------------------------------------------
c:0001 p:0000 s:0003 E:001f20 (none) [FINISH]
-- C level backtrace information -------------------------------------------
C:\WINDOWS\SYSTEM32\ntdll.dll(ZwWaitForSingleObject+0x14) [0x00007ff880445424]
C:\WINDOWS\System32\KERNELBASE.dll(WaitForSingleObjectEx+0x9f) [0x00007ff87cb7988f]
c:\msys64\mingw64\bin\x64-msvcrt-ruby240.dll(rb_print_backtrace+0x36) [0x0000000067b000e6]
c:\msys64\mingw64\bin\x64-msvcrt-ruby240.dll(rb_vm_bugreport+0x67) [0x0000000067b00157]
c:\msys64\mingw64\bin\x64-msvcrt-ruby240.dll(rb_bug_context+0x69) [0x00000000679dcf99]
c:\msys64\mingw64\bin\x64-msvcrt-ruby240.dll(rb_check_safe_obj+0x6cc) [0x0000000067a96d5c]
[0x0000000000402507]
C:\WINDOWS\SYSTEM32\ntdll.dll(_C_specific_handler+0x96) [0x00007ff880436466]
C:\WINDOWS\SYSTEM32\ntdll.dll(_chkstk+0x11d) [0x00007ff88044a07d]
C:\WINDOWS\SYSTEM32\ntdll.dll(RtlLookupFunctionEntry+0xab8) [0x00007ff8803b9c58]
C:\WINDOWS\SYSTEM32\ntdll.dll(KiUserExceptionDispatcher+0x2e) [0x00007ff8804490fe]
c:\msys64\mingw64\bin\x64-msvcrt-ruby240.dll(rb_vm_make_jump_tag_but_local_jump+0x2f) [0x0000000067afb96f]
c:\msys64\mingw64\bin\x64-msvcrt-ruby240.dll(rb_iseqw_local_variables+0xb87) [0x0000000067a17437]
c:\msys64\mingw64\bin\x64-msvcrt-ruby240.dll(rb_load_protect+0xf1) [0x0000000067a186a1]
[0x00000000004015f3]
[0x00000000004013f7]
[0x000000000040152b]
C:\WINDOWS\System32\KERNEL32.DLL(BaseThreadInitThunk+0x14) [0x00007ff8801f2774]
-- Other runtime information -----------------------------------------------
* Loaded script: ruby
* Loaded features:
0 enumerator.so
1 thread.rb
2 rational.so
3 complex.so
[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
#include <stdio.h>
#include <ruby.h>
//static void *ruby_stack_start;
int
main(int argc, char* argv[]) {
int dummy_argc = 2;
char *dummy_argv[] = {"ruby", "-e0"};
ruby_sysinit(&argc, &argv);
RUBY_INIT_STACK;
/*
VALUE variable_in_this_stack_frame;
ruby_init_stack(&variable_in_this_stack_frame);
*/
ruby_init();
/*
ruby_options(dummy_argc, dummy_argv);
*/
ruby_script("ruby");
int state;
rb_load_protect(rb_str_new2("./raise.rb"), 0, &state);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment