View Issue Details

IDProjectCategoryView StatusLast Update
0012033LazarusLCLpublic2008-09-14 18:36
ReporterDominique Louis Assigned ToTom Gregorovic  
PrioritynormalSeveritycrashReproducibilityalways
Status closedResolutionfixed 
Product Version0.9.25 (SVN) 
Target Version0.9.26Fixed in Version0.9.25 (SVN) 
Summary0012033: Mac OS X : LoadCursorFromLazarusResource throws Division by Zero Exception!
DescriptionUnder Mac OS X 10.4.11 the call to LoadCursorFromLazarusResource throws a Division by Zero Exception and the application shutsdown.
This code was working literally a week ago and nothing has changed in my code!

This crash has not been tested on any other OS.

The crash log is as follows...

Thread 0 Crashed:
0 Game_Maker 0x0019f101 CARBONGDIOBJECTS_TCARBONCURSOR_$__CREATEHARDWARECURSOR$TCARBONBITMAP$POINT + 321
1 Game_Maker 0x0019f6ea CARBONGDIOBJECTS_TCARBONCURSOR_$__CREATEFROMINFO$PICONINFO$$TCARBONCURSOR + 266
2 Game_Maker 0x001951bf CARBONINT_TCARBONWIDGETSET_$__CREATEICONINDIRECT$PICONINFO$$HICON + 127
3 Game_Maker 0x000fab4a GRAPHICS_TCURSORIMAGE_$__HANDLENEEDED + 138
4 Game_Maker 0x000faa34 GRAPHICS_TCURSORIMAGE_$__RELEASEHANDLE$$HICON + 36
5 Game_Maker 0x000ebae2 GRAPHICS_LOADCURSORFROMLAZARUSRESOURCE$ANSISTRING$$HICON + 114
6 Game_Maker 0x000496a8 IMAGE_EDITFORM_CURSORS_INIT + 24
7 Game_Maker 0x00017f38 FORMS_TCUSTOMFORM_$__CREATE$TCOMPONENT$$TCUSTOMFORM + 408
8 Game_Maker 0x00019a9d FORMS_TFORM_$__CREATE$TCOMPONENT$$TFORM + 141
9 Game_Maker 0x0001e97d FORMS_TAPPLICATION_$__CREATEFORM$TCOMPONENTCLASS$formal + 157
10 Game_Maker 0x00001b66 PASCALMAIN + 406
11 Game_Maker 0x000019b2 start + 258
12 Game_Maker 0x000018d9 start + 41

<whinge> I only recently managed to give my client a working version of their ported app due to a previous Range Error/TIcon issue, and if they want a build in the next couple of days, this won't look good if I say that the code base is broken again. Yes I know everyone is doing this out of the goodness of their heart, but I'm also trying to use these tools to showcase what Lazarus and FreePascal can achieve, in the hope that others will see what I've done and appreciate huge benefits it provides over Delphi and the like.</whinge>
TagsNo tags attached.
Fixed in Revision16386
LazTarget0.9.26
WidgetsetCarbon
Attached Files

Activities

2008-09-02 14:52

 

test12033.zip (14,227 bytes)

Dmitry Boyarintsev

2008-09-02 15:06

developer   ~0021931

the exception caused, because of Cursor image NOT created by CGCreateImageWithMask, the returned CGImageRef is zero.
That's why GetBitsPerComponent returns 0, and division crashes.

It's possible (not tested), that Mask image is created with
CGColorSpaceCreateWithName(kCGColorSpaceGenericGray) colorspace (),
according to AppleDocs mask image Colorspace must be DeviceGray (not Generic?)


It's also odd (see Button3Click in the project), that the orded of allocating Color and Mask handles from CursorImage has different effect. (not digged why)
But if Mask handle is created first, than mask and color bitmaps cannot be combined.
But if Color handle is created first, than mask and color bitmaps are combined successfuly. (bug or feature?)

The test project is provided. Icon names are ico24 (24 bit icon), ico32 (32 bit icon)

Tom Gregorovic

2008-09-02 18:03

developer   ~0021935

There is problem with masking of custom cursors.

Dominique Louis

2008-09-14 18:36

reporter   ~0022227

This works. Thanks for being patient about my winging.

Issue History

Date Modified Username Field Change
2008-09-01 22:31 Dominique Louis New Issue
2008-09-01 22:31 Dominique Louis Widgetset => Carbon
2008-09-02 05:49 Vincent Snijders LazTarget => 0.9.26
2008-09-02 05:49 Vincent Snijders Assigned To => Tom Gregorovic
2008-09-02 05:49 Vincent Snijders Status new => assigned
2008-09-02 05:49 Vincent Snijders Target Version => 0.9.26
2008-09-02 14:52 Dmitry Boyarintsev File Added: test12033.zip
2008-09-02 15:06 Dmitry Boyarintsev Note Added: 0021931
2008-09-02 18:03 Tom Gregorovic Fixed in Revision => 16386
2008-09-02 18:03 Tom Gregorovic Status assigned => resolved
2008-09-02 18:03 Tom Gregorovic Fixed in Version => 0.9.25 (SVN)
2008-09-02 18:03 Tom Gregorovic Resolution open => fixed
2008-09-02 18:03 Tom Gregorovic Note Added: 0021935
2008-09-14 18:36 Dominique Louis Status resolved => closed
2008-09-14 18:36 Dominique Louis Note Added: 0022227