stephenfewer/grinder

Segmentation fault - issue - please help

Closed this issue · 2 comments

I was trying to execute grinder following error is occurred. May be it is not a grinder issue but I couldn't fixed it.
Could you please help me to fix this problem.

C:\grinder\node>ruby grinder.rb --browser=FF

                   ______     _           __
                  / ____/____(_)___  ____/ /__  _____
                 / / __/ ___/ / __ \/ __  / _ \/ ___/
                / /_/ / /  / / / / / /_/ /  __/ /
                \____/_/  /_/_/ /_/\__,_/\___/_/

    By Stephen Fewer of Harmony Security (www.harmonysecurity.com)
                                             GRINDER - Version 0.5

[+G+] Starting at 2014-05-26 16:31:06
C:/grinder/node/lib/metasm/metasm/dynldr-windows-ia32-19.so: [BUG] Segmentation fault
ruby 2.0.0p481 (2014-05-08) [i386-mingw32]

-- Control frame information -----------------------------------------------
c:0014 p:-10349332 s:0062 e:000061 TOP [FINISH]
c:0013 p:---- s:0060 e:000059 CFUNC :require
c:0012 p:0115 s:0056 e:000055 METHOD C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55
c:0011 p:0089 s:0046 e:000045 METHOD C:/grinder/node/lib/metasm/metasm/dynldr.rb:612
c:0010 p:0620 s:0042 e:000041 CLASS C:/grinder/node/lib/metasm/metasm/dynldr.rb:1297
c:0009 p:0011 s:0040 e:000039 CLASS C:/grinder/node/lib/metasm/metasm/dynldr.rb:11
c:0008 p:0009 s:0038 e:000037 TOP C:/grinder/node/lib/metasm/metasm/dynldr.rb:10 [FINISH]
c:0007 p:---- s:0036 e:000035 CFUNC :require
c:0006 p:0115 s:0032 e:000031 METHOD C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55
c:0005 p:0023 s:0022 e:000021 TOP C:/grinder/node/lib/metasm/metasm/os/windows.rb:8 [FINISH]
c:0004 p:0185 s:0020 e:000019 METHOD C:/grinder/node/core/configuration.rb:36
c:0003 p:0012 s:0013 e:000012 METHOD grinder.rb:142
c:0002 p:0403 s:0007 E:001d98 EVAL grinder.rb:258 [FINISH]
c:0001 p:0000 s:0002 E:001b54 TOP [FINISH]

grinder.rb:258:in <main>' grinder.rb:142:inrun'
C:/grinder/node/core/configuration.rb:36:in config_init' C:/grinder/node/lib/metasm/metasm/os/windows.rb:8:in<top (required)>'
C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in require' C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:inrequire'
C:/grinder/node/lib/metasm/metasm/dynldr.rb:10:in <top (required)>' C:/grinder/node/lib/metasm/metasm/dynldr.rb:11:inmodule:Metasm'
C:/grinder/node/lib/metasm/metasm/dynldr.rb:1297:in <class:DynLdr>' C:/grinder/node/lib/metasm/metasm/dynldr.rb:612:instart'
C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in require' C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:inrequire'

-- C level backtrace information -------------------------------------------
C:\Windows\SYSTEM32\ntdll.dll(KiFastSystemCallRet+0x0) [0x77A064F4]
C:\Windows\system32\kernel32.dll(WaitForSingleObjectEx+0x43) [0x75E6F003]
C:\Windows\system32\kernel32.dll(WaitForSingleObject+0x12) [0x75E6EFB2]
C:\Ruby200\bin\msvcrt-ruby200.dll(rb_vm_bugreport+0xa7) [0x668F8107]
C:\Ruby200\bin\msvcrt-ruby200.dll(rb_name_err_mesg_new+0x69d) [0x667BE36D]
C:\Ruby200\bin\msvcrt-ruby200.dll(rb_bug+0x2e) [0x667BF16E]
C:\Ruby200\bin\msvcrt-ruby200.dll(rb_check_safe_str+0x180) [0x6687E480]
[0x00401866]
C:\Windows\SYSTEM32\ntdll.dll(RtlGetThreadErrorMode+0x3c) [0x77A35A74]

-- Other runtime information -----------------------------------------------

  • Loaded script: grinder.rb

  • Loaded features:

    0 enumerator.so
    1 C:/Ruby200/lib/ruby/2.0.0/i386-mingw32/enc/encdb.so
    2 C:/Ruby200/lib/ruby/2.0.0/i386-mingw32/enc/iso_8859_1.so
    3 C:/Ruby200/lib/ruby/2.0.0/i386-mingw32/enc/trans/transdb.so
    4 C:/Ruby200/lib/ruby/2.0.0/i386-mingw32/rbconfig.rb
    5 C:/Ruby200/lib/ruby/2.0.0/rubygems/compatibility.rb
    6 C:/Ruby200/lib/ruby/2.0.0/rubygems/defaults.rb
    7 C:/Ruby200/lib/ruby/2.0.0/rubygems/deprecate.rb
    8 C:/Ruby200/lib/ruby/2.0.0/rubygems/errors.rb
    9 C:/Ruby200/lib/ruby/2.0.0/rubygems/version.rb
    10 C:/Ruby200/lib/ruby/2.0.0/rubygems/requirement.rb
    11 C:/Ruby200/lib/ruby/2.0.0/rubygems/platform.rb
    12 C:/Ruby200/lib/ruby/2.0.0/rubygems/specification.rb
    13 C:/Ruby200/lib/ruby/2.0.0/rubygems/exceptions.rb
    14 C:/Ruby200/lib/ruby/2.0.0/rubygems/defaults/operating_system.rb
    15 C:/Ruby200/lib/ruby/2.0.0/i386-mingw32/enc/utf_16le.so
    16 C:/Ruby200/lib/ruby/2.0.0/i386-mingw32/enc/trans/utf_16_32.so
    17 C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_gem.rb
    18 C:/Ruby200/lib/ruby/2.0.0/thread.rb
    19 C:/Ruby200/lib/ruby/2.0.0/monitor.rb
    20 C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb
    21 C:/Ruby200/lib/ruby/2.0.0/rubygems.rb
    22 C:/grinder/node/lib/metasm/metasm/main.rb
    23 C:/grinder/node/lib/metasm/metasm/encode.rb
    24 C:/grinder/node/lib/metasm/metasm/render.rb
    25 C:/grinder/node/lib/metasm/metasm/decode.rb
    26 C:/grinder/node/lib/metasm/metasm/preprocessor.rb
    27 C:/grinder/node/lib/metasm/metasm/parse.rb
    28 C:/grinder/node/lib/metasm/metasm/exe_format/serialstruct.rb
    29 C:/grinder/node/lib/metasm/metasm/os/main.rb
    30 C:/grinder/node/lib/metasm/metasm/exe_format/main.rb
    31 C:/grinder/node/lib/metasm/metasm.rb
    32 C:/grinder/node/core/configuration.rb
    33 C:/grinder/node/core/logging.rb
    34 C:/Ruby200/lib/ruby/2.0.0/i386-mingw32/digest.so
    35 C:/Ruby200/lib/ruby/2.0.0/digest.rb
    36 C:/Ruby200/lib/ruby/2.0.0/i386-mingw32/digest/sha2.so
    37 C:/Ruby200/lib/ruby/2.0.0/digest/sha2.rb
    38 C:/Ruby200/lib/ruby/2.0.0/i386-mingw32/enc/trans/single_byte.so
    39 C:/grinder/node/config.rb
    40 C:/grinder/node/lib/metasm/metasm/debug.rb
    41 C:/grinder/node/lib/metasm/metasm/cpu/ia32/main.rb
    42 C:/grinder/node/lib/metasm/metasm/cpu/ia32/opcodes.rb
    43 C:/grinder/node/lib/metasm/metasm/cpu/ia32/encode.rb
    44 C:/grinder/node/lib/metasm/metasm/cpu/ia32/parse.rb
    45 C:/grinder/node/lib/metasm/metasm/cpu/ia32/decode.rb
    46 C:/grinder/node/lib/metasm/metasm/cpu/ia32/render.rb
    47 C:/grinder/node/lib/metasm/metasm/parse_c.rb
    48 C:/grinder/node/lib/metasm/metasm/compile_c.rb
    49 C:/grinder/node/lib/metasm/metasm/cpu/ia32/compile_c.rb
    50 C:/grinder/node/lib/metasm/metasm/cpu/ia32/decompile.rb
    51 C:/grinder/node/lib/metasm/metasm/cpu/ia32/debug.rb
    52 C:/grinder/node/lib/metasm/metasm/cpu/ia32.rb

[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.

C:\grinder\node>ruby grinder.rb --browser=FF > salla.txt
C:/grinder/node/lib/metasm/metasm/dynldr-windows-ia32-19.so: [BUG] Segmentation fault
ruby 2.0.0p481 (2014-05-08) [i386-mingw32]

-- Control frame information -----------------------------------------------
c:0014 p:-10334652 s:0062 e:000061 TOP [FINISH]
c:0013 p:---- s:0060 e:000059 CFUNC :require
c:0012 p:0115 s:0056 e:000055 METHOD C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55
c:0011 p:0089 s:0046 e:000045 METHOD C:/grinder/node/lib/metasm/metasm/dynldr.rb:612
c:0010 p:0620 s:0042 e:000041 CLASS C:/grinder/node/lib/metasm/metasm/dynldr.rb:1297
c:0009 p:0011 s:0040 e:000039 CLASS C:/grinder/node/lib/metasm/metasm/dynldr.rb:11
c:0008 p:0009 s:0038 e:000037 TOP C:/grinder/node/lib/metasm/metasm/dynldr.rb:10 [FINISH]
c:0007 p:---- s:0036 e:000035 CFUNC :require
c:0006 p:0115 s:0032 e:000031 METHOD C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55
c:0005 p:0023 s:0022 e:000021 TOP C:/grinder/node/lib/metasm/metasm/os/windows.rb:8 [FINISH]
c:0004 p:0185 s:0020 e:000019 METHOD C:/grinder/node/core/configuration.rb:36
c:0003 p:0012 s:0013 e:000012 METHOD grinder.rb:142
c:0002 p:0403 s:0007 E:000978 EVAL grinder.rb:258 [FINISH]
c:0001 p:0000 s:0002 E:0005b4 TOP [FINISH]

grinder.rb:258:in <main>' grinder.rb:142:inrun'
C:/grinder/node/core/configuration.rb:36:in config_init' C:/grinder/node/lib/metasm/metasm/os/windows.rb:8:in<top (required)>'
C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in require' C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:inrequire'
C:/grinder/node/lib/metasm/metasm/dynldr.rb:10:in <top (required)>' C:/grinder/node/lib/metasm/metasm/dynldr.rb:11:inmodule:Metasm'
C:/grinder/node/lib/metasm/metasm/dynldr.rb:1297:in <class:DynLdr>' C:/grinder/node/lib/metasm/metasm/dynldr.rb:612:instart'
C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in require' C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:inrequire'

-- C level backtrace information -------------------------------------------
C:\Windows\SYSTEM32\ntdll.dll(KiFastSystemCallRet+0x0) [0x77A064F4]
C:\Windows\system32\kernel32.dll(WaitForSingleObjectEx+0x43) [0x75E6F003]
C:\Windows\system32\kernel32.dll(WaitForSingleObject+0x12) [0x75E6EFB2]
C:\Ruby200\bin\msvcrt-ruby200.dll(rb_vm_bugreport+0xa7) [0x668F8107]
C:\Ruby200\bin\msvcrt-ruby200.dll(rb_name_err_mesg_new+0x69d) [0x667BE36D]
C:\Ruby200\bin\msvcrt-ruby200.dll(rb_bug+0x2e) [0x667BF16E]
C:\Ruby200\bin\msvcrt-ruby200.dll(rb_check_safe_str+0x180) [0x6687E480]
[0x00401866]
C:\Windows\SYSTEM32\ntdll.dll(RtlGetThreadErrorMode+0x3c) [0x77A35A74]

-- Other runtime information -----------------------------------------------

  • Loaded script: grinder.rb

  • Loaded features:

    0 enumerator.so
    1 C:/Ruby200/lib/ruby/2.0.0/i386-mingw32/enc/encdb.so
    2 C:/Ruby200/lib/ruby/2.0.0/i386-mingw32/enc/iso_8859_1.so
    3 C:/Ruby200/lib/ruby/2.0.0/i386-mingw32/enc/trans/transdb.so
    4 C:/Ruby200/lib/ruby/2.0.0/i386-mingw32/rbconfig.rb
    5 C:/Ruby200/lib/ruby/2.0.0/rubygems/compatibility.rb
    6 C:/Ruby200/lib/ruby/2.0.0/rubygems/defaults.rb
    7 C:/Ruby200/lib/ruby/2.0.0/rubygems/deprecate.rb
    8 C:/Ruby200/lib/ruby/2.0.0/rubygems/errors.rb
    9 C:/Ruby200/lib/ruby/2.0.0/rubygems/version.rb
    10 C:/Ruby200/lib/ruby/2.0.0/rubygems/requirement.rb
    11 C:/Ruby200/lib/ruby/2.0.0/rubygems/platform.rb
    12 C:/Ruby200/lib/ruby/2.0.0/rubygems/specification.rb
    13 C:/Ruby200/lib/ruby/2.0.0/rubygems/exceptions.rb
    14 C:/Ruby200/lib/ruby/2.0.0/rubygems/defaults/operating_system.rb
    15 C:/Ruby200/lib/ruby/2.0.0/i386-mingw32/enc/utf_16le.so
    16 C:/Ruby200/lib/ruby/2.0.0/i386-mingw32/enc/trans/utf_16_32.so
    17 C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_gem.rb
    18 C:/Ruby200/lib/ruby/2.0.0/thread.rb
    19 C:/Ruby200/lib/ruby/2.0.0/monitor.rb
    20 C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb
    21 C:/Ruby200/lib/ruby/2.0.0/rubygems.rb
    22 C:/grinder/node/lib/metasm/metasm/main.rb
    23 C:/grinder/node/lib/metasm/metasm/encode.rb
    24 C:/grinder/node/lib/metasm/metasm/render.rb
    25 C:/grinder/node/lib/metasm/metasm/decode.rb
    26 C:/grinder/node/lib/metasm/metasm/preprocessor.rb
    27 C:/grinder/node/lib/metasm/metasm/parse.rb
    28 C:/grinder/node/lib/metasm/metasm/exe_format/serialstruct.rb
    29 C:/grinder/node/lib/metasm/metasm/os/main.rb
    30 C:/grinder/node/lib/metasm/metasm/exe_format/main.rb
    31 C:/grinder/node/lib/metasm/metasm.rb
    32 C:/grinder/node/core/configuration.rb
    33 C:/grinder/node/core/logging.rb
    34 C:/Ruby200/lib/ruby/2.0.0/i386-mingw32/digest.so
    35 C:/Ruby200/lib/ruby/2.0.0/digest.rb
    36 C:/Ruby200/lib/ruby/2.0.0/i386-mingw32/digest/sha2.so
    37 C:/Ruby200/lib/ruby/2.0.0/digest/sha2.rb
    38 C:/grinder/node/config.rb
    39 C:/Ruby200/lib/ruby/2.0.0/i386-mingw32/enc/trans/single_byte.so
    40 C:/grinder/node/lib/metasm/metasm/debug.rb
    41 C:/grinder/node/lib/metasm/metasm/cpu/ia32/main.rb
    42 C:/grinder/node/lib/metasm/metasm/cpu/ia32/opcodes.rb
    43 C:/grinder/node/lib/metasm/metasm/cpu/ia32/encode.rb
    44 C:/grinder/node/lib/metasm/metasm/cpu/ia32/parse.rb
    45 C:/grinder/node/lib/metasm/metasm/cpu/ia32/decode.rb
    46 C:/grinder/node/lib/metasm/metasm/cpu/ia32/render.rb
    47 C:/grinder/node/lib/metasm/metasm/parse_c.rb
    48 C:/grinder/node/lib/metasm/metasm/compile_c.rb
    49 C:/grinder/node/lib/metasm/metasm/cpu/ia32/compile_c.rb
    50 C:/grinder/node/lib/metasm/metasm/cpu/ia32/decompile.rb
    51 C:/grinder/node/lib/metasm/metasm/cpu/ia32/debug.rb
    52 C:/grinder/node/lib/metasm/metasm/cpu/ia32.rb

[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.

C:\grinder\node>

Try a different Ruby version? Say 1.9?

Hi, it seems Ruby 2.0.0 segfaults in a non deterministic way. The best solution is to do what @wchen-r7 mentioned and use ruby 1.9.3, so long as you are only fuzzing x86 browsers as ruby 2.0.0 x64 is needed for x64 browsers.

Alternatively, I have just let grinder crash and bring up the instance again and eventually it stays up. Not a great solution but its the only workaround until the ruby 2.0.0 issue is identified and addressed.