Skip to content

Instantly share code, notes, and snippets.

@shirosaki
Created September 18, 2012 14:30
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 shirosaki/3743443 to your computer and use it in GitHub Desktop.
Save shirosaki/3743443 to your computer and use it in GitHub Desktop.
gdb session of ld.exe crash
sh-3.1$ gdb --args ld -shared -s --enable-auto-image-base --enable-auto-import
--out-implib=libmsvcrt-ruby200.dll.a msvcrt-ruby200.def --stack 0x00200000 --en
able-auto-import  dln.o encoding.o version.o array.o bignum.o class.o compar.o
complex.o dir.o dln_find.o enum.o enumerator.o error.o eval.o load.o proc.o fil
e.o gc.o hash.o inits.o io.o marshal.o math.o node.o numeric.o object.o pack.o
parse.o process.o random.o range.o rational.o re.o regcomp.o regenc.o regerror.
o regexec.o regparse.o regsyntax.o ruby.o safe.o signal.o sprintf.o st.o strfti
me.o string.o struct.o time.o transcode.o util.o variable.o compile.o debug.o i
seq.o vm.o vm_dump.o vm_backtrace.o vm_trace.o thread.o cont.o ascii.o us_ascii
.o unicode.o utf_8.o newline.o langinfo.o fileblocks.o crypt.o lgamma_r.o strlc
py.o strlcat.o ffs.o setproctitle.o win32/win32.o win32/file.o  prelude.o dmyex
t.o msvcrt-ruby200.res.o -o msvcrt-ruby200.dll
GNU gdb (rubenvb-4.7.1-2-release) 7.5.50.20120816-cvs
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-w64-mingw32".
For bug reporting instructions, please see:
<mingw-w64-public@lists.sourceforge.net>...
Reading symbols from C:\work\rubyinstaller\sandbox\devkit\mingw\bin\ld.exe...(no
 debugging symbols found)...done.
(gdb) r
Starting program: C:\work\rubyinstaller\sandbox\devkit\mingw\bin\ld.exe -shared
-s --enable-auto-image-base --enable-auto-import "--out-implib=libmsvcrt-ruby200
.dll.a" msvcrt-ruby200.def --stack 0x00200000 --enable-auto-import dln.o encodin
g.o version.o array.o bignum.o class.o compar.o complex.o dir.o dln_find.o enum.
o enumerator.o error.o eval.o load.o proc.o file.o gc.o hash.o inits.o io.o mars
hal.o math.o node.o numeric.o object.o pack.o parse.o process.o random.o range.o
 rational.o re.o regcomp.o regenc.o regerror.o regexec.o regparse.o regsyntax.o
ruby.o safe.o signal.o sprintf.o st.o strftime.o string.o struct.o time.o transc
ode.o util.o variable.o compile.o debug.o iseq.o vm.o vm_dump.o vm_backtrace.o v
m_trace.o thread.o cont.o ascii.o us_ascii.o unicode.o utf_8.o newline.o langinf
o.o fileblocks.o crypt.o lgamma_r.o strlcpy.o strlcat.o ffs.o setproctitle.o win
32/win32.o win32/file.o prelude.o dmyext.o msvcrt-ruby200.res.o -o msvcrt-ruby20
0.dll
[New Thread 1952.0xaec]
Cannot export _stricmp: symbol not defined
Cannot export _strnicmp: symbol not defined

Program received signal SIGSEGV, Segmentation fault.
0x004a0946 in ?? ()
(gdb) bt
#0  0x004a0946 in ?? ()
#1  0x775f3233 in ?? ()
#2  0x65746972 in ?? ()
#3  0xababab00 in ?? ()
#4  0xabababab in ?? ()
#5  0xfeeefeab in ?? ()
#6  0x00000000 in ?? ()
(gdb) x/20i 0x004a0946-40
   0x4a091e:    cmp    $0x5b,%al
   0x4a0920:    pop    %esi
   0x4a0921:    pop    %edi
   0x4a0922:    pop    %ebp
   0x4a0923:    ret
   0x4a0924:    lea    0x0(%esi),%esi
   0x4a092a:    lea    0x0(%edi),%edi
   0x4a0930:    sub    $0x1c,%esp
   0x4a0933:    mov    %esi,0x18(%esp)
   0x4a0937:    mov    0x24(%esp),%esi
   0x4a093b:    mov    %ebx,0x14(%esp)
   0x4a093f:    mov    0x20(%esp),%ebx
   0x4a0943:    mov    %esi,(%esp)
=> 0x4a0946:    call   *(%ebx)
   0x4a0948:    mov    0x28(%esp),%edx
   0x4a094c:    mov    %esi,0x4(%esp)
   0x4a0950:    mov    %ebx,(%esp)
   0x4a0953:    mov    %eax,0x8(%esp)
   0x4a0957:    mov    %edx,0xc(%esp)
   0x4a095b:    call   0x4a0720
(gdb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment