PDA

View Full Version : Strange Bug


Sam
11-Dec-2008, 05:01 PM
In Delphi 5 iīve tried the following:
New Project, Button on Form:


procedure TForm1.Button1Click(Sender: TObject);
var
test: TSTringList;
begin
test.Add('test');
end;


Eureka doesnīt catch this exception. Without eureka delphi raises an exception.
Any ideas?

admin
11-Dec-2008, 07:04 PM
Hi Sam,

it's really strange.

What EurekaLog version do you used?

Sam
11-Dec-2008, 10:15 PM
Hi, Iīve downloaded the current trial version today and it was the first thing, I tried out to generate an exception. I was a little bit consused about that, but other exceptions are catched by Eureka.
Itīs really strange.

When I add the line


test.clear;


then the exception raises.

admin
12-Dec-2008, 11:30 AM
Hi Sam,

this can be only a random memory assignment problem.

This because you are using a not assigned object so is possible it is pointing to a valid memory location with some valid code.

Try to simple add a break-point on the "test.Add('test');" line and to follow it on the "CPU Window" with the F7 key (step by step).

Sam
12-Dec-2008, 12:23 PM
Hi,

might be possible, that this is a valid memory problem. But I can reproduce the error every time, even after restarting computer.
And why does Delphi raises the exception and other debugging tools like madexcept, too?
I can send you a compiled file with and without eureka, if this helps...

Thanks.

admin
12-Dec-2008, 02:38 PM
Hi Sam,

yes OK send the both EXE to be, and attach the source code project too, please.

Kevin G. McCoy
13-Dec-2008, 05:06 PM
Sam,

It is likely that some code you executed in your program *before* you
called the function with the intentional exception is placing some valid
junk in your stack. Since the junk points to some valid code (using the
offset to Add()), no exception results.

It wouldn't matter if you restarted the computer if this is the case.

As you found out, once you offset the pointer to some other method
besides "Add", it bombs. This is because the pointer offset distance to
"Add" points to valid code. The offset distance from the test pointer to
"Clear" does not.

Both would be correct if you actually created a pointer to the class
instance.

If you step through the assembly code, you'd probably see what is going on.

EurekaLog catches exceptions, not bad coding ;-)

Kevin

Sam wrote:
Hi,

might be possible, that this is a valid memory problem. But I can reproduce the error every time, even after restarting computer.
And why does Delphi raises the exception and other debugging tools like madexcept, too?
I can send you a compiled file with and without eureka, if this helps...

Thanks.

Sam
15-Dec-2008, 09:58 AM
I understand, that EurekaLog catches Exceptions and not bad coding.
My problem is only, that Delphi catches this exception and EurekaLog not.
You can download my test project via guest account, there are 2 EXE files and source code. One without EL and one with EL:
www.mydrive.ch
login: bionic
pw: eltestproject

Thanks!

admin
15-Dec-2008, 05:04 PM
Hi Sam,

just tried it.

On my PC do not raised any exception also without EurekaLog.

So I think this can depends from the current memory status or also Delphi version and updates.

Do you have installed all the latest Delphi 5 updates?

admin
15-Dec-2008, 05:10 PM
Hi Sam,


You can download my test project via guest account, there are 2 EXE files and source code. One without EL and one with EL:
www.mydrive.ch
login: bionic
pw: eltestproject

Thanks!

another thing.

I see that you haven't uploaded your project to the forum.

Currently the forum "single attached file" size limit is set to 500 Kb.

Do you think this size limit is enough or not?

Sam
15-Dec-2008, 05:26 PM
OK, Thank you! Seems to be a Delphi problem then... If I set the TStringList to nil before, the exception comes everytime.

I think for most users 500kb are enough, because they only attach pictures or text files. But 1 MB would be nice sometimes :-)

Sam

admin
15-Dec-2008, 05:29 PM
Hi Sam,

I have just updated the forum and now the max attached file size (for compressed archives) is of about 1 Mbyte! :)