Here is a better debugger backtrace. Tested with FPC trunk from few weeks ago, compiled with debug info.
#0 WRITEPROPERTY(0x7fffdae88060, 0x7fffd59ed390, 0x234ddfd) at ../objpas/classes/writer.inc:895
#1 WRITEPROPERTIES(0x7fffdae88060, 0x7fffd59ed390) at ../objpas/classes/writer.inc:850
#2 WRITECOMPONENTDATA(0x7fffdae88060, 0x7fffd59ed390) at ../objpas/classes/writer.inc:764
#3 WRITESTATE(0x7fffd59ed390, 0x7fffdae88060) at ../objpas/classes/compon.inc:454
#4 WRITECOMPONENT(0x7fffdae88060, 0x7fffd59ed390) at ../objpas/classes/writer.inc:688
#5 COPYSELECTIONTOSTREAM(0x7fffee02d9b0, 0x7fffda3b94c0) at ../designer/designer.pp:1159
#6 ADDUNDOACTION(0x7fffee02d9b0, 0x7fffd59ed390, UOPADD, true, 0x1b695b0 'Name', {VTYPE = 256, RES1 = 0, RES2 = 0, RES3 = 0, VSMALLINT = 0, VINTEGER = 0, VSINGLE = 0, VDOUBLE = 0, VDATE = 0, VCURRENCY = 0, VOLESTR = 0x0, VDISPATCH = 0x0, VERROR = 0, VBOOLEAN = false, VUNKNOWN = 0x0, VSHORTINT = 0, VBYTE = 0, VWORD = 0, VLONGWORD = 0, VINT64 = 0, VQWORD = 0, VWORD64 = 0, VSTRING = 0x0, VANY = 0x0, VARRAY = 0x0, VPOINTER = 0x0, VRECORD = 0x0, PRECINFO = 0x0, VLONGS = {0, 0, 0}, VWORDS = {0, 0, 0, 0, 0, 0, 0}, VBYTES = {0 <repeats 14 times>}}, {VTYPE = 256, RES1 = 0, RES2 = 0, RES3 = 0, VSMALLINT = -27368, VINTEGER = -715877096, VSINGLE = -1.46085511e+13, VDOUBLE = 6.9533204388070265e-310, VDATE = 6.9533204388070265e-310, VCURRENCY = 140736772478232, VOLESTR = 0x7fffd5549518 #21569#31059#17774#26980#12660#61184#44478#61406#44478#222, VDISPATCH = 0x7fffd5549518, VERROR = -715877096, VBOOLEAN = 38168, VUNKNOWN = 0x7fffd5549518, VSHORTINT = 24, VBYTE = 24, VWORD = 38168, VLONGWORD = 3579090200, VINT64 = 140736772478232, VQWORD = 140736772478232, VWORD64 = 140736772478232, VSTRING = 0x7fffd5549518, VANY = 0x7fffd5549518, VARRAY = 0x7fffd5549518, VPOINTER = 0x7fffd5549518, VRECORD = 0x7fffd5549518, PRECINFO = 0x0, VLONGS = {0, -715877096, 32767}, VWORDS = {0, 0, 0, 38168, 54612, 32767, 0}, VBYTES = {0, 0, 0, 0, 0, 0, 24, 149, 84, 213, 255, 127, 0, 0}}) at ../designer/designer.pp:1857
#7 ADDCOMPONENT(0x7fffee02d9b0, 0x7fffdb2eac00, 0x234a638, 0x7fffee01d6f0, 39, 194, 0, 0) at ../designer/designer.pp:778
#8 DOADDCOMPONENT(0x7fffffffcf30) at ../designer/designer.pp:2412
#9 MOUSEUPONCONTROL(0x7fffee02d9b0, 0x7fffee01d6f0, {MSG = 514, KEYS = 0, XPOS = 39, YPOS = 194, POS = {X = 39, Y = 194}, DUMMY = 6148914689817575463, RESULT = 0}) at ../designer/designer.pp:2608
#10 ISDESIGNMSG(0x7fffee02d9b0, 0x7fffee01d6f0, {MSG = 514, UNUSEDMSG = 1431655765, WPARAM = 0, LPARAM = 6148914689817575463, RESULT = 0}) at ../designer/designer.pp:3099
#11 WNDPROC(0x7fffee01d6f0, {MSG = 514, UNUSEDMSG = 1431655765, WPARAM = 0, LPARAM = 6148914689817575463, RESULT = 0}) at include/control.inc:2184
#12 WNDPROC(0x7fffee01d6f0, {MSG = 514, UNUSEDMSG = 1431655765, WPARAM = 0, LPARAM = 6148914689817575463, RESULT = 0}) at include/wincontrol.inc:5429
#13 WNDPROC(0x7fffee01d6f0, {MSG = 514, UNUSEDMSG = 1431655765, WPARAM = 0, LPARAM = 6148914689817575463, RESULT = 0}) at include/customform.inc:1437
#14 DELIVERMESSAGE(0x7fffee01d6f0, ) at lclmessageglue.pas:112
#15 DELIVERMESSAGE(0x7fffee01d6f0, ) at gtk2/gtk2proc.inc:3737
#16 DELIVERMOUSEUPMESSAGE(0x2ace680, 0x2f13d70, 0x7fffee01d6f0) at gtk2/gtk2callback.inc:2205
#17 GTKMOUSEBTNRELEASE(0x2f7e4e0, 0x2f13d70, 0x7fffee01d6f0) at gtk2/gtk2callback.inc:2282
This is the code from rtl/objpas/classes/writer.inc with notes added :
procedure TWriter.WriteProperty(Instance: TPersistent; PropInfo: Pointer);
var ...
begin
// do not stream properties without getter
if not Assigned(PPropInfo(PropInfo)^.GetProc) then
exit;
// properties without setter are only allowed, if they are subcomponents
PropType := PPropInfo(PropInfo)^.PropType; <-- PropType: Kind=tkClass, Name=TPopupMenu
if not Assigned(PPropInfo(PropInfo)^.SetProc) then begin
if PropType^.Kind<>tkClass then
exit;
ObjValue := TObject(GetObjectProp(Instance, PropInfo)); <-- ObjValue = Nil !
if not ObjValue.InheritsFrom(TComponent) or
not (csSubComponent in TComponent(ObjValue).ComponentStyle) then
exit;
end;
...
GetObjectProp(Instance, PropInfo) returns Nil, it is assigned to ObjValue. The next line ObjValue.InheritsFrom() obviously crashes.
Note, PropType Name=TPopupMenu which should be OK. I see TPopupMenus in the published section.
Did you change something about PopupMenus recently?
This could be a hiccup in FPC trunk but I understood it happens with other FPC versions, too.
Thus your code changes must have triggered it somehow. It may still be a bug in FPC TWriter code. It should not crash in any situation.