Subject: RE: Exception trapped!
From: [email-masked] (Colin Peters)

30 Jun 1997 20:57:42 -0700
Approved: [email-masked]
Distribution: cygnus
Message-ID: <01BC861A.5711FE80.cygnus.gnu-win32@gbird0>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Original-To: "'Berenice LOPEZ'" <[email-masked]>
Original-Cc: "'GNU-Win32'" <[email-masked]>
Original-Sender: [email-masked]

Berenice LOPEZ[SMTP:[email-masked]] wrote:
>    Hi, it's me again...
>    Now, I got my sotfware to compile, but when I execute it... I get
>this:
>
>bash$ paros rome.ico
>(C:\PAROS\paros.exe 1003) In cygwin_except_handler
>(C:\PAROS\paros.exe 1003) Exception trapped!
>(C:\PAROS\paros.exe 1003) exception C0000005 at 6E6962
>(C:\PAROS\paros.exe 1003) exception: ax 6E6962 bx 255F32C cx A000724 dx
>2FC2810
>(C:\PAROS\paros.exe 1003) exception: si 4F551C di 4F5134 bp 255D47C sp
>255D468
>(C:\PAROS\paros.exe 1003) exception is: STATUS_ACCESS_VIOLATION
>(C:\PAROS\paros.exe 1003) Stack trace:
>(C:\PAROS\paros.exe 1003) frame 0: sp = 0x255D29C, pc = 0x1000CEAA
>(C:\PAROS\paros.exe 1003) frame 1: sp = 0x255D2B8, pc = 0x77F94072
>(C:\PAROS\paros.exe 1003) frame 2: sp = 0x255D2DC, pc = 0x77F88A53
>(C:\PAROS\paros.exe 1003) frame 3: sp = 0x255D368, pc = 0x77F75E82
>(C:\PAROS\paros.exe 1003) frame 4: sp = 0x255D47C, pc = 0x523429
>(C:\PAROS\paros.exe 1003) frame 5: sp = 0x255D494, pc = 0x4BDD11
>(C:\PAROS\paros.exe 1003) frame 6: sp = 0x255D520, pc = 0x4D98A0
>(C:\PAROS\paros.exe 1003) frame 7: sp = 0x255D650, pc = 0x4F6CC0
>(C:\PAROS\paros.exe 1003) frame 8: sp = 0x255F3B0, pc = 0x4015BE
>(C:\PAROS\paros.exe 1003) frame 9: sp = 0x255F524, pc = 0x1000C0EA
>(C:\PAROS\paros.exe 1003) frame 10: sp = 0x255FF94, pc = 0x1000C0FB
>(C:\PAROS\paros.exe 1003) frame 11: sp = 0x255FFA0, pc = 0x5343C9
>(C:\PAROS\paros.exe 1003) frame 12: sp = 0x255FFB0, pc = 0x40103B
>(C:\PAROS\paros.exe 1003) frame 13: sp = 0x255FFC0, pc = 0x77F1AFC1
>(C:\PAROS\paros.exe 1003) frame 14: sp = 0x255FFF0, pc = 0x0
>(C:\PAROS\paros.exe 1003) End of stack trace
>bash$
>
>    the executable is :
>
>-rwxrwxrwx   1 0        everyone  1585645 Jun 30 13:26 Paros.exe
>

I don't have much to offer here except to point out that a STATUS
ACCESS VIOLATION usually means your program has accessed a pointer
that is not properly initialized. This happens a fair bit if you
are writing new code (or even messing around with old code). Even
experienced programmers mess up their pointer arithmetic sometimes.
That would definitely be the first possibility I would check.

If you were compiling under an ordinary Win32 compiler you would
get a "This program has performed an illegal instruction" (or
something like that) dialog, and you could find at least some
of the details given above by clicking on the "Details" button.
However, Cygwin32 installs it's own exception handler.

From looking at the above stack trace, if I understand it correctly,
the last stack frame has a program counter (pc) of zero, which would
certainly cause an access violation. It looks like your code (at
address 0x40103B calls some system code at 0x77F1AFC1 which then
attempts to call NULL as a function. You aren't, by any chance,
calling a function which takes a callback pointer?

The above paragraph goes out the window if I'm not reading the
stack trace correctly though.

Anyway, to do a real diagnosis people need to have more information
than that. Do some debugging (with gdb and/or with debugging printf
statements and the like) and find out things like: Is the exception
happening before your code even starts (in the startup code) or
somewhere within your code? What function is being called that leads
to the exception? Can you strip down your program to a reasonably
small source code example that causes the exception (probably not
given the size of your exe, but...)? Can you at least show the
source code surrounding the point where the exception occurs?

Just my thoughts,

Colin.

-- Colin Peters - Saga Univ. Dept. of Information Science
-- [email-masked] - finger for PGP public key
-- http://www.fu.is.saga-u.ac.jp/~colin/index.html
-- http://www.geocities.com/Tokyo/Towers/6162/

-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".