| Anonymous | Login | Signup for a new account | 2010-09-09 13:03 CEST |
| Main | My View | View Issues | Change Log | Roadmap | Docs |
| Viewing Issue Simple Details [ Jump to Notes ] | [ View Advanced ] [ Issue History ] [ Print ] | |||||||||||
| ID | Category | Severity | Reproducibility | Date Submitted | Last Update | |||||||
| 0005015 | [Code Library] JclDebug* | major | always | 2009-11-12 15:00 | 2010-07-21 09:21 | |||||||
| Reporter | hardy | View Status | public | |||||||||
| Assigned To | ||||||||||||
| Priority | normal | Resolution | open | |||||||||
| Status | feedback | Product Version | Version 2.1 | |||||||||
| Summary | 0005015: first line of stack list details generated only, debug report is not complete | |||||||||||
| Description |
There is "List index out of bounds (1)" error in TJclStackInfoList.AddToStrings method, line 4773 in JCLDebug.pas Strings.Add(GetLocationInfoStr(Items[I].CallerAddr, IncludeModuleName, IncludeAddressOffset, IncludeStartProcLineOffset, IncludeVAddress)); |
|||||||||||
| Additional Information |
When debugging this place, the first loop execution of Strings.Add is fine, and yields error next time. TJclStackInfoList.Count suddenly drops to zero, so Items[1] is out of bounds. So, first line of stack list details is generated only: Stack list, generated 12.11.2009 16:47:08 (00064859){ExceptDlgDebug2.exe} [00465859] And debug report is not written to logfile. Also checked against daily zip jcl-2.2.0.3541.7z I've made a test project to see that. |
|||||||||||
| Tags | No tags attached. | |||||||||||
| Fixed in revision | ||||||||||||
| IDE version | Delphi 7 | |||||||||||
| Attached Files |
|
|||||||||||
|
|
||||||||||||
Notes |
|
|
(0016869) hardy (reporter) 2009-11-12 15:19 edited on: 2009-11-12 15:51 |
Checked against JCL 2.0.1 b3449 - complete debug report generated (filename_b3449_rev2968.log). So 87 builds between 3449 and 3536. It takes time to find which build introduced error. Should use dichotomy for that :) Any help appreciated! |
|
(0016870) hardy (reporter) 2009-11-12 16:01 |
Now I know from http://jcl.svn.sourceforge.net/viewvc/jcl/trunk/jcl/source/windows/JclDebug.pas?view=log [^] that - until rev.3046 report generated completely - there were "Integer overflow error" in revisions 3047 and 3056 - starting from rev.3063 the error is "List index out of bounds (1)" Checked against JCL 2.0.1 b3449, changed only JCLDebug.pas Please help me with this bug! |
|
(0016875) Cyrus (reporter) 2009-11-14 19:30 |
Have you tried latest SVN revision of JCL? Which options you did choose when you created JCL exception dialog using its IDE wizard? I'm using Delphi 7.1 Personal (Build 8.1) with SVN revision 3079 of JCL and I can't make this error to appear at all. Even if I use your attached source files. |
|
(0016876) Cyrus (reporter) 2009-11-14 19:53 |
Ahh, now I can see it. Looks like it only happens when you debug your program line by line under IDE. |
|
(0016877) Cyrus (reporter) 2009-11-14 20:10 edited on: 2009-11-14 20:18 |
Exception "Integer overflow" happens at line 1672 inside unit JclDebug (JclDebug.pas revision 3064). After that follows exception "List index out of bounds (1)" at line 4773. So only exception "List index out of bounds (1)" is seen inside IDE when debugging. Excerpt from JclDebug.pas revision 3064: function TJclMapScanner.AddrToVA(const Addr: DWORD): DWORD; begin // MAP file format was changed in Delphi 2005 // before Delphi 2005: segments started at offset 0 // only one segment of code // after Delphi 2005: segments started at code base address (module base address + $10000) // 2 segments of code if (Length(FSegmentClasses) > 0) and (FSegmentClasses[0].Addr > 0) and (Addr > 0) then // Delphi 2005 and later // The first segment should be code starting at module base address + $10000 // Cyrus : Exception "Integer overflow" happens here. Strangely, comments indicate that this portion of code should execute only when Delphi 2005 or later is used. Result := Addr - FSegmentClasses[0].Addr else // before Delphi 2005 Result := Addr; end; EDIT : Wrong exception reported. Added more info. |
|
(0016878) Cyrus (reporter) 2009-11-14 20:33 |
Looks like that when you use debug version of JclDebug unit this bug surfaces. Maybe bug in Delphi 7.1 compiler? hardy : Try to disable "Use debug DCUs" in project options and then recompile and run your attached example project to see if this bug shows up again. |
|
(0016879) Cyrus (reporter) 2009-11-14 20:53 |
hardy : You need to disable both "Range checking" and "Overflow checking" in your attached example project options to squash this bug. You don't need to disable "Use debug DCUs" option at all. |
|
(0016880) Cyrus (reporter) 2009-11-14 21:13 |
Looks like that I have nailed it down. Attached diff patch for JclDebug.pas revision 3064. |
|
(0016881) hardy (reporter) 2009-11-14 22:48 |
Thank you Cyrus for tracking bug down! I've used Delphi 7.1 with released JCL 2.1.1 b3536 when stack with bug. And with daily jcl zip same bug happened. Didn't use JCL Debug dialog wizard, but New, Dialogs, Exception dialog. You are right, finally (eh, 2 days ago) I've noticed that "use debug .dcus" option enabled and switched it off. I prefer not to turn off "Range checking" and "Overflow checking" options, because bugs may pass unnoticed. Also log for JCLDebug rev.3047 states "Do not disable overflow and range checks in unit JclDebug.pas." and two later log records are about range checking. I assume some work is going on this. And yes, only switching both "Range checking" and "Overflow checking" eliminates this bug, and "Use debug DCUs" don't do anything. Thease are for Delphi 7. Strangely, couldn't reproduce the bug with Delphi 2010 Update1, released JCL and JCLDebug rev.3064. And it not depends if "Range checking", or "Overflow checking", or "use debug .dcus" switched on or off. Shall wait for your diff patch applied to JclDebug.pas, so turned of checks for now. |
|
(0016907) outchy (administrator) 2009-11-25 22:26 |
Hardy, Can you attach the MAP file of the project having this issue? Your patch hides the overflow issue, but it does not make it solved. I need some deeper investigations with MAP file addresses. |
|
(0017001) hardy (reporter) 2009-12-17 09:03 |
Sorry being silence for so long. ExceptDlgDebug2_exe_map.rar contains both exe and map files compiled against JclDebug.pas rev.3064. I believe ExceptDlgDebug2.dof contains the options for this compilation. Didn't try with the latest JclDebug.pas rev.3089. Waiting for your directions. |
|
(0017540) SurFan (reporter) 2010-07-21 09:21 |
Hi, probably same error as mine in 0005282, try replacing "result := result * 16" by "result := result shl 4" in function ReadHexValue at line 1419 ff in jcldebug.pas |
| Mantis 1.1.6[^] Copyright © 2000 - 2008 Mantis Group |