Am I using dumper.exe correctly?

egor duda
Tue Jan 15 06:31:00 GMT 2002


Tuesday, 15 January, 2002 Jonathan Kamens wrote:

>>  Date: Mon, 14 Jan 2002 21:16:37 +0300
>>  From: egor duda <>
>>  Hmm. Does resulting core dump "looks" ok? it should be elf file of
>>  size 1MB or more.

JK> VOLTRON$ ls -l *.core
JK> -rw-r--r--    1 jik      Administ  1993904 Jan 14 12:49 a.exe.core
JK> -rw-r--r--    1 jik      Administ  4855584 Jan 14 12:50 gdb.exe.core
JK> VOLTRON$ file *.core
JK> a.exe.core:   ELF 32-bit LSB core file of 'n' (signal 6750329), Intel 80386, version 1 (SYSV)
JK> gdb.exe.core: ELF 32-bit LSB core file of 'n' (signal 6750329), Intel 80386, version 1 (SYSV)

>>  Do i remember correctly that gdb crashes even on coredump created
>>  by simple { int* x=0; *x=1; } program?

JK> Yes.

the core file is ok. the crash was triggered by combination of two
factors: bug in gdb, which following patch is supposed to fix, and
change in size of CONTEXT structure. gdb and dumper must be built with
common set of headers in order to interoperate.

can you please try this patch, rebuild gdb, ensuring that it uses
latest w32api headers, and give it a try?

2002-01-15  Egor Duda  <>

        * elf.c (elfcore_grok_win32pstatus): Copy only as much
        information as possible to avoid stack corruption.

Index: elf.c
RCS file: /cvs/uberbaum/bfd/elf.c,v
retrieving revision 1.121
diff -u -p -2 -r1.121 elf.c
--- bfd/elf.c       2002/01/10 23:05:21     1.121
+++ bfd/elf.c       2002/01/15 11:50:18
@@ -6261,5 +6261,5 @@ elfcore_grok_win32pstatus (abfd, note)
     return true;
-  memcpy (&pstatus, note->descdata, note->descsz);
+  memcpy (&pstatus, note->descdata, sizeof (pstatus));
   switch (pstatus.data_type)

Egor.   ICQ 5165414 FidoNet 2:5020/496.19

More information about the Cygwin-developers mailing list