View Issue Details

IDProjectCategoryView StatusLast Update
0037110LazarusIDEpublic2020-05-20 21:04
Reporterrusty_robot Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
Product Version2.1 (SVN) 
Summary0037110: gtk3: Access violation on IDECommandList.RemoveCustomUpdateEvent
DescriptionLazarus built with LCL_PLATFORM=gtk3 crashes on start:

```
[FORMS.PP] ExceptionOccurred
  Sender=EAccessViolation
  Exception=Access violation
  Stack trace:
  $00000000009DB489 line 1586 of idecommands.pas
  $0000000000525A1D line 1667 of main.pp
  $00000000004B7B30 line 288 of ../inc/objpas.inc
```

Under gdb:
```
Thread 1 "lazarus" received signal SIGSEGV, Segmentation fault.
0x00000000009db489 in REMOVECUSTOMUPDATEEVENT (this=0x0, AEVENT=...) at idecommands.pas:1586
1586 FCustomUpdateEvents.Remove(TMethod(aEvent));
(gdb) bt
#0 0x00000000009db489 in REMOVECUSTOMUPDATEEVENT (this=0x0, AEVENT=...) at idecommands.pas:1586
0000001 0x0000000000525a1d in DESTROY (this=0x7ffff45b7730, vmt=0x1) at main.pp:1667
0000002 0x00000000004b7b30 in FREE (this=0x0) at ../inc/objpas.inc:288
0000003 0x00007fffffffdde0 in ()
0000004 0x00000000004a597b in main () at lazarus.pp:166
```
Additional InformationEnvironment: Slackware-current, gtk+3-3.24.18
TagsNo tags attached.
Fixed in Revision
LazTarget
WidgetsetGTK 3
Attached Files

Activities

rusty_robot

2020-05-18 21:35

reporter  

full_log.txt (2,711 bytes)   
(lazarus:8440): Gtk-CRITICAL **: 21:15:39.617: gtk_widget_set_events: assertion '!_gtk_widget_get_realized (widget)' failed
LAZARUS END - cleaning up ...
[FORMS.PP] ExceptionOccurred 
  Sender=EAccessViolation
  Exception=Access violation
  Stack trace:
  $00000000009DB489 line 1586 of idecommands.pas
  $0000000000525A1D line 1667 of main.pp
  $00000000004B7B30 line 288 of ../inc/objpas.inc
TApplication.HandleException: EAccessViolation
Access violation
  Stack trace:
  $00000000009DB489 line 1586 of idecommands.pas
  $0000000000525A1D line 1667 of main.pp
  $00000000004B7B30 line 288 of ../inc/objpas.inc
Exception at 00000000009DB489: EAccessViolation:
Access violation.
[FORMS.PP] ExceptionOccurred 
  Sender=EAccessViolation
  Exception=Access violation
  Stack trace:
  $00000000009DB489 line 1586 of idecommands.pas
  $0000000000525A1D line 1667 of main.pp
  $00000000004B7B30 line 288 of ../inc/objpas.inc
  $00000000004F9DC6 line 1948 of forms.pp
  $00000000004BC219 line 972 of ../inc/system.inc
  $00000000004B7B30 line 288 of ../inc/objpas.inc
TApplication.HandleException: EAccessViolation
Access violation
  Stack trace:
  $00000000009DB489 line 1586 of idecommands.pas
  $0000000000525A1D line 1667 of main.pp
  $00000000004B7B30 line 288 of ../inc/objpas.inc
  $00000000004F9DC6 line 1948 of forms.pp
  $00000000004BC219 line 972 of ../inc/system.inc
  $00000000004B7B30 line 288 of ../inc/objpas.inc
Exception at 00000000009DB489: EAccessViolation:
Access violation.
[FORMS.PP] ExceptionOccurred 
  Sender=EAccessViolation
  Exception=Access violation
  Stack trace:
  $00000000009DB489 line 1586 of idecommands.pas
  $0000000000525A1D line 1667 of main.pp
  $000000000058B34D line 513 of ../objpas/classes/compon.inc
  $00000000004B7B30 line 288 of ../inc/objpas.inc
  $00000000004F69E9 line 40 of interfaces.pp
  $00000000004BC00E line 922 of ../inc/system.inc
  $00000000004B7B30 line 288 of ../inc/objpas.inc
  $00000000004F9DC6 line 1948 of forms.pp
  $00000000004BC219 line 972 of ../inc/system.inc
  $00000000004B7B30 line 288 of ../inc/objpas.inc
TApplication.HandleException: EAccessViolation
Access violation
  Stack trace:
  $00000000009DB489 line 1586 of idecommands.pas
  $0000000000525A1D line 1667 of main.pp
  $000000000058B34D line 513 of ../objpas/classes/compon.inc
  $00000000004B7B30 line 288 of ../inc/objpas.inc
  $00000000004F69E9 line 40 of interfaces.pp
  $00000000004BC00E line 922 of ../inc/system.inc
  $00000000004B7B30 line 288 of ../inc/objpas.inc
  $00000000004F9DC6 line 1948 of forms.pp
  $00000000004BC219 line 972 of ../inc/system.inc
  $00000000004B7B30 line 288 of ../inc/objpas.inc
Exception at 00000000009DB489: EAccessViolation:
Access violation.
full_log.txt (2,711 bytes)   

rusty_robot

2020-05-18 21:37

reporter   ~0122914

This is svn r63183

Anton Kavalenka

2020-05-19 09:38

reporter   ~0122924

It is double fault. Application starts shutting down on start because of exception. Exception handler raised another exception.
Could you get the gdb trace first setting the break on fpc_raiseexception?

rusty_robot

2020-05-20 21:04

reporter   ~0122964

Ok, I did it now:

    (gdb) break fpc_raiseexception
    Breakpoint 1 at 0x4b8eb0: file ../inc/except.inc, line 181.
    (gdb) run
    Starting program: /usr/local/share/lazarus/lazarus
    [Thread debugging using libthread_db enabled]
    Using host libthread_db library "/lib64/libthread_db.so.1".
    [New Thread 0x7ffff5af1700 (LWP 27450)]
    [New Thread 0x7ffff52f0700 (LWP 27451)]
    Hint: (lazarus) [TMainIDE.ParseCmdLineOptions] PrimaryConfigPath="/home/user/.lazarus"
    Hint: (lazarus) [TMainIDE.ParseCmdLineOptions] SecondaryConfigPath="/etc/lazarus"

    (lazarus:27446): Gtk-CRITICAL **: 20:46:35.305: gtk_widget_set_events: assertion '!_gtk_widget_get_realized (widget)' failed
    LAZARUS END - cleaning up ...

    Thread 1 "lazarus" received signal SIGSEGV, Segmentation fault.
    0x00000000009db489 in REMOVECUSTOMUPDATEEVENT (this=0x0, AEVENT=...) at idecommands.pas:1586
    1586 FCustomUpdateEvents.Remove(TMethod(aEvent));
    (gdb) continue
    Continuing.

    Thread 1 "lazarus" hit Breakpoint 1, fpc_raiseexception (OBJ=0x7ffff7fb9720, ANADDR=0x9db489, AFRAME=0x7fffffffda70)
        at ../inc/except.inc:181
    181 begin
    (gdb) bt
    #0 fpc_raiseexception (OBJ=0x7ffff7fb9720, ANADDR=0x9db489, AFRAME=0x7fffffffda70) at ../inc/except.inc:181
    0000001 0x00000000004f2d87 in RUNERRORTOEXCEPT (ERRNO=216, ADDRESS=0x9db489, FRAME=0x7fffffffda70) at ../objpas/sysutils/sysutils.inc:433
    0000002 0x0000000000000008 in ()
    0000003 0x00007fffffffd600 in ()
    0000004 0x0000000000000016 in ()
    0000005 0x0000000000000000 in ()

I forgot to mention, this happens after I press Upgrade in the configuration upgrade dialog.
If I use another widgetset to get past this point, I get a different exception when restarting again with gtk3, see mainbar_gtk3wsmenus_traceback.txt.
mainbar_gtk3wsmenus_traceback.txt (2,220 bytes)   
[FORMS.PP] ExceptionOccurred 
  Sender=EAccessViolation
  Exception=Access violation
  Stack trace:
  $0000000000D5D63B line 847 of mainbar.pas
  $0000000000531DE7 line 3881 of main.pp
  $0000000000525A03 line 1665 of main.pp
  $0000000000525684 line 1624 of main.pp
  $00000000004A57BF line 141 of lazarus.pp
TApplication.HandleException: EAccessViolation
Access violation
  Stack trace:
  $0000000000D5D63B line 847 of mainbar.pas
  $0000000000531DE7 line 3881 of main.pp
  $0000000000525A03 line 1665 of main.pp
  $0000000000525684 line 1624 of main.pp
  $00000000004A57BF line 141 of lazarus.pp
Hint: (lazarus) [TMainIDE.Destroy] B  -> inherited Destroy... TMainIDE
Hint: (lazarus) [TMainIDE.Destroy] END


Thread 1 "lazarus" received signal SIGSEGV, Segmentation fault.
0x0000000000896937 in CREATEHANDLE (self=0x7ffff45b9500, AMENUITEM=0x7ffff4ab32a0) at gtk3wsmenus.pp:351
351       if ((not AMenuItem.Parent.HasParent) and (AMenuItem.GetParentMenu is TMainMenu)) then
(gdb) bt
#0  0x0000000000896937 in CREATEHANDLE (self=0x7ffff45b9500, AMENUITEM=0x7ffff4ab32a0) at gtk3wsmenus.pp:351
#1  0x000000000077e909 in CREATEHANDLE (this=0x7ffff4ab32a0) at include/menuitem.inc:136
#2  0x0000000000780110 in HANDLENEEDED (this=0x7ffff4ab32a0) at include/menuitem.inc:745
#3  0x0000000000780553 in RECREATEHANDLE (this=0x7ffff4ab32a0) at include/menuitem.inc:848
#4  0x0000000000896cf4 in UPDATEMENUICON (self=0x7ffff45b9500, AMENUITEM=0x7ffff4ab32a0, HASICON=false, AICON=0x0)
    at gtk3wsmenus.pp:560
#5  0x0000000000782178 in UPDATEWSICON (this=0x7ffff4ab32a0) at include/menuitem.inc:1563
#6  0x0000000000782018 in UPDATEIMAGE (this=0x7ffff4ab32a0, FORCED=true) at include/menuitem.inc:1541
#7  0x0000000000782068 in UPDATEIMAGES (this=0x7ffff4ab32a0, FORCED=true) at include/menuitem.inc:1551
#8  0x000000000077d84d in SETIMAGES (this=0x7fffef7fbd40, AVALUE=0x7ffff45b9000) at include/menu.inc:53
#9  0x000000000055e616 in SETUPMAINMENU (this=0x7ffff4679730) at mainbase.pas:993
#10 0x0000000000529f79 in SETUPMAINMENU (this=0x7ffff4679730) at main.pp:2593
#11 0x00000000005252e6 in CREATE (this=0x7ffff4679730, vmt=0x1, THEOWNER=0x7ffff5b55b50) at main.pp:1569
#12 0x00000000004a57bf in main () at lazarus.pp:141

Issue History

Date Modified Username Field Change
2020-05-18 21:35 rusty_robot New Issue
2020-05-18 21:35 rusty_robot File Added: full_log.txt
2020-05-18 21:37 rusty_robot Note Added: 0122914
2020-05-19 09:38 Anton Kavalenka Note Added: 0122924
2020-05-20 21:04 rusty_robot Note Added: 0122964
2020-05-20 21:04 rusty_robot File Added: mainbar_gtk3wsmenus_traceback.txt