Sign in Join

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

Mailing lists / lazarus / 2003-12

win32 crash because of new components.

8 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

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

Mattias Gaertner
to Vincent Snijders: Recently lazarus stopped starting up under win32. I think it is caused by the recent…
Show quoted text 28 lines
On Wed, 24 Dec 2003 17:09:15 +0100 Vincent Snijders wrote: > Hi, > > Recently lazarus stopped starting up under win32. I think it is caused > by the recent additions of components to the toolbar. The win32 > interface can't read the icons without raising an exception. Appended > is the backtrace. > > I changed line 722 of win32winapi.inc: > until (i>=AList.Count); > > This prevented the crash. I hope somebody with more experience with > bitmaps and pixmaps can take a look at this to see if it is correct. Further research showed that the problem is caused by xpm-files with these kind of lines in the color map: "$ c #C0C0C0", "% c red", "& c green", "* c yellow", The first line is parsed correctly, but the others not. The function CreatePixmapIndirect doesn't support symbolic color names (like red), only RGB-values. So the change mentioned above isn't a fix, it only prevents a crash.

CreatePixmapIndirect is only a workaround to load xpms under win32. It is very slow due to string operations.

We can either add a further workaround or switch to fpc 1.0.11/1.9.1 and use fpImage as default. Micha, is this possible for the win32 intf?

Mattias

Reply by email

Vincent Snijders
to Vincent Snijders: Recently lazarus stopped starting up under win32. I think it is caused by the recent…
Show quoted text 12 lines
Hi, Recently lazarus stopped starting up under win32. I think it is caused by the recent additions of components to the toolbar. The win32 interface can't read the icons without raising an exception. Appended is the backtrace. I changed line 722 of win32winapi.inc: until (i>=AList.Count); This prevented the crash. I hope somebody with more experience with bitmaps and pixmaps can take a look at this to see if it is correct.

Further research showed that the problem is caused by xpm-files with these kind of lines in the color map:
"$ c #C0C0C0",
"% c red",
"& c green",
"* c yellow",

The first line is parsed correctly, but the others not. The function CreatePixmapIndirect doesn't support symbolic color names (like red), only RGB-values.

So the change mentioned above isn't a fix, it only prevents a crash.

HTH,
Vincent.

Reply by email

Vincent Snijders

Hi,

Recently lazarus stopped starting up under win32. I think it is caused by the recent additions of components to the toolbar. The win32 interface can't read the icons without raising an exception. Appended is the backtrace.

I changed line 722 of win32winapi.inc:
      until (i>=AList.Count);

This prevented the crash. I hope somebody with more experience with bitmaps and pixmaps can take a look at this to see if it is correct.

Regards,
Vincent

Backtrace:
#0 RAISEEXCEPT (OBJ=0x346e0a4, ANADDR=0x6d5414, AFRAME=0x0) at except.inc:119
#1 0x6d571d in TLIST__ERROR (MSG=0x8bf36c, DATA=8, pvmt=0x8bde14) at lists.inc:168
#2 0x6d5414 in TLIST__GET (INDEX=8, this=0x34cafc4) at lists.inc:33 #3 0x6bafa2 in GETCOLORFROMALIAS (ALIAS=0x34a5130) at #win32winapi.inc:717 4 0x6bb1a4 in DODRAWBITMAP () at #win32winapi.inc:744 5 0x6bb5ce in TWIN32OBJECT__CREATEPIXMAPINDIRECT #(DATA=0x3539224,
TRANSCOLOR=16777215, this=0x8ece08) at win32winapi.inc:799 #6 0x69a97b in CREATEPIXMAPINDIRECT (DATA=0x3539224, #TRANSCOLOR=16777215)
at lclintf.inc:95
#7 0x68d701 in READXPMSTREAM () at bitmap.inc:508 #8 0x68d7f5 in TBITMAP__READSTREAM (STREAM=0x12b17f0, SIZE=965, this=0x34b2f24) at bitmap.inc:543
#9 0x68cfee in TBITMAP__LOADFROMSTREAM (STREAM=0x12b17f0, #this=0x34b2f24)
at bitmap.inc:288
#10 0x68cf99 in TBITMAP__LOADFROMLAZARUSRESOURCE (RESNAME=0x12a7fdc, this=0x34b2f24) at bitmap.inc:280
#11 0x523899 in TPKGCOMPONENT__GETICONCOPY (this=0x13128f8) at packagedefs.pas:2775
#12 0x4a990d in TCOMPONENTPALETTE__UPDATENOTEBOOKBUTTONS #(this=0x34bd3d4)
at componentpalette.pas:429
#13 0x4a8ccd in TCOMPONENTPALETTE__SETNOTEBOOK (AVALUE=0x132c470, this=0x34bd3d4) at componentpalette.pas:180
#14 0x4358ea in TPKGMANAGER__UPDATEVISIBLECOMPONENTPALETTE (this=0x12d00a0) at pkgmanager.pas:1571
#15 0x4301bc in TPKGMANAGER__IDECOMPONENTPALETTEENDUPDATE (SENDER=0x34bd3d4, PALETTECHANGED=true, this=0x12d00a0) at pkgmanager.pas:262
#16 0x51cba8 in TBASECOMPONENTPALETTE__DOENDUPDATE (CHANGED=true, this=0x34bd3d4) at componentreg.pas:423
#17 0x4a9002 in TCOMPONENTPALETTE__DOENDUPDATE (CHANGED=true, this=0x34bd3d4) at componentpalette.pas:250
#18 0x51cdcf in TBASECOMPONENTPALETTE__ENDUPDATE (this=0x34bd3d4) at componentreg.pas:493
#19 0x435869 in TPKGMANAGER__LOADINSTALLEDPACKAGES (this=0x12d00a0) at pkgmanager.pas:1552
#20 0x63808d in TMAINIDE__CREATE (THEOWNER=0x8eccb8, this=0x343b9d4) at main.pp:895
#21 0x6735bb in TAPPLICATION__CREATEFORM (INSTANCECLASS=0x818fbc, REFERENCE=void, this=0x8eccb8) at application.inc:1087 #22 0x6f468f in main () at lazarus.pp:75

Reply by email

Micha Nelissen
to Vincent Snijders
Mattias Gaertner wrote 5 lines
CreatePixmapIndirect is only a workaround to load xpms under win32. It is very slow due to string operations. We can either add a further workaround or switch to fpc 1.0.11/1.9.1 and use fpImage as default. Micha, is this possible for the win32 intf?

Yes, fpImages work with both 1.9.x and 1.0.11 on win32.

Micha.

Reply by email

Mattias Gaertner
to Vincent Snijders: Recently lazarus stopped starting up under win32. I think it is caused by the recent…
Show quoted text 43 lines
On Thu, 25 Dec 2003 12:56:51 +0100 Mattias Gaertner wrote: > On Wed, 24 Dec 2003 23:48:28 +0100 Vincent Snijders > wrote: > > > On Wed, 24 Dec 2003 17:09:15 +0100 > > Vincent Snijders wrote: > > > > > Hi, > > > > > > Recently lazarus stopped starting up under win32. I think it is > > > caused by the recent additions of components to the toolbar. The > > > win32 interface can't read the icons without raising an exception. > > > Appended is the backtrace. > > > > > > I changed line 722 of win32winapi.inc: > > > until (i>=AList.Count); > > > > > > This prevented the crash. I hope somebody with more experience > > > with bitmaps and pixmaps can take a look at this to see if it is > > > correct. > > > > Further research showed that the problem is caused by xpm-files with > > these kind of lines in the color map: > > "$ c #C0C0C0", > > "% c red", > > "& c green", > > "* c yellow", > > > > The first line is parsed correctly, but the others not. The function > > CreatePixmapIndirect doesn't support symbolic color names (like > > red), only RGB-values. > > > > So the change mentioned above isn't a fix, it only prevents a crash. > > CreatePixmapIndirect is only a workaround to load xpms under win32. It > is very slow due to string operations. > > We can either add a further workaround or switch to fpc 1.0.11/1.9.1 > and use fpImage as default. I would prefer to switch and use fpImage. I would like to leave the implementation to someone else though. ;-)

I'm working with it since a few months. It's faster and more comfortable. The missing piece is the palette support and the win32 intf.

In the meantime I could send a patch which ignores the labelled colors and gives them the transparent color.

ok

> Micha, is this possible for the win32 > intf?

?

Mattias

Reply by email

Vincent Snijders
to Vincent Snijders: Recently lazarus stopped starting up under win32. I think it is caused by the recent…
Show quoted text 38 lines
On Wed, 24 Dec 2003 23:48:28 +0100 Vincent Snijders wrote: > On Wed, 24 Dec 2003 17:09:15 +0100 > Vincent Snijders wrote: > > > Hi, > > > > Recently lazarus stopped starting up under win32. I think it is > > caused by the recent additions of components to the toolbar. The > > win32 interface can't read the icons without raising an exception. > > Appended is the backtrace. > > > > I changed line 722 of win32winapi.inc: > > until (i>=AList.Count); > > > > This prevented the crash. I hope somebody with more experience > > with bitmaps and pixmaps can take a look at this to see if it is > > correct. > > Further research showed that the problem is caused by xpm-files with > these kind of lines in the color map: > "$ c #C0C0C0", > "% c red", > "& c green", > "* c yellow", > > The first line is parsed correctly, but the others not. The function > CreatePixmapIndirect doesn't support symbolic color names (like > red), only RGB-values. > > So the change mentioned above isn't a fix, it only prevents a crash. CreatePixmapIndirect is only a workaround to load xpms under win32. It is very slow due to string operations. We can either add a further workaround or switch to fpc 1.0.11/1.9.1 and use fpImage as default.

I would prefer to switch and use fpImage. I would like to leave the implementation to someone else though. ;-)

In the meantime I could send a patch which ignores the labelled colors and gives them the transparent color.

Micha, is this possible for the win32 intf?

Vincent.

Reply by email

Vincent Snijders
to Vincent Snijders: Recently lazarus stopped starting up under win32. I think it is caused by the recent…
Show quoted text 59 lines
On Fri, 26 Dec 2003 17:35:47 +0100 Vincent Snijders wrote: > On Thu, 25 Dec 2003 12:56:51 +0100 > Mattias Gaertner wrote: > > > On Wed, 24 Dec 2003 23:48:28 +0100 Vincent Snijders > > wrote: > > > > > On Wed, 24 Dec 2003 17:09:15 +0100 > > > Vincent Snijders wrote: > > > > > > > Hi, > > > > > > > > Recently lazarus stopped starting up under win32. I think it > > > > is caused by the recent additions of components to the > > > > toolbar. The win32 interface can't read the icons without > > > > raising an exception. Appended is the backtrace. > > > > > > > > I changed line 722 of win32winapi.inc: > > > > until (i>=AList.Count); > > > > > > > > This prevented the crash. I hope somebody with more experience > > > > with bitmaps and pixmaps can take a look at this to see if it > > > > is correct. > > > > > > Further research showed that the problem is caused by xpm-files > > > with these kind of lines in the color map: > > > "$ c #C0C0C0", > > > "% c red", > > > "& c green", > > > "* c yellow", > > > > > > The first line is parsed correctly, but the others not. The > > > function CreatePixmapIndirect doesn't support symbolic color > > > names (like red), only RGB-values. > > > > > > So the change mentioned above isn't a fix, it only prevents a > > > crash. > > > > CreatePixmapIndirect is only a workaround to load xpms under > > win32. It is very slow due to string operations. > > > > We can either add a further workaround or switch to fpc > > 1.0.11/1.9.1 and use fpImage as default. > I would prefer to switch and use fpImage. I would like to leave the > implementation to someone else though. ;-) I'm working with it since a few months. It's faster and more comfortable. The missing piece is the palette support and the win32 intf. > In the meantime I could send a patch which ignores the labelled > colors and gives them the transparent color. ok

Attached. Warning, this doesn't make the pixmap look nice ;-).

-------------- next part --------------
A non-text attachment was scrubbed...
Name: gz00058.gz
Type: application/octet-stream
Size: 455 bytes
Desc: "pixmap.patch.gz"
Url : http://localhost/pipermail/lazarus/attachments/20031226/262bc064/gz00058.obj

Reply by email

Micha Nelissen
to Vincent Snijders: Recently lazarus stopped starting up under win32. I think it is caused by the recent…
Vincent Snijders wrote 15 lines
On Fri, 26 Dec 2003 18:28:49 +0100 Mattias Gaertner wrote: >On Fri, 26 Dec 2003 17:35:47 +0100 Vincent Snijders > wrote: > >>In the meantime I could send a patch which ignores the labelled >>colors and gives them the transparent color. > >ok > > Attached. Warning, this doesn't make the pixmap look nice ;-).

Thanks, applied.

Micha.

Reply by email