Log On
Embarcadero Home
Watch, Follow, &
Connect with Us
Share This
QualityCentral
Communities
Articles
Blogs
Resources
Downloads
Help
QualityCentral
Delphi-BCB
Compiler
Delphi
Anonymous Methods
BASM
Code Generation/Optimization
Error Recovery
Errors - Warnings
Exceptions
Execution
Finalization
Generics
Header Generation
Interaction with UI
Interfaces
Language
Linker
Make Logic
Memory Manager
OBJ Generation
OBJ Support
Other Compiler
Packages
RTTI
String Resources
TD Debug Info
Thread Local Storage
Version resilience
You are not logged in.
Help
Print
Public Report
Report From:
Delphi-BCB/Compiler/Delphi/Exceptions
[ Add a report in this area ]
Report #:
107209
Status:
Open
An external exception raised inside a DLL may modify the FPU control word
Project:
Delphi
Build #:
16.0.4504.48759
Version:
16.4
Submitted By:
Pierre le Riche
Report Type:
Crash / Data loss / Total failure
Date Reported:
7/18/2012 12:31:15 PM
Severity:
Serious / Highly visible problem
Last Updated:
7/19/2012 12:46:02 AM
Platform:
All platforms
Internal Tracking #:
30115
Resolution:
None
(Resolution Comments)
Resolved in Build:
:
None
Duplicate of:
None
Voting and Rating
Overall Rating:
No Ratings Yet
0.00 out of 5
Total Votes:
20
Description
If an external exception is raised inside a DLL, then the FPU control word may be modified. This is because of the calls to _FpuInit inside the exception processing code in system.pas and the fact that the value of Default8087CW in the DLL may not be the same as the Default8087CW in the main application.
See the attached test case for an example.
Steps to Reproduce:
1) Compile the test DLL
2) Compile and run the two test applications (static and dynamic loading)
Expected: Both tests pass
Actual: Both tests fail
[TestDLL.dpr]
------------------------------
library TestDLL;
uses
SysUtils,
Classes;
{$R *.res}
procedure DLLTestProc;
begin
try
PInteger(0)^ := 0;
except
end;
end;
exports
DLLTestProc;
begin
end.
------------------------------
[StaticLoadTest.dpr]
------------------------------
program StaticLoadTest;
{$APPTYPE CONSOLE}
uses
SysUtils, Windows;
const
DLLName = 'TestDLL.dll';
DLLTestProcName = 'DLLTestProc';
procedure DLLTestProc; external DLLName name DLLTestProcName;
function RunTest: Boolean;
var
LOldCW, LNewCW: Word;
begin
LOldCW := Get8087CW;
DLLTestProc;
LNewCW := Get8087CW;
Result := LOldCW = LNewCW;
end;
begin
if RunTest then
WriteLn('PASS')
else
WriteLn('FAIL');
end.
------------------------------
Workarounds
None
Attachment
QC107209.zip
Comments
Tomohiro Takahashi at 7/19/2012 5:52:26 PM
-
This report was opened with valid Internal Tracking Number.
Thanks.
View Your Reports
Search
Server Response from: ETNACODE01
Developer Tools
Blackfish SQL
C++Builder
Delphi
FireMonkey
Prism
InterBase
JBuilder
J Optimizer
HTML5 Builder
3rdRail & TurboRuby
Database Tools
Change Manager
DBArtisan
DB Optimizer
ER/Studio
Performance Center
Rapid SQL
Technical Articles
Tutorials
White Papers
Press Releases
Newsletters
Add Content (GetPublished)
Audio
Audio & Video
Video
Bugs & Suggestions (QualityCentral)
Discussion Forums
Examples (CodeCentral)
Tags
Technology Partners
Downloads
Free Trials
Registered User Downloads
Beta Programs
Add Content (GetPublished)
Articles
Blogs
Bugs & Suggestions (QualityCentral)
Discussion Forums
Examples (CodeCentral)
Member Services
About
Connect with Us