Project JEDI - Issue Tracker
Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0005282 [Code Library] JclDebug* minor always 2010-07-21 09:07 2010-09-02 16:33
Reporter SurFan View Status public  
Assigned To outchy
Priority normal Resolution fixed  
Status resolved   Product Version Version 2.2
Summary 0005282: ExceptDlg does not work if app is compiled with package vcl and bounds-checking on (with solution)
Description During the display of the exception Dialog stack trace, you'll get various errors depending on the project you use. Sometimes "Out of Memory" exception is thrown, often a "ListIndex out of bounds (2)"
Additional Information Steps to reproduce:
- Create a one-line project that simply throws an exception
- Put exceptdlg in the uses of the project
- verify that vcl60.map is in the same directory as vcl60.bpl
- compile with runtimepackages (at least with vcl) and bounds-checking on

cause of the problem:
The statement in line 1419ff of Jcldebug: "Result := Result * 16" throws an Integer Overflow error (compiler bug?), if the result*16 is bigger than $7FFFFFFF.
Sadly the procedure "TLSLast" in vcl starts at offset "BFF36010" thus an error is thrown.
Now JclDebug intercepts and the recursion is perfect! The list index out of bounds comes from line 4832 of jcldebug, because while processing the IntegerOverflow exception, the original stacklist gets freed in line 4294, because it has the same Id and classname as the one that's been newly created by the IntegerOverflow exception, thus leading to use a freed object in TJclStackInfoList.addstrings (the "i" is now undefined!)

Solution:
replace "result := result * 16" by "result := result shl 4", and everything works as expected

Consideration:
Recursion in exception handling in Jcldebug should be taken care of by the JclDebug-Code

Tags No tags attached.
Fixed in revision 3307
IDE version Delphi 6
Attached Files

- Relationships

-  Notes
(0017570)
outchy (administrator)
2010-08-12 14:13

I applied a different patch in revision 3225.

http://jcl.svn.sf.net/viewvc/jcl/trunk/jcl/source/windows/JclDebug.pas?r1=3224&r2=3225 [^]

Basically, the result of ReadHexValue should be unsigned. However, I'll change the code to use "shl 4 or something", this is much better than "* 16 + something".

Committed in revision 3307.

- Issue History
Date Modified Username Field Change
2010-07-21 09:07 SurFan New Issue
2010-07-21 09:07 SurFan IDE version => Delphi 6
2010-08-12 14:13 outchy Note Added: 0017570
2010-08-12 14:13 outchy Assigned To => outchy
2010-08-12 14:13 outchy Status new => feedback
2010-09-02 16:33 outchy Fixed in revision => 3307
2010-09-02 16:33 outchy Status feedback => resolved
2010-09-02 16:33 outchy Fixed in Version => Version 2.2
2010-09-02 16:33 outchy Resolution open => fixed


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker