Hello,
I'm porting my application from WindowsXP/32 to Windows7/64. I'm using Delphi XE and the newest Berg's suite.
1) On WindowsXP/32 my application compile and run fine
2) On Windows7/64 on machine with AMD processor - compile and run fine. Also app compiled on WindowsXP/32 runs fine on this machine
3) On Windows7/64 running on Intel machine - compile fine but dies with "Access Violation". Also version compiled on WindowsXP/32 bit dies with exactly the same message.
The full runtime error is: "First chance exception at $7710B727. Exception class EAccessViolation with message 'Access violation at address 007205DA in module 'Project1.exe'. Read of address 000002E0'. Process Project1.exe (4352)"
I've tracked down the problem using Delphi's debugger and it looks like code which causes the problem is located in nxedit.pas, starting from line 3300, eg in TNxCustomNumberEdit.GetValue function.
Please note, that EXACTLY THE SAME CODE works fine in Windows7/64 on AMD based PC! Does it means that BergSoft components are processors-kind depended?
I'm looking for any help!
regards,
Cezar
Access Violation in TNxCustomNumberEdit.GetValue in IA64
Started by cezar, May 08 2011 07:13 PM
9 replies to this topic
#1
Posted 08 May 2011 - 07:13 PM
#2
Posted 08 May 2011 - 08:22 PM
Hello Cezar,
NextSuite is not CPU depended. It use standard Delphi routines. I have no problems on Intel CPU and Delphi XE on Win64.
Can you please tell me on which line AV breaks.
In my version line 3300 points to another procedure.
Thanks
NextSuite is not CPU depended. It use standard Delphi routines. I have no problems on Intel CPU and Delphi XE on Win64.
Can you please tell me on which line AV breaks.
In my version line 3300 points to another procedure.
Thanks
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
#3
Posted 08 May 2011 - 08:34 PM
QUOTE (Boki (Berg) @ May 8 2011, 09:22 PM) <{POST_SNAPBACK}>
Can you please tell me on which line AV breaks.
In my version line 3300 points to another procedure.
In my version line 3300 points to another procedure.
Well, I'm sure I've got the newest one downloaded from my account at BergSoft.net
Anyway, in my version of nxedit.pas the error is in function TNxCustomNumberEdit.GetValue, and strictly speaking marked with arrow in code below:
CODE
function TNxCustomNumberEdit.GetValue: Double;
var
ValidText: string;
begin
if (Text = NullText) then // <<-- Access Violation is here!
begin
Value := 0;
Exit;
end;
if Text = '' then Result := FMin else <<-- if you'll comment the code block above there will be here another acces violation!
begin
ValidText := GetValidText(Text, eoAllowFloat in FOptions, eoAllowSigns in FOptions);
if ValidText = '' then ValidText := FloatToStr(Min);
if TryStrToFloat(ValidText, Result) then
begin
AdjustToRange(Result);
var
ValidText: string;
begin
if (Text = NullText) then // <<-- Access Violation is here!
begin
Value := 0;
Exit;
end;
if Text = '' then Result := FMin else <<-- if you'll comment the code block above there will be here another acces violation!
begin
ValidText := GetValidText(Text, eoAllowFloat in FOptions, eoAllowSigns in FOptions);
if ValidText = '' then ValidText := FloatToStr(Min);
if TryStrToFloat(ValidText, Result) then
begin
AdjustToRange(Result);
Thank you in advance!
Cezar
#4
Posted 08 May 2011 - 11:49 PM
Hello Cezar,
As I may see there is nothing suspicious in this line. Maybe it is some Delphi bug (?).
If you want, you may contact me via E-mail and I may send you newest version of NextSuite. I am not optimistic that something will be changed, but we may try.
Best regards
As I may see there is nothing suspicious in this line. Maybe it is some Delphi bug (?).
If you want, you may contact me via E-mail and I may send you newest version of NextSuite. I am not optimistic that something will be changed, but we may try.
Best regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
#5
Posted 09 May 2011 - 12:09 AM
QUOTE (Boki (Berg) @ May 9 2011, 12:49 AM) <{POST_SNAPBACK}>
Hello Cezar,
As I may see there is nothing suspicious in this line. Maybe it is some Delphi bug (?).
If you want, you may contact me via E-mail and I may send you newest version of NextSuite. I am not optimistic that something will be changed, but we may try.
Best regards
As I may see there is nothing suspicious in this line. Maybe it is some Delphi bug (?).
If you want, you may contact me via E-mail and I may send you newest version of NextSuite. I am not optimistic that something will be changed, but we may try.
Best regards
Boki,
I've just downloaded the newest NextSuite (5.3.5) and I'm adding it to my DephiXE, so I'll give it a try first
Thank you for your help!
Cezar
#6
Posted 09 June 2011 - 11:00 PM
OK, it's me again. I've found the problem and I'm able to reproduce it small example program - TADA! 
So, let me show the test environment: Delphi XE running on Windows XP with Polish locales, using the last one version of NX family components. The small, one unit big project called Boki.dpr (surprise!
). In the unit there are 3 NXNumerEdit components, numbered from 1 to 3. First and second has OnChange event filled with code which just add (or mulitple) value of the next component (so called: cascade change). Second and third object has also the "TextAfter" property filled with: '%' and ' %'.
Whats is funny: it works great under Windows XP 32 Bit. It work perfect under Windows7 64bit on AMD platform. But it dies on Windows7 64bit on IA64. The message is: "Error reading NxNumerEdit2.TextAfter: access violation at address...".
Boki, I've found something very interesting: it looks like at the time of objects creation (eg: calling create from DPR) Delphi XE RTTI fires the existing 'OnChange' events on each form it explicity initialize. And it looks like when it trys to access the "TextAfter" property on the component NX library is not yet completly initialized... You can make small experiment: just add the "onCreate" event handler to the form used in this example and put something inside (just to don't allow optimizer to remove this code, so using just comment sign is not enough). DO NOT inherit anything! The code will run properly under Windows7 64bit on Intel platform. Funny, huh?
I'm including complete source code for the Boki project along with boki.exe compressed with 7zip - please feel free to test and modify it
And please find the solution as soon as possible, it's very important for me and for my customer!
best regards,
Cezar
So, let me show the test environment: Delphi XE running on Windows XP with Polish locales, using the last one version of NX family components. The small, one unit big project called Boki.dpr (surprise!
Whats is funny: it works great under Windows XP 32 Bit. It work perfect under Windows7 64bit on AMD platform. But it dies on Windows7 64bit on IA64. The message is: "Error reading NxNumerEdit2.TextAfter: access violation at address...".
Boki, I've found something very interesting: it looks like at the time of objects creation (eg: calling create from DPR) Delphi XE RTTI fires the existing 'OnChange' events on each form it explicity initialize. And it looks like when it trys to access the "TextAfter" property on the component NX library is not yet completly initialized... You can make small experiment: just add the "onCreate" event handler to the form used in this example and put something inside (just to don't allow optimizer to remove this code, so using just comment sign is not enough). DO NOT inherit anything! The code will run properly under Windows7 64bit on Intel platform. Funny, huh?
I'm including complete source code for the Boki project along with boki.exe compressed with 7zip - please feel free to test and modify it
best regards,
Cezar
Attached Files
#7
Posted 10 June 2011 - 05:45 AM
Hello Cezar,
Thank you for your demo.
So far - nothing
It compile and run without problems on 2 machines (XP and Win7 both on Intel)
I will go trough code to see for suspicious code. I only have one question that may help me: How it work if you set TextBefore property to some value? Handling TextBefore is quite similar to TextAfter code.
Boki
Thank you for your demo.
So far - nothing
I will go trough code to see for suspicious code. I only have one question that may help me: How it work if you set TextBefore property to some value? Handling TextBefore is quite similar to TextAfter code.
Boki
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
#8
Posted 10 June 2011 - 03:40 PM
Boki,
Please try to run EXE file I've attached to the demo. Or try to compile demo project on WindowsXP using DelphiXe and then try to run THIS BINARY on Windows7 - it should crash.
Please try to run EXE file I've attached to the demo. Or try to compile demo project on WindowsXP using DelphiXe and then try to run THIS BINARY on Windows7 - it should crash.
#9
Posted 15 June 2011 - 10:40 AM
SOLVED.
Boki, first of - I'm very sorry for the mess!
It wasn't NxComponents fault at all. It's was bug in one of the Samsung drivers attadched to their laptops. After erasing Samsung's version of Windows7 and reinstaling it from virgin CDs froom Microsoft my application works fine. We have asked Samsung for explanation.
Anyway, Boki - I'm sorry once again!
Cezar
Boki, first of - I'm very sorry for the mess!
Anyway, Boki - I'm sorry once again!
Cezar
#10
Posted 15 June 2011 - 05:40 PM
Hello Cezar,
No problem
I am glad that it is solved.
Best regards
No problem
Best regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users












