X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=1.0 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Message-ID: <4AE1376B.5010607@gmail.com> Date: Thu, 22 Oct 2009 22:56:11 -0600 From: Chris Perkins User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Novice's stack dump interpretation issues Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com MAIN QUESTION: I can't seem to find any reference to my functions in the stack dump. The range of function addresses in the stack dump is 0x61002F32-0x7C802542 and yet my functions should be somewhere in the 0x00401000-0x004040A5 range (according to objdump and nm). Is this due to the "Error while dumping state"? How can the error be resolved? MINOR QUESTIONS (feel free to ignore): This is my first time looking at a stack dump (only some limited micro-controller assembly experience from many years ago). Am I correct that the "Function" column represents the logical/virtual return address of the next instruction of the function in memory? Am I correct that the "Frame" column represents the logical/virtual address of the function call in the stack? OFF TOPIC QUESTIONS (feel free to ignore): How useful could a stack dump be for diagnostic purposes with functions of dynamically loaded shared libraries (via. dlsym)? Couldn't the function address be potentially different every time the program was executed? REFERENCES: $ objdump -S Main.exe Main.exe: file format pei-i386 Disassembly of section .text: 00401000 <_WinMainCRTStartup>: 401000: 55 push %ebp [... 6907 lines ......................................] 004040a0 <__DTOR_LIST__>: 4040a0: ff (bad) 4040a1: ff (bad) 4040a2: ff (bad) 4040a3: ff 00 incl (%eax) 4040a5: 00 00 add %al,(%eax) ... $ nm -v Main.exe [... 33 lines ...] 00200000 A __size_of_stack_reserve__ 00400000 A ___ImageBase 00400000 A __image_base__ 00401000 t .text 00401000 T _WinMainCRTStartup [... 98 lines .....................] 00404098 t .text 00404098 T __CTOR_LIST__ 00404098 T ___CTOR_LIST__ 004040a0 T __DTOR_LIST__ 004040a0 T ___DTOR_LIST__ [... 182 lines of irrelevant symbols .] $ cat Main.exe.stackdump Stack trace: Frame Function Args 0022C8C8 7C802542 (000007CC, 0000EA60, 000000A4, 0022C910) 0022C9E8 61097F54 (00000000, 7C802600, 7C802542, 000000A4) 0022CAD8 61095AEB (00000000, 003B0023, 00230000, 0022CE68) 0022CB38 61095FCB (0022CB50, 00000000, 00000094, 61020C1B) 0022CBF8 61096182 (00000C54, 00000006, 0022CC28, 61096383) 0022CC08 610961AC (00000006, 0022CE88, 000028D1, 6109A7DF) 0022CC28 61096383 (6110D008, 00405007, 00405000, 00000008) 0022CC58 61001087 (00405000, 00000008, 00405007, 00401065) 0022CCE8 610935A8 (00000001, 6116B6F0, 00660090, 0022CC70) 0022CD98 610060D8 (00000000, 0022CDD0, 61005450, 0022CDD0) 61005450 61004416 (0000009C, A02404C7, E8611021, FFFFFF48) Exception: STATUS_ACCESS_VIOLATION at eip=61016583 eax=EC815356 ebx=61108148 ecx=00000000 edx=57E58959 esi=0000000B edi=00000001 ebp=0065C8B8 esp=0065C8B0 program=c:\[...]\Main.exe, pid 3156, thread sig cs=001B ds=0023 es=0023 fs=003B gs=0000 ss=0023 Stack trace: Frame Function Args 0065C8B8 61016583 (61108148, 6111C19B, FFFFFF48, 00000000) 0065C8D8 610166EC (00000001, 00000000, 00000000, 0065C960) 0065C918 61017FD5 (000007BC, 0065C960, 00000000, 00000000) 0065CC58 61018638 (00000744, 0065CC90, 000000A4, 0065CC8C) 0065CD58 61099F57 (61106F00, 00000000, 00000000, 00000000) 0065CD88 61002F32 (0065CE64, 61018970, 00001074, 00000000) 61003650 61003769 (04A16430, 89000000, FFDA90B0, 24468BFF) 5 [sig] Main 3156 _cygtls::handle_exceptions: Error while dumping state (probably corrupted stack) -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple