GetCrashStackTrace/GetThreadStacktrace do not work in x64

delphi package - automated exception handling

GetCrashStackTrace/GetThreadStacktrace do not work in x64

Postby car_hack89 » Sat Apr 14, 2018 6:56 pm

Hello,

The functions "madExcept.GetCrashStackTrace()" and "madExcept.GetThreadStacktrace()" do not return the callstack, return empty string.

My application is 64 bits, written in Delphi and developed in XE7. I am using the MadExcep 4.0.19 (Single Developer Edition).

If the application generates it in 32 bits, the functions work correctly returning the callstack.

Thanks in advance.
car_hack89
 
Posts: 10
Joined: Tue Mar 27, 2018 1:30 am

Re: GetCrashStackTrace/GetThreadStacktrace do not work in x6

Postby madshi » Tue Apr 17, 2018 2:41 pm

Two questions:

1) GetCrashStackTrace() is only supposed to be called from within a try..except block. Is that how you've called it in x64?
2) Do you have madExcept fully enabled (in the "madExcept settings..." dialog) and compiled the EXE within the IDE?

GetThreadStacktrace() is problematic in x64, that's a known problem. I'm calling OS APIs in this case, and they don't seem to work well, for some reason I can't manage to figure out. You can workaround it by raising a dummy exception in a try..except block like this:

Code: Select all
try
  raise Exception.Create('dummy');
except
  currentThreadStackTrace := GetCrashStackTrace();
end;
madshi
Site Admin
 
Posts: 9618
Joined: Sun Mar 21, 2004 5:25 pm

Re: GetCrashStackTrace/GetThreadStacktrace do not work in x6

Postby car_hack89 » Tue Apr 17, 2018 6:27 pm

Hello,

1) GetCrashStackTrace() is only supposed to be called from within a try..except block. Is that how you've called it in x64?


GetCrashStackTrace/GetThreadStacktrace uses them without try..except, and in both x86 and x64 the code is the same.

2) Do you have madExcept fully enabled (in the "madExcept settings..." dialog) and compiled the EXE within the IDE?


I have full enabled madExcept, and my application compiled it with the IDE.

And yes for the moment I solved it with a fictitious exception:

Code: Select all
try
    raise Exception.Create ('Some error message');
except on E: Exception do
    sCurrentStackTrace: = E.StackTrace;
end;


This solution is not optimal, so I asked if there was any way.
car_hack89
 
Posts: 10
Joined: Tue Mar 27, 2018 1:30 am

Re: GetCrashStackTrace/GetThreadStacktrace do not work in x6

Postby madshi » Tue Apr 17, 2018 6:29 pm

Not atm.
madshi
Site Admin
 
Posts: 9618
Joined: Sun Mar 21, 2004 5:25 pm


Return to madExcept

Who is online

Users browsing this forum: No registered users and 5 guests