Solved

Finding Access Violation & Abstract Error

Posted on 2002-03-13
12
358 Views
Last Modified: 2010-04-05
Hi, i have a big problem.
Sometimes i get AV and Abstract Error !
i don't know why, where and how !

the debug show in unit form :

function StdWndProc(Window: HWND; Message, WParam: Longint;
  LParam: Longint): Longint; stdcall; assembler;
asm
        XOR     EAX,EAX
        PUSH    EAX
        PUSH    LParam
        PUSH    WParam
        PUSH    Message
        MOV     EDX,ESP
        MOV     EAX,[ECX].Longint[4]
        CALL    [ECX].Pointer
        ADD     ESP,12            <<--- Here i get the error
        POP     EAX
end;

How can i find out where i made a mistake ?

Thanxs in advance !
Andi
0
Comment
Question by:WinTrans2000A
12 Comments
 
LVL 11

Expert Comment

by:robert_marquardt
ID: 6860060
Where does the ECX value come from?
0
 

Author Comment

by:WinTrans2000A
ID: 6860071
i don't know !
This is not a function of mine, its from delphi (it's in the forms.pas file)
0
 
LVL 3

Expert Comment

by:marcoszorrilla
ID: 6860236
XOR     EAX,EAX
       PUSH    EAX
       PUSH    LParam
       PUSH    WParam
       PUSH    Message
       MOV     EDX,ESP
       MOV     EAX,[ECX].Longint[4]
       CALL    [ECX].Pointer
       ADD     ESP,12            <<--- Here i get the error
       POP     EAX

Are you sure that ESP exist
I think you are referring to SP and not to ESP.
SP is the Stack Pointer.

bye
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 

Author Comment

by:WinTrans2000A
ID: 6860251
@marcoszorilla
This is not a function which i has written, it is from delphi (in forms.pas)
0
 
LVL 14

Expert Comment

by:DragonSlayer
ID: 6863239
perhaps you should do a stack trace and see what procedures are called before this? perhaps some earlier procedures messed up the registers? Just a thought...
0
 
LVL 6

Expert Comment

by:zebada
ID: 6863822
Maybe this will help:
You will get this error if your derived class, which implements its ancestor's abstract method, calls "inherited" as there is no ancestor method to be called - because it is abstract.

Regards
Paul
0
 
LVL 6

Expert Comment

by:zebada
ID: 6863827
One more thing:
What really bugs me is that Delphi's code generator (Ctrl-Shift-C) incorrectly inserts the "inherited" keyword into the method body even though it "knows" the method is an implementation of an abstract method. aaaarrrrrgggghhhhh.

Paul
0
 

Author Comment

by:WinTrans2000A
ID: 6863831
@zebada: This function is (it seems so) the Standard Windows Proc, which is executed for every Windows Message. I know what a abstract error is, but how can i find the code line where this error occures ?

@DragonSlayer
How do this work with the Stack Trace ?
0
 
LVL 20

Expert Comment

by:Madshi
ID: 6864838
Hi WinTrans,

the real problem is surely not in that Delphi function, because normally this Delphi function works just fine. It must be somewhere else. Unfortunately AV exceptions are often hard to find...   :-(

If you can reproduce the error inside of the IDE, you can look at the callstack (see Delphi menu). If you can only reproduce the error outside of the IDE, you might want to try an advanced exception handling package. E.g. the one from Jedi or mine (free for non-commercial usage):

http://help.madshi.net/Data/madExcept.htm

Regards, Madshi.
0
 

Expert Comment

by:CleanupPing
ID: 9343275
WinTrans2000A:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
LVL 7

Expert Comment

by:knightmad
ID: 9470751
Wow, Its been a long time since this comment have been visited!

WinTrans2000A,
No comment has been added lately (19 days), so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area for this question:

RECOMMENDATION: PAQ/No Refund

-- Please DO NOT accept this comment as an answer ! --

Thanks,

knightmad
EE Cleanup Volunteer

Remember you (all) can object this recommendation if you disagree, just leave a post here explaining why are you objecting and what should be done instead.
Within 7 days probably this thread will be closed, so, hurry up! : )
0
 

Accepted Solution

by:
YensidMod earned 0 total points
ID: 9536792
This question is PAQed and no points refunded (of 100)

YensidMod
Community Support Moderator
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question