Expert opinion needed: Delphi bug or what?
From: Eden Kirin (eden_MAKNIOVO_at_cvs.hr)
Date: 11/10/03
- Next message: Rob Kennedy: "Re: Expert opinion needed: Delphi bug or what?"
- Previous message: Bjørge Sæther: "Re: Array assignment"
- Next in thread: Rob Kennedy: "Re: Expert opinion needed: Delphi bug or what?"
- Reply: Rob Kennedy: "Re: Expert opinion needed: Delphi bug or what?"
- Reply: The Half A Wannabee: "Re: Expert opinion needed: Delphi bug or what?"
- Reply: Sander Martens: "Re: Expert opinion needed: Delphi bug or what?"
- Reply: Bruce Roberts: "Re: Expert opinion needed: Delphi bug or what?"
- Reply: Eden Kirin: "Re: Expert opinion needed: Delphi bug or what?"
- Reply: khaldi dhia: "Re: Expert opinion needed: Delphi bug or what?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 10 Nov 2003 13:32:36 +0100
Hello.
I need an expert opinion in my issue. I work on somewhat bigger project
(>1MB .pas files). In some moment, after i wrote and added new unit to
project (this unit contains only some class definitions) and using it from
one of my units, program failed to start, in the unit initialization par,
*before* my application code, before the code in the dpr file.
Looking at the Call Stack, i put breakpoint in InitUnits function:
SqlTimSt
InitUnits
@StartExe(???,???)
@InitExe(???)
App.exe
When I press F7, it goes to the SqlTimSt initialization part:
initialization
SQLTimeStampVariantType := TSQLTimeStampVariantType.Create;
When I press F7, it is in Variants unit:
constructor TCustomVariantType.Create;
begin
Create(LNextVarType);
After F7, it calls following constructor (RequestedVarType=271):
constructor TCustomVariantType.Create(RequestedVarType: TVarType);
var
LSlot, LWas, LNewLength, I: Integer;
begin
inherited Create;
EnterCriticalSection(LVarTypeSync);
try
LSlot := RequestedVarType - CMinVarType;
if (LSlot < 0) or (RequestedVarType < CFirstUserType) then
raise EVariantError.CreateFmt(SVarTypeOutOfRangeWithPrefix,
[HexDisplayPrefix, RequestedVarType]);
LWas := Length(LVarTypes);
if LSlot >= LWas then
begin
LNewLength := ((LSlot div CIncVarType) + 1) * CIncVarType;
if LNewLength > CMaxVarType then
raise EVariantError.Create(SVarTypeTooManyCustom);
SetLength(LVarTypes, LNewLength);
In the last line (SetLength) i press F7 and it goes to System unit:
procedure _DynArraySetLength;
asm
PUSH ESP
ADD dword ptr [ESP],4
CALL DynArraySetLength
After F7, it calls DynArraySetLength:
procedure DynArraySetLength(var a: Pointer; typeInfo: Pointer; dimCnt:
Longint; lengthVec: PLongint);
30, 40 lines below:
// If the heap object isn't shared (ref count = 1), just resize it.
Otherwise, we make a copy
if (p = nil) or (PLongint(p)^ = 1) then
begin
pp := p;
if (newLength < oldLength) and (typeInfo <> nil) then
FinalizeArray(PChar(p) + Sizeof(Longint)*2 + newLength*elSize,
typeInfo, oldLength - newLength);
ReallocMem(pp, neededSize);
When it reaches ReallocMem(pp=nil, neededSize=128), it calls
MemoryManager.GetMem and when I run it further (F9), application raises
error: Project App.exe faulted with message 'access violation at xxx: write of
address xxxx', with debugger positioned on System.LoadResString.
Just for the record, I noticed that application sometimes used to behaive
this way after rebuilding the whole project. After this, when code of the
main unit changed and partially compiling it, application worked.
At this moment, I can't make it work. When this "invalid" exe is started
outside of Delphi IDE, nothing happens. Application doesn't start, no error
message is displayed.
I use few little 3rd party components and TB2k. I searched JGSoftware news
server to see if anyone has similar problems, but I haven't found any.
The application is compiled with Delphi7. I compiled it with Delphi6 also,
and the problem remains.
Any help is appreciated. I don't know what to do with it. It seems absurd
and unlogical.
Eden
- Next message: Rob Kennedy: "Re: Expert opinion needed: Delphi bug or what?"
- Previous message: Bjørge Sæther: "Re: Array assignment"
- Next in thread: Rob Kennedy: "Re: Expert opinion needed: Delphi bug or what?"
- Reply: Rob Kennedy: "Re: Expert opinion needed: Delphi bug or what?"
- Reply: The Half A Wannabee: "Re: Expert opinion needed: Delphi bug or what?"
- Reply: Sander Martens: "Re: Expert opinion needed: Delphi bug or what?"
- Reply: Bruce Roberts: "Re: Expert opinion needed: Delphi bug or what?"
- Reply: Eden Kirin: "Re: Expert opinion needed: Delphi bug or what?"
- Reply: khaldi dhia: "Re: Expert opinion needed: Delphi bug or what?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|