View Issue Details

IDProjectCategoryView StatusLast Update
0021431LazarusLCLpublic2012-03-14 10:42
ReporterAndrey ZubarevAssigned ToPaul Ishenin 
PrioritynormalSeveritycrashReproducibilityalways
Status closedResolutionfixed 
Product Version0.9.31 (SVN)Product Build 
Target VersionFixed in Version0.9.31 (SVN) 
Summary0021431: SIGSEGV when re-creating a form with TListView and TImageList
DescriptionAt runtime create, show modal and destroy the form created in designer. On form present TListView and TImageList. In TListView `s displays images from TImageList. More recently, this form was shown only one time when you try to second display - SIGSEGV somewhere inside the reading resources when creating forms. if remove the display of images in TListView - everything works as expected.
Reproduced on win and gtk2.
I attach minimal project with an error.

Lazarus 0.9.31 r35783 FPC 2.7.1 i386-win32-win32/win64
TagsNo tags attached.
Fixed in Revision35968
LazTarget0.99.0
WidgetsetWin32/Win64
Attached Files

Relationships

related to 0021433 closedJonas Maebe FPC Strange behavior Lazarus on the latest revisions FPC 

Activities

2012-03-07 06:42

 

bug.7z (64,840 bytes)

Zeljan Rikalo

2012-03-07 08:07

developer   ~0057346

Last edited: 2012-03-07 08:08

I cannot reproduce it. Tested gtk2,qt and win32 ... everything works fine here.
Lazarus 0.9.31 r35789 FPC 2.6.1 i386-linux-gtk2
Maybe hardware (ram) problem or compiler (2.7.1) related ?

Andrey Zubarev

2012-03-07 08:26

reporter   ~0057347

Compiler - maybe.
Hardware - no, reproduced on different computers.
The error occurs when you second press the button in the test application, the first time everything is fine.

theo

2012-03-07 12:12

reporter   ~0057351

I cannot reproduce it either
Lazarus 0.9.31 r35593M FPC 2.6.0 x86_64-linux-gtk 2

Zeljan Rikalo

2012-03-07 13:34

developer   ~0057354

@Andrey, just tested on pure win7 64bit machine and everything is ok (fpc-2.6.1).

Andrey Zubarev

2012-03-07 13:48

reporter   ~0057356

Yes, it compiler issue. I checked the old fpc 2.7.1 (revision does not know a 2 month ago) on lazarus svn 35783 - works fine. Now installed fpc 2.7.1 rev20348 gives this error.

Juha Manninen

2012-03-07 16:29

developer   ~0057358

I also get SIGSEGV with my new FPC 2.7.1 and the demo. I get it when exiting the demo application, at
  SYSTEM_$$_REMOVE_FREED_FIXED_CHUNKS$POSCHUNK

Memory allocator I guess.

Zeljan Rikalo

2012-03-07 18:41

developer   ~0057361

So I guess that this issue can be resolved, and another opened @fpc mantis.

Andrey Zubarev

2012-03-07 19:03

reporter   ~0057362

@Juha Manninen
>>Memory allocator I guess
Perhaps it is, because sometimes there are strange errors related to memory allocation on the correct parts of the program

@Zeljan Rikalo
ОК

Andrey Zubarev

2012-03-07 19:14

reporter   ~0057363

I created http://bugs.freepascal.org/view.php?id=21433

Maxim Ganetsky

2012-03-08 12:09

developer   ~0057394

I can reproduce this with Lazarus 0.9.31 r35819 FPC 2.6.1 r20465 i386-win32-win32/win64

Program received signal SIGSEGV, Segmentation fault.
0x0042dad3 in CLASSES_TLIST_$__GETCOUNT$$LONGINT ()
(gdb) bt
#0 0x0042dad3 in CLASSES_TLIST_$__GETCOUNT$$LONGINT ()
0000001 0x00436213 in CLASSES_TREADER_$__READCOMPONENT$TCOMPONENT$$TCOMPONENT ()
0000002 0x00436515 in CLASSES_TREADER_$__READDATA$TCOMPONENT ()
0000003 0x004319eb in CLASSES_TCOMPONENT_$__READSTATE$TREADER ()
0000004 0x004fd2c3 in TCONTROL__READSTATE (READER=0x26e02a8,
    this=<error reading variable>) at ./include/control.inc:3567
0000005 0x00437cb9 in CLASSES_TREADER_$__READROOTCOMPONENT$TCOMPONENT$$TCOMPONENT
    ()
0000006 0x0048dad0 in INITCOMPONENT (CLASSTYPE=<incomplete type>,
    parentfp=0x219f1b8) at lresources.pp:3090
0000007 0x0048d94b in INITLAZRESOURCECOMPONENT (INSTANCE=0xd5b20,
    ROOTANCESTOR=<incomplete type>) at lresources.pp:3110
0000008 0x0048cb87 in INITRESOURCECOMPONENT (INSTANCE=0xd5b20,
    ROOTANCESTOR=<incomplete type>) at lresources.pp:801
0000009 0x00419e80 in TCUSTOMFORM__CREATE (AOWNER=0x0, vmt=0x0,
    this=<error reading variable>) at ./include/customform.inc:1864
0000010 0x0041c891 in TFORM__CREATE (THEOWNER=0x0, vmt=0x545184,
    this=<error reading variable>) at ./include/customform.inc:2955
0000011 0x00424f29 in TFORM1__BUTTON1CLICK (SENDER=0xd57b0,
    this=<error reading variable>) at unit1.pas:34
0000012 0x004fb082 in TCONTROL__CLICK (this=<error reading variable>)
    at ./include/control.inc:2664
0000013 0x005121ef in TBUTTONCONTROL__CLICK (this=<error reading variable>)
    at ./include/buttoncontrol.inc:62
0000014 0x0051279f in TCUSTOMBUTTON__CLICK (this=<error reading variable>)
    at ./include/buttons.inc:174
0000015 0x00512da1 in TBUTTON__CLICK (this=<error reading variable>)
    at ./include/buttons.inc:349
0000016 0x0051210a in TBUTTONCONTROL__WMDEFAULTCLICKED (MESSAGE=...,
    this=<error reading variable>) at ./include/buttoncontrol.inc:26
0000017 0x0040ac46 in SYSTEM_TOBJECT_$__DISPATCH$formal ()
0000018 0x005120f0 in TBUTTONCONTROL__ISCHECKEDSTORED (
    this=<error reading variable>) at ./include/buttoncontrol.inc:22
0000019 0x004ee7fe in TWINCONTROL__WNDPROC (MESSAGE=...,
    this=<error reading variable>) at ./include/wincontrol.inc:5276
0000020 0x00536975 in DELIVERMESSAGE (TARGET=0xd57b0, AMESSAGE=void)
    at lclmessageglue.pas:112
0000021 0x004cac1d in WINDOWPROC (WINDOW=590960, MSG=273, WPARAM=22448,
    LPARAM=1049610) at ./win32/win32callback.inc:2404
0000022 0x0053c2e8 in CUSTOMFORMWNDPROC (WINDOW=590960, MSG=273, WPARAM=22448,
    LPARAM=1049610) at ./win32/win32wsforms.pp:375
0000023 0x7e368734 in USER32!GetDC () from H:\WINDOWS\system32\user32.dll
0000024 0x00090470 in ?? ()
0000025 0x7e368816 in USER32!GetDC () from H:\WINDOWS\system32\user32.dll
0000026 0x0053c290 in ADJUSTFORMBOUNDS (AFORM=0x0, SIZERECT=...)
    at ./win32/win32wsforms.pp:322
0000027 0x7e37927b in USER32!GetParent () from H:\WINDOWS\system32\user32.dll
0000028 0x00000000 in ?? ()
(gdb)

Zeljan Rikalo

2012-03-08 12:21

developer   ~0057395

Last edited: 2012-03-08 12:22

@Maxim, it's possible, yesterday I had few crashes with FRESH 2.6.1 on my testing machine, but they come from changes in TStringList.
Now TStringList.Destroy calls Clear; and it killed my zeos components (I've fixed it by calling Clear; before Free for one of zeos TStringLists).
Maybe TList had similar changes in fixes so it's problem.

UPDATE: my production fpc is (used for cross compiling too)

[linda@houston ~]$ ppc386
Free Pascal Compiler version 2.6.1 [2012/01/02] for i386

So without recent merges (eg. TStringList).

Andrey Zubarev

2012-03-09 20:38

reporter   ~0057448

Problem start from the fpc r20265:

* Correctly free objects when destroying stringlist instance
M /trunk/rtl/objpas/classes/stringl.inc

Paul Ishenin

2012-03-14 09:55

manager   ~0057618

Please test and close if ok.

Andrey Zubarev

2012-03-14 10:42

reporter   ~0057621

thanks

Issue History

Date Modified Username Field Change
2012-03-07 06:42 Andrey Zubarev New Issue
2012-03-07 06:42 Andrey Zubarev File Added: bug.7z
2012-03-07 06:42 Andrey Zubarev Widgetset => Win32/Win64
2012-03-07 08:07 Zeljan Rikalo LazTarget => -
2012-03-07 08:07 Zeljan Rikalo Note Added: 0057346
2012-03-07 08:07 Zeljan Rikalo Status new => feedback
2012-03-07 08:08 Zeljan Rikalo Note Edited: 0057346
2012-03-07 08:26 Andrey Zubarev Note Added: 0057347
2012-03-07 12:12 theo Note Added: 0057351
2012-03-07 13:34 Zeljan Rikalo Note Added: 0057354
2012-03-07 13:48 Andrey Zubarev Note Added: 0057356
2012-03-07 16:29 Juha Manninen Note Added: 0057358
2012-03-07 18:41 Zeljan Rikalo Note Added: 0057361
2012-03-07 19:03 Andrey Zubarev Note Added: 0057362
2012-03-07 19:14 Andrey Zubarev Note Added: 0057363
2012-03-08 12:09 Maxim Ganetsky Note Added: 0057394
2012-03-08 12:21 Zeljan Rikalo Note Added: 0057395
2012-03-08 12:22 Zeljan Rikalo Note Edited: 0057395
2012-03-08 16:13 Maxim Ganetsky Relationship added related to 0021433
2012-03-09 20:38 Andrey Zubarev Note Added: 0057448
2012-03-12 22:37 Maxim Ganetsky LazTarget - => 0.99.0
2012-03-12 22:37 Maxim Ganetsky Target Version => 0.99.0
2012-03-14 09:55 Paul Ishenin Fixed in Revision => 35968
2012-03-14 09:55 Paul Ishenin Status feedback => resolved
2012-03-14 09:55 Paul Ishenin Fixed in Version => 0.9.31 (SVN)
2012-03-14 09:55 Paul Ishenin Resolution open => fixed
2012-03-14 09:55 Paul Ishenin Assigned To => Paul Ishenin
2012-03-14 09:55 Paul Ishenin Note Added: 0057618
2012-03-14 10:42 Andrey Zubarev Status resolved => closed
2012-03-14 10:42 Andrey Zubarev Note Added: 0057621