Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2012-06

Error running Lazarus

4 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Reinier Olislagers

Windows
Laz x86 bigide trunk r37483, FPC trunk r21457

After compilation, when starting Laz I get an error message TButtonGlyphs.GlyphChanged: Max(1,0) gives a wrong result 0, should be 1. Attached log (both laz and fpc built with -g -gl)
(Had built with fpcup; have deleted all .ppu, .o. .a from both fpc and laz directories then retried only building fpc, lazarus and bigide, so no useride)

Is it me or should something be fixed?

Thanks,
Reinier

-------------- next part --------------
SetPrimaryConfigPath NewValue="c:\development\lazarussettings_fpctrunk" -> "C:\development\lazarussettings_fpctrunk" TMainIDE.ParseCmdLineOptions:
PrimaryConfigPath="C:\development\lazarussettings_fpctrunk\" SecondaryConfigPath="C:\Development\lazarus_fpctrunk" TFPCTargetConfigCache.NeedsUpdate TargetOS="" TargetCPU="" compiler file changed "C:\development\fpctrunk\bin\i386-win32\fpc.exe" FileAge=1086492850 StoredAge=1086491412 TFPCTargetConfigCache.Update C:\development\fpctrunk\bin\i386-win32\fpc.exe TargetOS= TargetCPU= CompilerOptions= ExtraOptions= PATH=C:\Windows;C:\Windows\system32;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\System32\Wbem;D:\Util;C:\Windows\System32\WindowsPowerShell\v1.0\;D:\Program Files\SlikSvn\bin\;d:\Program Files (x86)\Git\cmd;D:\PROGRA~2\IBM\SQLLIB\BIN;D:\PROGRA~2\IBM\SQLLIB\FUNCTION;C:\MinGW32\bin;C:\MinGW64\bin;D:\Program Files\Microsoft SQL Server\100\DTS\Binn\;D:\Program Files\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;c:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\;d:\Program Files (x86)\MiKTeX 2.9\miktex\bin;D:\Program Files (x86)\Graphviz2.26.3\bin;D:\Program Files\TortoiseHg\;d:\Program Files (x86)\Nmap;c:\development\fpcbootstrap RunTool C:\development\fpctrunk\bin\i386-win32\fpc.exe -iWTOTP -Pi386 -Twin32 RunTool C:\development\fpctrunk\bin\i386-win32\fpc.exe -va -Pi386 -Twin32 compilertest.pas TFPCTargetConfigCache.Update: has changed
TFPCTargetConfigCache.NeedsUpdate TargetOS="win32" TargetCPU="i386" compiler file changed "C:\development\fpctrunk\bin\i386-win32\fpc.exe" FileAge=1086492850 StoredAge=1086491412 TFPCTargetConfigCache.Update C:\development\fpctrunk\bin\i386-win32\fpc.exe TargetOS=win32 TargetCPU=i386 CompilerOptions= ExtraOptions=-FrC:\development\lazarus_fpctrunk\components\codetools\fpc.errore.msg PATH=C:\Windows;C:\Windows\system32;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\System32\Wbem;D:\Util;C:\Windows\System32\WindowsPowerShell\v1.0\;D:\Program Files\SlikSvn\bin\;d:\Program Files (x86)\Git\cmd;D:\PROGRA~2\IBM\SQLLIB\BIN;D:\PROGRA~2\IBM\SQLLIB\FUNCTION;C:\MinGW32\bin;C:\MinGW64\bin;D:\Program Files\Microsoft SQL Server\100\DTS\Binn\;D:\Program Files\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;c:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\;d:\Program Files (x86)\MiKTeX 2.9\miktex\bin;D:\Program Files (x86)\Graphviz2.26.3\bin;D:\Program Files\TortoiseHg\;d:\Program Files (x86)\Nmap;c:\development\fpcbootstrap RunTool C:\development\fpctrunk\bin\i386-win32\fpc.exe -iWTOTP -Pi386 -Twin32 -FrC:\development\lazarus_fpctrunk\components\codetools\fpc.errore.msg RunTool C:\development\fpctrunk\bin\i386-win32\fpc.exe -va -Pi386 -Twin32 -FrC:\development\lazarus_fpctrunk\components\codetools\fpc.errore.msg compilertest.pas TFPCTargetConfigCache.Update: has changed
[TMainIDE.Destroy] A
[TMainIDE.Destroy] B -> inherited Destroy... TMainIDE [TMainIDE.Destroy] END
[FORMS.PP] ExceptionOccurred
Sender=Exception
Exception=TButtonGlyph.GlyphChanged: Max(1, 0) gives a wrong result 0, should be 1. Stack trace:
$005957B3 TBUTTONGLYPH__GLYPHCHANGED, line 236 of ./include/buttonglyph.inc $004BE69F TGRAPHIC__CHANGED, line 62 of ./include/graphic.inc $004C23FB TRASTERIMAGE__CHANGED, line 401 of ./include/rasterimage.inc $004C3782 TCUSTOMBITMAP__CHANGED, line 39 of ./include/custombitmap.inc $004C184E TRASTERIMAGE__ASSIGN, line 113 of ./include/rasterimage.inc $004C3927 TCUSTOMBITMAP__ASSIGN, line 68 of ./include/custombitmap.inc $00595047 TGLYPHBITMAP__ASSIGN, line 34 of ./include/buttonglyph.inc $00594087 LOADGLYPHFROMLAZARUSRESOURCE, line 491 of buttons.pp $0059796D TCUSTOMSPEEDBUTTON__LOADGLYPHFROMLAZARUSRESOURCE, line 981 of ./include/speedbutton.inc $007289C1 TCOMPONENTPALETTE__UPDATENOTEBOOKBUTTONS, line 693 of componentpalette.pas $007276FB TCOMPONENTPALETTE__SETPAGECONTROL, line 268 of componentpalette.pas $007827DE TPKGMANAGER__UPDATEVISIBLECOMPONENTPALETTE, line 1698 of C:/development/lazarus_fpctrunk/packager/pkgmanager.pas $0077E2AD TPKGMANAGER__IDECOMPONENTPALETTEENDUPDATE, line 437 of C:/development/lazarus_fpctrunk/packager/pkgmanager.pas $006BF82C TBASECOMPONENTPALETTE__DOENDUPDATE, line 550 of componentreg.pas $00727D02 TCOMPONENTPALETTE__DOENDUPDATE, line 419 of componentpalette.pas $006BFC6E TBASECOMPONENTPALETTE__ENDUPDATE, line 652 of componentreg.pas $007827A8 TPKGMANAGER__LOADINSTALLEDPACKAGES, line 1679 of C:/development/lazarus_fpctrunk/packager/pkgmanager.pas TApplication.HandleException TButtonGlyph.GlyphChanged: Max(1, 0) gives a wrong result 0, should be 1. Stack trace:
$005957B3 TBUTTONGLYPH__GLYPHCHANGED, line 236 of ./include/buttonglyph.inc $004BE69F TGRAPHIC__CHANGED, line 62 of ./include/graphic.inc $004C23FB TRASTERIMAGE__CHANGED, line 401 of ./include/rasterimage.inc $004C3782 TCUSTOMBITMAP__CHANGED, line 39 of ./include/custombitmap.inc $004C184E TRASTERIMAGE__ASSIGN, line 113 of ./include/rasterimage.inc $004C3927 TCUSTOMBITMAP__ASSIGN, line 68 of ./include/custombitmap.inc $00595047 TGLYPHBITMAP__ASSIGN, line 34 of ./include/buttonglyph.inc $00594087 LOADGLYPHFROMLAZARUSRESOURCE, line 491 of buttons.pp $0059796D TCUSTOMSPEEDBUTTON__LOADGLYPHFROMLAZARUSRESOURCE, line 981 of ./include/speedbutton.inc $007289C1 TCOMPONENTPALETTE__UPDATENOTEBOOKBUTTONS, line 693 of componentpalette.pas $007276FB TCOMPONENTPALETTE__SETPAGECONTROL, line 268 of componentpalette.pas $007827DE TPKGMANAGER__UPDATEVISIBLECOMPONENTPALETTE, line 1698 of C:/development/lazarus_fpctrunk/packager/pkgmanager.pas $0077E2AD TPKGMANAGER__IDECOMPONENTPALETTEENDUPDATE, line 437 of C:/development/lazarus_fpctrunk/packager/pkgmanager.pas $006BF82C TBASECOMPONENTPALETTE__DOENDUPDATE, line 550 of componentreg.pas $00727D02 TCOMPONENTPALETTE__DOENDUPDATE, line 419 of componentpalette.pas $006BFC6E TBASECOMPONENTPALETTE__ENDUPDATE, line 652 of componentreg.pas $007827A8 TPKGMANAGER__LOADINSTALLEDPACKAGES, line 1679 of C:/development/lazarus_fpctrunk/packager/pkgmanager.pas

Reply by email

Juha Manninen
to Reinier Olislagers

On Sat, Jun 2, 2012 at 7:22 PM, Reinier Olislagers <

Show quoted text 14 lines
wrote: Windows Laz x86 bigide trunk r37483, FPC trunk r21457 After compilation, when starting Laz I get an error message TButtonGlyphs.GlyphChanged: Max(1,0) gives a wrong result 0, should be 1. Attached log (both laz and fpc built with -g -gl) (Had built with fpcup; have deleted all .ppu, .o. .a from both fpc and laz directories then retried only building fpc, lazarus and bigide, so no useride) Is it me or should something be fixed?

Yes it is you :)
No, in fact this is an "impossible" bug. As the error message says, Max function gives a wrong result! See :

#22164: Lazarus Startup Error: Invalid floating point operation. http://bugs.freepascal.org/view.php?id=22164

__ My test code looks like this: __
var
  numg1, numg2: integer;
...
  numg1:=1;
  if NumGlyphs > 1 then
    numg1 := NumGlyphs;
  numg2:=Max(1, NumGlyphs);
  if numg1  numg2 then
    raise Exception.CreateFmt('TButtonGlyph.GlyphChanged: Max(1, %d) gives
a wrong result %d, should be %d.',
                                [NumGlyphs, numg2, numg1]);
NumGlyphs is defined as a range:
  TNumGlyphs = 1..5;

One possible explanation is that the latest compiler has a bug with ranges, maybe calling a wrong overloaded version of Max. Maybe it calls the float version and makes a rounding error (?)
Who knows...
Anyway Max() really, actually, returns a wrong value, no joking!

I cannot reproduce it. I have a 64-bit system and my FPC trunk is few weeks old.
I can test with the latest FPC trunk, too.

Juha
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20120602/7fc9a2f4/attachment.html>

Reply by email

Reinier Olislagers
to Juha Manninen: On Sat, Jun 2, 2012 at 7:22 PM, Reinier Olislagers < Yes it is you :) No, in fact this is…
Juha Manninen wrote 18 lines
On Sat, Jun 2, 2012 at 7:22 PM, Reinier Olislagers < <mailto:>> wrote: Windows Laz x86 bigide trunk r37483, FPC trunk r21457 After compilation, when starting Laz I get an error message TButtonGlyphs.GlyphChanged: Max(1,0) gives a wrong result 0, should be 1. Attached log (both laz and fpc built with -g -gl) (Had built with fpcup; have deleted all .ppu, .o. .a from both fpc and laz directories then retried only building fpc, lazarus and bigide, so no useride) Is it me or should something be fixed? Yes it is you :)

Hah!
Difficult situation - I'm glad it's not me but sad it's a compiler bug ;)

No, in fact this is an "impossible" bug. As the error message says, Max function gives a wrong result!

Nasty bug.
BTW, have the same problem with a Windows x64 FPC/Lazarus IDE.

See : #22164: Lazarus Startup Error: Invalid floating point operation. http://bugs.freepascal.org/view.php?id=22164

Thanks for the explanation, that's quite clear.

Show quoted text 6 lines
I cannot reproduce it. I have a 64-bit system and my FPC trunk is few weeks old. I can test with the latest FPC trunk, too. Juha

Thanks,
Reinier

Reply by email