Solved

Delphi 4 bug?

Posted on 1998-11-23
6
365 Views
Last Modified: 2010-04-03
Why my open, save and compile doesn't work and sometimes work. I patched my delphi 4 to 4.01, i still get the weird message when i exit delphi. Do i need the patch delphi 4.01 to 4.02.
0
Comment
Question by:mhieta
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 2

Author Comment

by:mhieta
ID: 1347629
Edited text of question
0
 
LVL 3

Expert Comment

by:philipleighs
ID: 1347630
What message?
0
 
LVL 2

Author Comment

by:mhieta
ID: 1347631
Runtime error 216

mhieta
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Expert Comment

by:Yoni
ID: 1347632
I haven't encountered this bug but the only way you can deal with any bugs in delphi is having the most updated version. That is downloading any service pack for Delphi released by Borland
Try it
Yoni
0
 

Accepted Solution

by:
Llysander earned 10 total points
ID: 1347633
Area: compiler\delphi\code generation\optimization
You need to upgrade to SP2.  See fixes document below.

Reference Number: 473 (Published: 10/28/98)

Status: Fixed in Version 4 Update Pack 2
Date Reported: 8/18/98

Severity: Commonly Encountered

Type: Crash

Problem:

The Delphi 3.02 linker is a bit too clever when
removing symbols.

It also has a severe code generation bug (the
compiler may be involved
too - I just don't care, since the net effect is the
same)

In a nutshell, if one tries to FLD (BASM) data that
has been declared
using the absolute directive, then bad code is
generated. This will
make the application crash at runtime with access
violations.

You will get an access violation (in this case a
Runtime Error 216,
otherwise an exception EAccessViolation) on
execution of

    fld test1

This is because the first few lines of assembler code
look like this


  fld test1
0052768C:  DD0502504A30 FLD QWORD PTR
[+02504A30]

  fld test2

00527692:  DD0500528884 FLD QWORD PTR
[+00528884]


[my applications are always based at $500000]
 

First result:
-------------
  Clearly [+02504A30] looks a bit like garbage (and
it is plain
  wrong, of course)... This explains the crash, since
$2504A30
  is way beyond reach for this application.


Second result:
--------------
   Run the code as shown above up to the first FLD
(breakpoint
   or single-step).

   Have tooltip expression or "Evaluate" tell you
that:
      test1  -- > "Symbol was eliminated by linker"
 
 

"Touching" the Constant variable, e.g. Constant[1]
:= 0;, does
apparently make the linker sort of include "test1",
but does _NOT_
remove the crash (!).

Even worse, touching the Test1 variable, e.g.
Test1 := 0;, does not
change this behaviour, either.

The only solution to this problem is to have the
absolute declaration
turned around, e.g.

  Test3: double = 0;
  Constant2: array[1..8] of byte absolute Test3;
Steps:

Found on the delphi.basm newsgroup:

{$A+,B-,C+,D+,E-,F-,G+,H+,I+,J+,K-,L+,M-,N+,O+,P
+,Q+,R+,S-,T+,U-,V+,W-,X+,Y+,Z1}
unit TestMe;

interface

implementation

var
  Constant: array[1..8] of byte;

  Test1: double absolute Constant;
  Test2: double = 0;

procedure RunMe;
asm
  fld test1
  fld test2

  fstp st(0)
  fstp st(0)
end;

initialization

  RunMe;

end.

0
 
LVL 2

Author Comment

by:mhieta
ID: 1347634
Thanks to Llysander and all of you by answered to my question.

mhieta
0

Featured Post

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question