Sign in Join

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

Mailing lists / lazarus / 2016-01

Unexpected error from intfgraphics.pas when running GPIO test program

2 messages · 1 person ·

Reply by email Subscribe to this list Your subscription

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

Bo Berglund

I have created a new Lazarus environment on a Raspberry Pi2B by starting from a new Raspbian Jessie image and installing FPC 3.0.0 and Lazarus 1.6RC2 from svn sources.
I also installed Indy 10.6.2 into the IDE.
All of that worked fine.

Today I opened an old gpio test project, which worked fine in Lazarus back in October 2015. It is a really simple project with just 4 buttons, 2 TShape indicators and 1 TMemo to display progress messages dropped on the standard default form on a new project. It was stored in version control (CVS).

I have tried to Compile and run and also to Build and run this program. Both build and compile works OK but the Run command does not.

It gives the following exception messages now:

--------------------------------------------------------------- Debugger Exception Notification
Project gpiotest raised exception class 'FPImageException' with message:
Bitmap with unknown compression (21060)
In file 'intfgraphics.pas' at line 5709
[Break] [Continue]
----------------------------------------------------------------

Clicking Continue pops up the next error box:

---------------------------------------------------------------- gpiotest
Bitmap with unknown compression (21060)
Press OK to ignore and risk data corruption
Press Cancel to kill the program
[Cancel] [OK]
-----------------------------------------------------------------

And now execution gives up.

I used the find command to find the offending file and it turns out to be a Lazarus internal file!

pi at rpi2-jessie2:~ $ find ./ -name intfgraphics.pas ./dev/lazarus/1.6RC2/lcl/intfgraphics.pas
./dev/lazarus/1.6RC1/lcl/intfgraphics.pas

I have both Lazarus release candidates loaded, but I am working with RC2 at the moment.

When I try to open the project options it pops up another dialog:

--------------------------------------------
Read Error
Bitmap with unknown compression (21060)
[OK]
--------------------------------------------

And when I click OK here Lazarus itself crashes!!!

When I started it again I successfully built the project but when I hit the green run arrow I get yet another dialog popping up:

----------------------------------------------------- Debugger Error
Debugger error

Ooops, the debugger entered the error state
Save your work now!
Hit Stop, and hope the best, we're pulling the plug.

The GDB command:
"-gdb-set confirm off"
did not return any result.
[Less] [Stop]
-----------------------------------------------------

I have tried to create a brand new project in Lazarus RC2 and put 4 buttons, 2 shapes and one memo on the form, then I run this and it works.
So something is fishy in my old proven test program, but how can I find it when the problem is in a Lazarus internal file???

I created it in an earlier Lazarus and FPC version back in October 2015.

Why does this happen and is there a solution?

Bo Berglund Developer in Sweden

Reply by email

Bo Berglund
to Bo Berglund
Bo Berglund wrote 7 lines
---------------------------------------------------------------- gpiotest Bitmap with unknown compression (21060) Press OK to ignore and risk data corruption Press Cancel to kill the program [Cancel] [OK] -----------------------------------------------------------------

...

Why does this happen and is there a solution?

Found the problem!
There is an <projectname>.ico file created when the project builds and this file was corrupted.
I found an old backup on my laptop and that file displayed an image icon (Lazarus) in Windows Explorer while the non-working file did not. They differed about 1 KB i size too (both were unimaginably large, 134 KB for an icon!).

When I copied the backup file on top of the faulty one Lazarus was satisfied. But I tried first to just delete it in the RPi2 project dir, it still had the same problem. Only replacing it with a good file solved the problem.

How such an erroneous file can cause the observed results it hard for me to understand, especially why the actual culprit is not mentioned.

But now my GPIO test program runs fine (as user pi) and I can pull and release the attached relays.

Bo Berglund Developer in Sweden

Reply by email