Sign in Join

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

Mailing lists / lazarus / 2012-08

Is this a bug in LCL or in the FPC heap manager (backtrace inside)

2 messages · 1 person ·

Reply by email Subscribe to this list Your subscription

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

Bernd

When AllowDropFiles is true and dragging files from the same application (to itself) this happens:

It works flawlessly if I use cmem. Its crashing at the very end of GTKDRAGDATARECEIVED() (at the 'end' statement when its cleaning up reference counted variables) and the only dynamic array I can see here is the one that was created in the same function, so it should be the same thread that created it that is now destroying it again. I cannot see any obvious wrongdoing in GtkDragDataReceived(). Using cthreads makes no difference, using cmem makes the error go away. What could this be? how to debug this?

#0 WAITFREE_VAR(0xb7c4b3c4) at
/home/bernd/lazsvn/fixes_2_6/rtl/inc/heap.inc:1084 #1 SYSFREEMEM_VAR(0x844a2f4, 0xb7c4b3c4) at
/home/bernd/lazsvn/fixes_2_6/rtl/inc/heap.inc:1145 #2 SYSFREEMEM(0xb7c4b3d0) at /home/bernd/lazsvn/fixes_2_6/rtl/inc/heap.inc:1187 #3 FREEMEM(0xb7c4b3d0) at /home/bernd/lazsvn/fixes_2_6/rtl/inc/heap.inc:291 #4 FPC_DYNARRAY_CLEAR_INTERNAL(0xb7c4b3d0, 0x83df002) at /home/bernd/lazsvn/fixes_2_6/rtl/inc/dynarr.inc:72 #5 fpc_dynarray_decr_ref(0xb7c4b3d8, 0x83df000) at /home/bernd/lazsvn/fixes_2_6/rtl/inc/dynarr.inc:107 #6 fpc_finalize(0xbfffeaec, 0x83df000) at
/home/bernd/lazsvn/fixes_2_6/rtl/inc/rtti.inc:172
#7 GTKDRAGDATARECEIVED(0x84d2a28, 0x84a65f0, 221, 227, 0xbffff49c, 0, 22001922, 0xb7fc3e40) at ./gtk2/gtk2callback.inc:3329 #8 ?? at :0
#9 g_closure_invoke at :0
#10 ?? at :0
#11 g_signal_emit_valist at :0
#12 g_signal_emit_by_name at :0
#13 ?? at :0
#14 ?? at :0
#15 g_closure_invoke at :0
#16 ?? at :0
#17 g_signal_emit_valist at :0
#18 g_signal_emit_by_name at :0
#19 ?? at :0
#20 gtk_selection_convert at :0
#21 ?? at :0
#22 ?? at :0
#23 gtk_main_do_event at :0
#24 ?? at :0
#25 g_main_context_dispatch at :0
#26 ?? at :0
#27 g_main_context_iteration at :0
#28 TGTK2WIDGETSET__APPPROCESSMESSAGES(<error reading variable>) at ./gtk2/gtk2widgetset.inc:2320
#29 TAPPLICATION__HANDLEMESSAGE(<error reading variable>) at ./include/application.inc:1280
#30 TAPPLICATION__RUNLOOP(<error reading variable>) at ./include/application.inc:1413
#31 TWIDGETSET__APPRUN(0x80932d0 <TAPPLICATION__RUNLOOP>, <error reading variable>) at ./include/interfacebase.inc:60 #32 TAPPLICATION__RUN(<error reading variable>) at ./include/application.inc:1401
#33 :20

Reply by email

Bernd
to Bernd

I found it. I was under the impression that
gtk_selection_data_set_uris() would make a deep copy of all the strings but it seems it will take ownership.

It was my *own* array (on the other end of that drag-drop, on the sender side, same application) that ultimately caused the crash and made it look like the receiving side is only
that i did not crash with cmem.

Reply by email