View Issue Details

IDProjectCategoryView StatusLast Update
0031816LazarusIDEpublic2017-05-19 02:02
ReporterJesus ReyesAssigned ToMichl 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformX86_64OSLinuxOS VersionXubuntu 16.04.2
Product Version1.9 (SVN)Product Build54934 
Target Version1.8Fixed in Version1.9 (SVN) 
Summary0031816: AV on closing the IDE
DescriptionIt seems popup menu or menu support related.

See additional Information for a backtrace.

Lazarus 1.9.0 r54934M FPC 3.1.1 x86_64-linux-gtk2
Steps To Reproduceon a terminal window run Lazarus:
./lazarus --skip-last-project
close the IDE
Additional InformationLAZARUS END - cleaning up ...
Hint: (lazarus) [TMainIDE.Destroy] B -> inherited Destroy... TMainIDE
TProjectGroupEditorForm.FormDestroy False
[FORMS.PP] ExceptionOccurred
  Sender=EAccessViolation
  Exception=Access violation
  Stack trace:
  $00007FD59A462EE0
  $00000000005FE11C DESTROY, line 56 of include/popupmenu.inc
  $000000000053CE95 DESTROYCOMPONENTS, line 513 of ../objpas/classes/compon.inc
  $000000000053CDD0 DESTROY, line 491 of ../objpas/classes/compon.inc
  $00000000006AC514 DESTROY, line 135 of lclclasses.pp
  $00000000005C1902 DESTROY, line 4997 of include/control.inc
  $00000000005AFFA1 DESTROY, line 6601 of include/wincontrol.inc
  $00000000005C4127 DESTROY, line 54 of include/customcontrol.inc
  $000000000048C477 DESTROY, line 316 of include/scrollingwincontrol.inc
  $000000000048DCCA DESTROY, line 212 of include/customform.inc
  $000000000053CE95 DESTROYCOMPONENTS, line 513 of ../objpas/classes/compon.inc
  $000000000053CDD0 DESTROY, line 491 of ../objpas/classes/compon.inc
  $0000000000436BEE FREE, line 336 of ../inc/objpas.inc
  $00000000004A5092 FREETHENNIL, line 870 of lclproc.pas
  $00000000004EBBDE DESTROY, line 716 of mainbase.pas
  $00000000004B634C DESTROY, line 1698 of main.pp
  $0000000000436BEE FREE, line 336 of ../inc/objpas.inc
TApplication.HandleException Access violation
  Stack trace:
  $00007FD59A462EE0
  $00000000005FE11C DESTROY, line 56 of include/popupmenu.inc
  $000000000053CE95 DESTROYCOMPONENTS, line 513 of ../objpas/classes/compon.inc
  $000000000053CDD0 DESTROY, line 491 of ../objpas/classes/compon.inc
  $00000000006AC514 DESTROY, line 135 of lclclasses.pp
  $00000000005C1902 DESTROY, line 4997 of include/control.inc
  $00000000005AFFA1 DESTROY, line 6601 of include/wincontrol.inc
  $00000000005C4127 DESTROY, line 54 of include/customcontrol.inc
  $000000000048C477 DESTROY, line 316 of include/scrollingwincontrol.inc
  $000000000048DCCA DESTROY, line 212 of include/customform.inc
  $000000000053CE95 DESTROYCOMPONENTS, line 513 of ../objpas/classes/compon.inc
  $000000000053CDD0 DESTROY, line 491 of ../objpas/classes/compon.inc
  $0000000000436BEE FREE, line 336 of ../inc/objpas.inc
  $00000000004A5092 FREETHENNIL, line 870 of lclproc.pas
  $00000000004EBBDE DESTROY, line 716 of mainbase.pas
  $00000000004B634C DESTROY, line 1698 of main.pp
  $0000000000436BEE FREE, line 336 of ../inc/objpas.inc
Exception at 00007FD59A462EE0: EAccessViolation:
Access violation.
[FORMS.PP] ExceptionOccurred
  Sender=EAccessViolation
  Exception=Access violation
  Stack trace:
  $0000000000917229 REMOVECUSTOMUPDATEEVENT, line 1567 of idecommands.pas
  $00000000004B5E45 DESTROY, line 1615 of main.pp
  $0000000000436BEE FREE, line 336 of ../inc/objpas.inc
  $000000000049C1B7 DOBEFOREFINALIZATION, line 1093 of include/application.inc
  $0000000000489553 BEFOREFINALIZATION, line 1904 of forms.pp
  $000000000043C913 INTERNALEXIT, line 1025 of ../inc/system.inc
  $000000000043CAC9 fpc_do_exit, line 1095 of ../inc/system.inc
  $000000000043CB24 HALT, line 1118 of ../inc/system.inc
  $000000000043866D DOUNHANDLEDEXCEPTION, line 145 of ../inc/except.inc
  $0000000000438A1B fpc_reraise, line 277 of ../inc/except.inc
  $00000000004B63AF DESTROY, of main.pp
  $0000000000436BEE FREE, line 336 of ../inc/objpas.inc
  $00000000004216B1 main, line 160 of lazarus.pp
TApplication.HandleException Access violation
  Stack trace:
  $0000000000917229 REMOVECUSTOMUPDATEEVENT, line 1567 of idecommands.pas
  $00000000004B5E45 DESTROY, line 1615 of main.pp
  $0000000000436BEE FREE, line 336 of ../inc/objpas.inc
  $000000000049C1B7 DOBEFOREFINALIZATION, line 1093 of include/application.inc
  $0000000000489553 BEFOREFINALIZATION, line 1904 of forms.pp
  $000000000043C913 INTERNALEXIT, line 1025 of ../inc/system.inc
  $000000000043CAC9 fpc_do_exit, line 1095 of ../inc/system.inc
  $000000000043CB24 HALT, line 1118 of ../inc/system.inc
  $000000000043866D DOUNHANDLEDEXCEPTION, line 145 of ../inc/except.inc
  $0000000000438A1B fpc_reraise, line 277 of ../inc/except.inc
  $00000000004B63AF DESTROY, of main.pp
  $0000000000436BEE FREE, line 336 of ../inc/objpas.inc
  $00000000004216B1 main, line 160 of lazarus.pp
Exception at 0000000000917229: EAccessViolation:
Access violation.
[FORMS.PP] ExceptionOccurred
  Sender=EAccessViolation
  Exception=Access violation
  Stack trace:
  $0000000000917229 REMOVECUSTOMUPDATEEVENT, line 1567 of idecommands.pas
  $00000000004B5E45 DESTROY, line 1615 of main.pp
  $000000000053CE95 DESTROYCOMPONENTS, line 513 of ../objpas/classes/compon.inc
  $000000000053CDD0 DESTROY, line 491 of ../objpas/classes/compon.inc
  $0000000000757337 DESTROY, line 302 of fcl-base/src/custapp.pp
  $0000000000499BF4 DESTROY, line 165 of include/application.inc
  $0000000000436BEE FREE, line 336 of ../inc/objpas.inc
  $000000000048A20E FREEWIDGETSET, line 2193 of forms.pp
  $0000000000486119 INTERFACES_$$_finalize, line 38 of gtk2/interfaces.pas
  $000000000043C70C FINALIZEUNITS, line 973 of ../inc/system.inc
  $000000000043CA79 INTERNALEXIT, line 1052 of ../inc/system.inc
  $000000000043CAC9 fpc_do_exit, line 1095 of ../inc/system.inc
  $000000000043CB24 HALT, line 1118 of ../inc/system.inc
  $000000000043866D DOUNHANDLEDEXCEPTION, line 145 of ../inc/except.inc
  $0000000000438A1B fpc_reraise, line 277 of ../inc/except.inc
  $00000000004B63AF DESTROY, of main.pp
  $0000000000436BEE FREE, line 336 of ../inc/objpas.inc
TApplication.HandleException Access violation
  Stack trace:
  $0000000000917229 REMOVECUSTOMUPDATEEVENT, line 1567 of idecommands.pas
  $00000000004B5E45 DESTROY, line 1615 of main.pp
  $000000000053CE95 DESTROYCOMPONENTS, line 513 of ../objpas/classes/compon.inc
  $000000000053CDD0 DESTROY, line 491 of ../objpas/classes/compon.inc
  $0000000000757337 DESTROY, line 302 of fcl-base/src/custapp.pp
  $0000000000499BF4 DESTROY, line 165 of include/application.inc
  $0000000000436BEE FREE, line 336 of ../inc/objpas.inc
  $000000000048A20E FREEWIDGETSET, line 2193 of forms.pp
  $0000000000486119 INTERFACES_$$_finalize, line 38 of gtk2/interfaces.pas
  $000000000043C70C FINALIZEUNITS, line 973 of ../inc/system.inc
  $000000000043CA79 INTERNALEXIT, line 1052 of ../inc/system.inc
  $000000000043CAC9 fpc_do_exit, line 1095 of ../inc/system.inc
  $000000000043CB24 HALT, line 1118 of ../inc/system.inc
  $000000000043866D DOUNHANDLEDEXCEPTION, line 145 of ../inc/except.inc
  $0000000000438A1B fpc_reraise, line 277 of ../inc/except.inc
  $00000000004B63AF DESTROY, of main.pp
  $0000000000436BEE FREE, line 336 of ../inc/objpas.inc
Exception at 0000000000917229: EAccessViolation:
Access violation.
TagsNo tags attached.
Fixed in Revisionr54957, r54960, r54988
LazTarget-
Widgetset
Attached Files

Relationships

related to 0031791 resolvedMichl Menu editor unstable after deleting an item 
related to 0029725 resolvedMattias Gaertner Project Groups packages has memory leaks. 

Activities

Mattias Gaertner

2017-05-15 18:11

manager   ~0100321

Works here.
Please update svn and compile with -dDebugLCLComponents.

Zeljan Rikalo

2017-05-17 20:45

developer   ~0100368

I have crashes too.
https://bugs.freepascal.org/view.php?id=31791
Just look at the comments (I've pasted same stack trace, Michael too).
Follow Michaels steps to reproduce (do not save project), now click close button in lazarus, answer no about saving project - I can reproduce it every time (qt and gtk2 ws under linux 64bit).

Michl

2017-05-17 23:06

developer   ~0100375

As written in the related bug report:

On Windows, I have a AV by closing the IDE with openend menu editor. I fixed this in revision 54957. I don't know, if this is the same bug here?!

Mattias Gaertner

2017-05-18 00:21

manager   ~0100378

Does rev 54957 fix it?

Jesus Reyes

2017-05-18 03:02

developer   ~0100382

Lazarus 1.9.0 r54959M FPC 3.1.1 x86_64-linux-gtk2
Compiled with -dDebugLCLComponents
No significative differences.

Michl

2017-05-18 08:04

developer   ~0100385

Fixed in trunk. Please close if OK.

Jesus Reyes

2017-05-18 16:30

developer   ~0100444

Last edited: 2017-05-18 16:50

View 2 revisions

Sorry, still not working here. A little debug info:


it is upon destroying "PopupMenuMore" that the error happens:

513 Acomponent.Destroy;
(gdb) p acomponent^
aviso: can't find linker symbol for virtual table for `TCOMPONENT' value
$38 = {<TPERSISTENT> = {<TOBJECT> = {_vptr$TOBJECT = 0x1f3a108}, FOBSERVERS = 0x0}, FOWNER = 0x0, FNAME = 0x7fffe36e51d8 'PopupMenuMore', FTAG = 0,
  FCOMPONENTS = 0x0, FFREENOTIFIES = 0x7fffe8f257e0, FDESIGNINFO = 6291664, FVCLCOMOBJECT = 0x0, FCOMPONENTSTATE = [CSDESTROYING],
  FCOMPONENTSTYLE = [CSINHERITABLE], COMPONENTSTATE = [CSDESTROYING], COMPONENTSTYLE = [CSINHERITABLE], DESIGNINFO = 6291664, OWNER = 0x0,
  VCLCOMOBJECT = 0x0, NAME = 0x7fffe36e51d8 'PopupMenuMore', TAG = 0}
(gdb) n

Thread 1 "lazarus" hit Breakpoint 2, DESTROY (this=0x7fffe37858e0, vmt=0x1) at include/popupmenu.inc:56
56 DestroyHandle;
(gdb) n

Thread 1 "lazarus" received signal SIGSEGV, Segmentation fault.
0x00007fffe8f25e40 in ?? ()

Michl

2017-05-18 20:50

developer   ~0100458

OK, On 64bit openSUSE Leap 42.2 with GTK2, the error was gone with revision 54960. I'll have a look.

Michl

2017-05-18 21:55

developer   ~0100460

> it is upon destroying "PopupMenuMore" that the error happens

Thanks, now it is more clear. It comes after installed package lazprojectgroups. I can confirm this issue on Win32 too (just create a new project, click Project -> New Project Group to open ProjectGropuEditor, close IDE -> AV). Will see, where it came from.

Juha Manninen

2017-05-18 23:47

developer   ~0100468

Maybe also related to memory leaks in ProjectGroups (0029725).

Michl

2017-05-19 00:18

developer   ~0100472

Here the problem seems to be, that the MenuItems are used twice. First the IDE destroy them. When the ProjectGroupEditor form is closed, the PopupMenu will destroy them too, but the memory adress isn't valid anymore.

Maybe the MenuItems need to be copied (assigned) or a check can do it. I'll see tomorrow.

Issue History

Date Modified Username Field Change
2017-05-15 17:24 Jesus Reyes New Issue
2017-05-15 18:11 Mattias Gaertner Note Added: 0100321
2017-05-17 20:45 Zeljan Rikalo Note Added: 0100368
2017-05-17 20:45 Zeljan Rikalo Relationship added related to 0031791
2017-05-17 23:06 Michl Note Added: 0100375
2017-05-18 00:21 Mattias Gaertner Note Added: 0100378
2017-05-18 00:21 Mattias Gaertner Status new => feedback
2017-05-18 03:02 Jesus Reyes Note Added: 0100382
2017-05-18 03:02 Jesus Reyes Status feedback => new
2017-05-18 07:58 Michl Assigned To => Michl
2017-05-18 07:58 Michl Status new => assigned
2017-05-18 08:04 Michl Fixed in Revision => r54957, r54960
2017-05-18 08:04 Michl Note Added: 0100385
2017-05-18 08:04 Michl Status assigned => resolved
2017-05-18 08:04 Michl Fixed in Version => 1.9 (SVN)
2017-05-18 08:04 Michl Resolution open => fixed
2017-05-18 16:30 Jesus Reyes Note Added: 0100444
2017-05-18 16:50 Jesus Reyes Note Edited: 0100444 View Revisions
2017-05-18 20:50 Michl Note Added: 0100458
2017-05-18 20:50 Michl Status resolved => assigned
2017-05-18 20:50 Michl Resolution fixed => reopened
2017-05-18 21:55 Michl Note Added: 0100460
2017-05-18 23:45 Juha Manninen Relationship added related to 0029725
2017-05-18 23:47 Juha Manninen Note Added: 0100468
2017-05-19 00:18 Michl Note Added: 0100472
2017-05-19 02:02 Mattias Gaertner Fixed in Revision r54957, r54960 => r54957, r54960, r54988
2017-05-19 02:02 Mattias Gaertner Status assigned => resolved
2017-05-19 02:02 Mattias Gaertner Resolution reopened => fixed