Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/Compiler/Delphi    [ Add a report in this area ]  
Report #:  122600   Status: Closed
[Win64] Application crach on run if including .pas file which contains linitialization section
Project:  C++Builder Build #:  19.0.14356.6604
Version:    19.2 Submitted By:   Dmitry Nikolaenko
Report Type:  Crash / Data loss / Total failure Date Reported:  2/19/2014 8:12:38 AM
Severity:    Infrequently encountered problem Last Updated: 4/15/2014 6:16:36 PM
Platform:    All versions Internal Tracking #:   47825
Resolution: Fixed (Resolution Comments) Resolved in Build: : XE6
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: None
Description
Application crach on run if including .pas file which contains linitialization section

[Unit1.pas]
----------
unit Unit1;

interface

uses
  SysUtils;

implementation

var
  b: TBytes;

initialization
  SetLength(b, 1);

end.
----------
Steps to Reproduce:
1. Try to run the attached sample for Win64

2. Access Violation occurs at startup

[Unit1.pas]
-----
...
var
  b: TBytes;
initialization
  SetLength(b, 1);
end.
-------

[System.pas]
-------
...
procedure DynArraySetLength(var a: Pointer; typeInfo: Pointer; dimCnt: NativeInt; lengthVec: PNativeint);
...
  Inc(PByte(typeInfo), PDynArrayTypeInfo(typeInfo).name);
...
-------
Workarounds
None
Attachment
C++Win64Buggg.zip
Comments

Tomohiro Takahashi at 2/19/2014 4:45:35 PM -
Could you tell us more detail about the crash in order to verify/open/track your case more property?

> Platforms: Win 64 bit
Does your issue occur witn 64bit app?

Tomohiro Takahashi at 2/19/2014 4:45:46 PM -
Is your issue related to 'Unit1.pas' in C++Builder project?

[Unit1.pas]
----------
unit Unit1;

interface

uses
  SysUtils;

implementation

var
  b: TBytes;

initialization
  SetLength(b, 1);

end.
----------

Dmitry Nikolaenko at 2/20/2014 12:08:10 AM -
This issue is about AV on SetLength of a global variable with the TBytes data type in the INITIALIZATION or FINALIZATION section in a PAS file that was added to a Win64 C++Builder project.

Server Response from: ETNACODE01