Page 1 of 2

Bug in versions 4.1.x?? Strange error with Delphi 7 app

Posted: 4. Oct 2011, 00:20
by Speaker
Hi! something rare happens when i update from version 4.0.12 to version 4.1.x
Host: Windows 7 ultimate 64b.
Guest: Windows XP sp2 32b.
I had a vm with a development enviroment with Delphi 7.
I run the same machine, with the same disk (i copied it for test this issue), in my notebook (i5, 4gb, video Intel HD Graphics) and in my desktop pc (i5, 8gb, video geforce gts 250)
In notebook, virtual box version is 4.0.12, y pc 4.1.4 (but i try with 4.1.0 and the same error occurs).
When i execute and exe compiled from my application code, in notebook runs ok, in pc crashed with an "Stream Read Error".

I run the application from the IDE and the lines of code reaching the error are:

Code: Select all

  TPicture.RegisterFileFormat('xI', '', TIcon);
  TPicture.RegisterFileFormat('xL', '', TBitmap);
  TPicture.RegisterFileFormat('xF', '', TJpegImage);
  Application.Icon.LoadFromFile(IncludeTrailingPathDelimiter(CarpetaDeEjecucion) + ChangeFileExt(ExtractFileName(Application.ExeName), '.xI'));
  imLogo.Picture.LoadFromFile(IncludeTrailingPathDelimiter(CarpetaDeEjecucion) + ChangeFileExt(ExtractFileName(Application.ExeName), '.xL'))
  imPrincipal.Picture.LoadFromFile(IncludeTrailingPathDelimiter(CarpetaDeEjecucion) + ChangeFileExt(ExtractFileName(Application.ExeName), '.xF'));
The same exe (compiled in pc) runs without any problem in notebook, or host OS.
But from the IDE or as an standalone exe, it reach the exception.

My video memory is set to 128Mb, with 1 monitor, without remote screen.
I try with different combinations of HW acceleration (3D, 2D), but still get to the error.

It seems to be some change (bug) on version 4.1.x
Thanks you all for any suggestion or solution... (i actually have working version 4.0.12 installed, but i will probably want to update in a future)!

Re: Bug in versions 4.1.x?? Strange error with Delphi 7 app

Posted: 4. Oct 2011, 00:47
by scp
Maybe you check if there is something going wrong with the filename before running LoadFromFile():

Code: Select all

var
  strFileBase: String;
begin
   // your other code here...
   TPicture.RegisterFileFormat('xI', '', TIcon);
   TPicture.RegisterFileFormat('xL', '', TBitmap);
   TPicture.RegisterFileFormat('xF', '', TJpegImage);
   strFileBase := IncludeTrailingPathDelimiter(CarpetaDeEjecucion) + ChangeFileExt(ExtractFileName(Application.ExeName), '');
   if not FileExists(strFileBase + '.xI') then ShowMessage('Not found: '+strFileBase + '.xI');
   if not FileExists(strFileBase + '.xL') then ShowMessage('Not found: '+strFileBase + '.xL');
   if not FileExists(strFileBase + '.xF') then ShowMessage('Not found: '+strFileBase + '.xF');
   Application.Icon.LoadFromFile(strFileBase + '.xI');
   imLogo.Picture.LoadFromFile(strFileBase + '.xL');
   imPrincipal.Picture.LoadFromFile(strFileBase + '.xF');

Re: Bug in versions 4.1.x?? Strange error with Delphi 7 app

Posted: 4. Oct 2011, 00:54
by Speaker
Is not a problem with the code (although it may be better). The same code, same vm configuration, same vdi works fine in notebook with version 4.0.12.
In PC with version 4.1.4 do not work.
But... in PC i have downgrade to 4.0.8, try... fine... update to 4.0.12, try... fine... update to 4.1.0... get the error...
I have corresponding (same version) extended pack installed (an updated as i try with different versions).
By the way... this is the last thing i think... i am blaming my underlying hardware... update geforce drivers a time ago... but now... with same geforce drivers, but version 4.0.12, it works fine again.

Re: Bug in versions 4.1.x?? Strange error with Delphi 7 app

Posted: 4. Oct 2011, 00:58
by Perryg
These kinds of problems that are reproducible should be reported to bugtracker. You will need to setup an account there as it is on a different system.
It would also help if you can post the ticket number here so other can see the progress, add information, or see the final results.

Re: Bug in versions 4.1.x?? Strange error with Delphi 7 app

Posted: 4. Oct 2011, 01:07
by Speaker
Thanks you... i just post a deffect ticket.

Re: Bug in versions 4.1.x?? Strange error with Delphi 7 app

Posted: 4. Oct 2011, 01:24
by Perryg

Re: Bug in versions 4.1.x?? Strange error with Delphi 7 app

Posted: 6. Oct 2011, 22:54
by scp
Speaker wrote:Is not a problem with the code (although it may be better).
yes, but if you insert some debugging code you can be more specific in the bug report at which step the error occurs.

Re: Bug in versions 4.1.x?? Strange error with Delphi 7 app

Posted: 6. Oct 2011, 23:20
by Speaker
This topic makes you an idea of a "solution" (seems to be, but is the first thing i try).
http://www.delphigroups.info/2/7/630330.html

Take this in account... the app works fine from Win9x to Win7_64b, this peace of code goes with the app since 1998, Delphi 1 to 7, it compiles without any problem in any enviroment (in vb 4.1.x, too).
But, when you run the app, in a vb 4.1.x, you get the error... if you use version 4.0.12 or below... it works (i test it... compiled in this vm and other).
I'll do all the test...

The only enviroment in which the application do not work is if the virtual machine is run under virtual box 4.1.0 or above.
I test it... install 4.0.12, works, install 4.1.0 do not work, install 4.1.4 do not work, install 4.0.8 works, install 4.0.12... work... and that is.

I can try future versions as a beta_tester, and help as i can to solve this problem as it takes only install new version, execute same VM and execute app within it.
To add more data... i have installed in my VB extension pack (same version as VB), and vb guest additions.

Hope some of this data help solving this bug.

Re: Bug in versions 4.1.x?? Strange error with Delphi 7 app

Posted: 7. Oct 2011, 00:00
by Speaker
Just for you to try... i post a single app (exe and source) that just got that code in it.
It works everywhere, except a VM running under VB w/ext_pack 4.1.x
The app shows a single windows with a JPG (xF extension), a custom ICON (xI extension), and a little BMP in the panel inside the windows (xL extension).
The files with extension xL, xI and xF must be named as EXE, and the 4 files must be under the same folder.

Re: Bug in versions 4.1.x?? Strange error with Delphi 7 app

Posted: 10. Oct 2011, 02:21
by scp
Currently I cannot reproduce the error. I used VirtualBox 4.1.4, with ExtPack and Additions installed, Host Win7 x64 with Guest Win7 x64. All three Graphics get loaded without error.
I tried your compiled .exe and compiled a new .exe with your source code and Delphi 7 (german).

Next I will try a WinXP Guest.

Re: Bug in versions 4.1.x?? Strange error with Delphi 7 app

Posted: 10. Oct 2011, 02:28
by Speaker
Perhaps is something with win xp 32b guest and that version.
But as i said... same VM run with vb4.0.x do not reach to the exception. Same VM run with vb4.1.x yes.
I do all the test i posted... i really do not know...

Re: Bug in versions 4.1.x?? Strange error with Delphi 7 app

Posted: 10. Oct 2011, 04:03
by scp
Very strange. Tested it now with fresh installed WinXP 32bit SP2, WinXP 32bit SP3 and WinXP 32bit SP3 with all updates.
The error never happens, it works with all versions. I don't know if the localization makes a difference. I used german Win XP and would have only english, french and italian version and some MUIs in addition.

Re: Bug in versions 4.1.x?? Strange error with Delphi 7 app

Posted: 10. Oct 2011, 17:17
by Speaker
Perhaps something with large fonts?
In that particular machine, i compile app for large font resolution (120 dpi).
I can't try right know...

Re: Bug in versions 4.1.x?? Strange error with Delphi 7 app

Posted: 10. Oct 2011, 17:46
by Speaker
I try. There is not a problem with video or font resolution.
It is a problem with the execution point of the app.
I got all my development enviroment in VMs, but for security reasons, all my source code in my host machine.
With version 4.1.x when you execute the app from a net unit (t:\ = \\VBoxSrv\Temporal, a shared unit), it gets the error.
If i copy the app to guest desktop, it do not gets the error.
With version 4.0.x do not happen this.
I got net configured as Brigde, with DHCP, shared units from vbox and drives connected to that shared units.
Still a bug, but this change the point of look.

Re: Bug in versions 4.1.x?? Strange error with Delphi 7 app

Posted: 11. Oct 2011, 03:05
by scp
Do you use "." for CarpetaDeEjecucion in your apllication? Try to you use this, which is more safe:

Code: Select all

   CarpetaDeEjecucion := ExtractFilePath(ParamStr(0));
It will contain the directory of the .exe, could be '\\VBoxSrv\Temporal\' or 'T:\' for example, depending from the point you start it.