From: Keetnet AT wilmington DOT net (Keet / Foxbird) Subject: SIGSEGV and memory (was: Strange goings on) 10 Mar 1998 23:02:01 -0800 Message-ID: <3.0.32.19980310202332.007af100.cygnus.gnu-win32@wilmington.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" To: Sergey Okhapkin , "gnu-win32 AT cygnus DOT com" At 11:07 AM 3/10/98 +0300, Sergey Okhapkin wrote: >Trap is somewhere in newlib's code. For example, string manipulation >functions may trap when NULL pointer is passed as an argument. Check it! >Gdb's "backtrace" command will help you. Okay, I decided to try this thing out again, and for some odd reason the windowed version of GDB freezes.. so I ran the console version and got the program running and hit SIGSEGV again in the _size_of_stack_reserve__ () function.. so I did backtrace and bt and everything else I could think of and I get: #0 0x10047c70 in _size_of_stack_reserve__ () Cannot access memory at address 0x2000000. So appearently there isn't much more to go on than that. From B18, I get the following info in response to my 'invalid file format' and this might explain some of it: The executable you sent me has a bss section (unitialized data) size of 3,523,560 bytes. This seems huge. Is your program using all that static data as uninitialized arrays? In any case, windows gets confused, because the extended header tells it that the heap reserve size is only 1,048,576 (1MB) standard size. Maybe the reason for this problem is that the linker doesn't extend the size of the heap reserve size to the sum of the bss +data sections. Your initialized data section is small (5K or so). I cc this message to Ian Taylor at cygnus. He will be more able to see why this link is failing. Appended is the description of the executable as given by my tools: Dump of file XSW.EXE (420119 bytes) File Header Machine: 014C (i386) Number of Sections: 6 TimeDateStamp: 34F364F3 (Wed Feb 25 01:25:23 1998) PointerToSymbolTable: 00379904 NumberOfSymbols: 00001806 String Table File Offset 412412 SizeOfOptionalHeader: 00E0 Characteristics: 0107 RELOCS_STRIPPED EXECUTABLE_IMAGE LINE_NUMS_STRIPPED 32BIT_MACHINE Optional Header Magic 0x10b 267 linker version 2.55 size of code 0x58E00 364032 size of initialized data 0x2200 8704 size of uninitialized data 0x35C400 3523584 entrypoint RVA 0x1000 4096 base of code 0x1000 4096 base of data 0x5A000 368640 image base 0x400000 4194304 section align 0x1000 4096 file align 0x200 512 required OS version 4.00 image version 1.00 subsystem version 4.00 Win32 Version 0x0 size of image 0x3BC000 3915776 size of headers 0x400 1024 checksum 0x0 Subsystem 0x3 (Windows character) DLL flags 0x0 stack reserve size 0x2000000 33554432 stack commit size 0x1000 4096 heap reserve size 0x100000 1048576 <<<<+++ p* sm# / /---------------------------------------------/ - For help on using this list (especially unsubscribing), send a message to "gnu-win32-request AT cygnus DOT com" with one line of text: "help".