Bug in StackTrace (in both 2.5.9.0 and new 2.5.11.1)

contains all delphi packages mentioned below
Post Reply
apoloziouk
Posts: 9
Joined: Wed Mar 04, 2009 12:52 am

Bug in StackTrace (in both 2.5.9.0 and new 2.5.11.1)

Post by apoloziouk »

Dear Mathias,

I sent you same bug report back in April and looks like this bug still exists in newly released 2.5.11.1
Can you please take a look?

Bug description:
Our main application creates forms from dynamically loaded packages.
When it is time to unload them it runs StackTrace to make sure none of functions/procedures of the loaded form are active.

It works under WinXP but under Win 2000 and Vista stack trace does not see loaded package / class at all.

Steps to reproduce:
1) Compile Host.dproj (we are using Delphi 2009)
2) Run Host.exe
3) Click menu File -> Load Child From BPL
4) Once child form loaded click on button ‘Do Something for 10 seconds’
5) Click menu File -> Exit – it will produce Dialog with Stack Trace
6) Only on Windows XP currently executed procedure TBaseForm.buttonDoSomethingFor10SecsClick will be displayed.

Please see screen shot of WinXP.GIF vs Vista.gif and Win2000.GIF for details.

Windows XP (correct behavior)
http://www.clevercomponents.com/store/alex/WinXP.GIF

Vista (incorrect - not Child.BPL with TBaseForm.buttonDoSomethingFor10SecsClick)
http://www.clevercomponents.com/store/alex/Vista.gif

Please see http://www.clevercomponents.com/store/a ... ostBPL.zip for example sources with screen shots (XP vs 2000 vs Vista).

Thank you,

Alex
madshi
Site Admin
Posts: 10754
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

Hi Alex,

I did this:

(1) downloaded your demo project
(2) started delphi 2009 (all update packs etc installed)
(3) loaded host.dpr, enabled madExcept, compiled, closed project
(4) loaded child.dpk, enabled madExcept, compiled, closed project
(5) copied host.exe, child.bpl, rtl120.bpl and vcl120.bpl into a new folder
(6) copied the new folder to a Windows 2000 VM and ran the demo
(7) copied the new folder to a Windows 7 VM and ran the demo
(8) executed the demo on my XP development PC

The callstack was correct and complete on all XP, 2000 and Windows 7. I'm not sure why things are not working for you. But I cannot reproduce the problem here on my development PC.
apoloziouk
Posts: 9
Joined: Wed Mar 04, 2009 12:52 am

Post by apoloziouk »

madshi wrote:Hi Alex,
The callstack was correct and complete on all XP, 2000 and Windows 7. I'm not sure why things are not working for you. But I cannot reproduce the problem here on my development PC.
I compiled and placed binaries at http://www.clevercomponents.com/store/a ... naries.zip can you please try them?

I tried with enabled/disabled madExcept options but it did not made any difference.
It worked on XP every single time and did not worked on Vista.
We are not using VM can this be a cause?

Tried on several Vista PC's and one Server 2003 - same results (incorrect callstack):(
apoloziouk
Posts: 9
Joined: Wed Mar 04, 2009 12:52 am

Post by apoloziouk »

This is how it look on Vista (TBaseForm.buttonDoSomethingFor10SecsClick missing)
Image
madshi
Site Admin
Posts: 10754
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

Hmmmm... I finally was able to reproduce it, but only on Vista32. It works on 2000, XP, 2003, Vista64, Windows 7 x86, Windows 7 x64. The only OS it fails to work properly on seems to be Vista32. I'll have to do some investigation to find the cause of the issue. Might take a few days...
apoloziouk
Posts: 9
Joined: Wed Mar 04, 2009 12:52 am

Post by apoloziouk »

Matias,

Any updates regarding this bug?

Thank you,
Alex
madshi
Site Admin
Posts: 10754
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

Hi Alex,

sorry for taking so long with this. I've just finally released madCodeHook 3.0, which I've been fighting with for month. So in the next couple of days I should have some time again for working on madExcept, and on the problem reported by you.
apoloziouk
Posts: 9
Joined: Wed Mar 04, 2009 12:52 am

Post by apoloziouk »

Matias,

Thanks for keeping me updated, we will have major release in March and it will be crucial to have this fixed.

Alex
apoloziouk
Posts: 9
Joined: Wed Mar 04, 2009 12:52 am

Post by apoloziouk »

This bug is more than 6 months old now and still no signs of the fix.
madshi
Site Admin
Posts: 10754
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

I'm sorry for the extremely late reply.

I've checked this problem out now. It seems that madExcept's "clever" stack trace filtering is too agressive in this specific case. madExcept goes through the raw call stack and disassembles all functions which are referenced anywhere. Then madExcept checks which function could have called which other function in the callstack etc. Based on this logic madExcept tries to decide which callstack items are likely to be correct and which are likely to be incorrect. It seems that in Vista this logic gets confused by your sample project, for whatever reason.

I'm planning to revisit this whole stack filtering logic for the next major madExcept version. For now changing it would be very difficult without running in danger of breaking it for other cases.

You can work around the issue by setting the "dumbTrace" parameter to "true", when calling "StackTrace". That way the callstack will be much less filtered by madExcept, which means that you'll get a lot more noise in the callstack, but you will also get the missing line in Vista.
apoloziouk
Posts: 9
Joined: Wed Mar 04, 2009 12:52 am

Post by apoloziouk »

I tested on XP/Vista and Windows (all 32 bit) and it works fine.

Thank you.
Post Reply