On Mon, Mar 29, 2010 at 10:04 AM, Carsten Haitzler <[email protected]> wrote:
> On Mon, 29 Mar 2010 01:12:31 +0800 Brian Wang <[email protected]>
> said:
>
>> On Sat, Mar 27, 2010 at 12:23 PM, Carsten Haitzler <[email protected]>
>> wrote:
>> > On Sat, 27 Mar 2010 10:14:30 +0800 Brian Wang <[email protected]>
>> > said:
>> >
>> >> Hello all,
>> >>
>> >> With the up-to-date elm_genlist.c, my genlist app will crash. I ran
>> >> it with valgrind and pasted parts of the report at the end of this
>> >> email.
>> >
>> > valgrind is happy with elm's own genlist tests.... what are you doing so
>> > differently?
>>
>> After playing around with my app, I've narrowed it down a bit. Please
>> see the attached code for a simple test case.
>> What I did is adding an elm_button to the end (elm.swallow.end) of
>> each genlist item. Clicking the button will elm_genlist_clear the
>> whole list and re-populate the whole list. And this is when valgrind
>> complains.
>>
>> After a bit of thinking, I realize what I did is probably wrong?!
>> Deleting the whole list while animating the clicking action of the
>> elm_button contained in the list is probably a bad idea... But it
>> didn't go wrong before though.
>> The new _item_queue does immediate action, not waiting for ecore idler
>> to kick in, and that seems to be triggering the problem.
>> I guess I can defer the elm_genlist_clear action if there's no better
>> solution to this problem. :-)
>>
>> Thank you for your time. :-)
>
> aaaah yes. that'd be why. you actually were just lucky before - you managed to
> survive on the fact that evas defers all deletes of objects. the queue thing
> forces a norender which ends up deleting them then - evas designed to work
> this
> way. i'll add some avoidance of this for convenience - but you probably should
> defer the clear as u are indeed deleting yourself from underneath yourself
OK. I think I was actually not "lucky" before since those underlying
bugs may be
lurking somewhere to haunt me some time later. I will defer the clear. :-)
However, it is interesting to note that if the clear happens when an item is
selected (via clicking the item itself), there will be no valgrind complaints.
In a sense, this is deleting itself too.
To feed my curiosity, could you explain the difference between the two cases?
Thanks in advance. :-)
brian
>
>> >
>> >> I reverted to r47414 and it didn't complain anymore and with r47416,
>> >> it complained. Diff of r47414 and r47416:
>> >> Index: elm_genlist.c
>> >> ===================================================================
>> >> --- elm_genlist.c (revision 47414)
>> >> +++ elm_genlist.c (revision 47416)
>> >> @@ -1704,9 +1704,18 @@
>> >> _item_queue(Widget_Data *wd, Elm_Genlist_Item *it)
>> >> {
>> >> if (it->queued) return;
>> >> - if (!wd->queue_idler) wd->queue_idler = ecore_idler_add(_item_idler,
>> >> wd); it->queued = EINA_TRUE;
>> >> wd->queue = eina_list_append(wd->queue, it);
>> >> + while ((wd->queue) && ((!wd->blocks) || (!wd->blocks->next)))
>> >> + {
>> >> + if (wd->queue_idler)
>> >> + {
>> >> + ecore_idler_del(wd->queue_idler);
>> >> + wd->queue_idler = NULL;
>> >> + }
>> >> + _item_idler(wd);
>> >> + }
>> >> + if (!wd->queue_idler) wd->queue_idler = ecore_idler_add(_item_idler,
>> >> wd); }
>> >>
>> >>
>> >> ==24485== Invalid read of size 1
>> >> ==24485== at 0x408401C: evas_object_smart_callback_call
>> >> (evas_object_smart.c:509)
>> >> ==24485== by 0x41D4CEB: _signal_clicked (elm_button.c:149)
>> >> ==24485== by 0x471082E: edje_match_callback_exec_check_finals
>> >> (edje_match.c:400)
>> >> ==24485== by 0x4710C3D: edje_match_callback_exec (edje_match.c:536)
>> >> ==24485== by 0x46FE380: _edje_emit_cb (edje_program.c:1280)
>> >> ==24485== by 0x46FE268: _edje_emit_handle (edje_program.c:1243)
>> >> ==24485== by 0x470DE00: _edje_message_process
>> >> (edje_message_queue.c:612)
>> >> ==24485== by 0x470E101: _edje_message_queue_process
>> >> (edje_message_queue.c:692)
>> >> ==24485== by 0x470D2BB: _edje_job (edje_message_queue.c:172)
>> >> ==24485== by 0x41526D3: _ecore_job_event_handler (ecore_job.c:102)
>> >> ==24485== by 0x414E03F: _ecore_event_call (ecore_events.c:550)
>> >> ==24485== by 0x41538DC: _ecore_main_loop_iterate_internal
>> >> (ecore_main.c:880) ==24485== Address 0x5d229cb is 219 bytes inside a
>> >> block
>> >> of size 220 free'd ==24485== at 0x4024836: free
>> >> (vg_replace_malloc.c:325) ==24485== by 0x4079CDC: evas_object_free
>> >> (evas_object_main.c:79) ==24485== by 0x40A935C:
>> >> evas_render_updates_internal (evas_render.c:1129) ==24485== by
>> >> 0x40A9689: evas_norender (evas_render.c:1248) ==24485== by 0x41EB48E:
>> >> _item_block_recalc (elm_genlist.c:1013) ==24485== by 0x41ECF24:
>> >> _item_idler (elm_genlist.c:1685) ==24485== by 0x41ED072: _item_queue
>> >> (elm_genlist.c:1720) ==24485== by 0x41ED24F: elm_genlist_item_append
>> >> (elm_genlist.c:1773) ==24485== by 0x6D454E7: musicBrowser_populate
>> >> (musicBrowser.c:608) ==24485== by 0x6D446CE: _browser_item_play_clicked
>> >> (musicBrowser.c:132) ==24485== by 0x4084018:
>> >> evas_object_smart_callback_call (evas_object_smart.c:507)
>> >> ==24485== by 0x41D4CEB: _signal_clicked (elm_button.c:149)
>> >> ==24485==
>> >> ==24485== Invalid read of size 4
>> >> ==24485== at 0x408405A: evas_object_smart_callback_call
>> >> (evas_object_smart.c:513)
>> >> ==24485== by 0x41D4CEB: _signal_clicked (elm_button.c:149)
>> >> ==24485== by 0x471082E: edje_match_callback_exec_check_finals
>> >> (edje_match.c:400)
>> >> ==24485== by 0x4710C3D: edje_match_callback_exec (edje_match.c:536)
>> >> ==24485== by 0x46FE380: _edje_emit_cb (edje_program.c:1280)
>> >> ==24485== by 0x46FE268: _edje_emit_handle (edje_program.c:1243)
>> >> ==24485== by 0x470DE00: _edje_message_process
>> >> (edje_message_queue.c:612)
>> >> ==24485== by 0x470E101: _edje_message_queue_process
>> >> (edje_message_queue.c:692)
>> >> ==24485== by 0x470D2BB: _edje_job (edje_message_queue.c:172)
>> >> ==24485== by 0x41526D3: _ecore_job_event_handler (ecore_job.c:102)
>> >> ==24485== by 0x414E03F: _ecore_event_call (ecore_events.c:550)
>> >> ==24485== by 0x41538DC: _ecore_main_loop_iterate_internal
>> >> (ecore_main.c:880) ==24485== Address 0x5d2e49c is 28 bytes inside a block
>> >> of size 36 free'd ==24485== at 0x4024836: free
>> >> (vg_replace_malloc.c:325)
>> >> ==24485== by 0x4084F68: evas_object_smart_free
>> >> (evas_object_smart.c:1029) ==24485== by 0x4079C09: evas_object_free
>> >> (evas_object_main.c:62) ==24485== by 0x40A935C:
>> >> evas_render_updates_internal (evas_render.c:1129) ==24485== by
>> >> 0x40A9689: evas_norender (evas_render.c:1248) ==24485== by 0x41EB48E:
>> >> _item_block_recalc (elm_genlist.c:1013) ==24485== by 0x41ECF24:
>> >> _item_idler (elm_genlist.c:1685) ==24485== by 0x41ED072: _item_queue
>> >> (elm_genlist.c:1720) ==24485== by 0x41ED24F: elm_genlist_item_append
>> >> (elm_genlist.c:1773) ==24485== by 0x6D454E7: musicBrowser_populate
>> >> (musicBrowser.c:608) ==24485== by 0x6D446CE: _browser_item_play_clicked
>> >> (musicBrowser.c:132) ==24485== by 0x4084018:
>> >> evas_object_smart_callback_call (evas_object_smart.c:507)
>> >> ==24485==
>> >> ==24485== Invalid write of size 4
>> >> ==24485== at 0x4084063: evas_object_smart_callback_call
>> >> (evas_object_smart.c:513)
>> >> ==24485== by 0x41D4CEB: _signal_clicked (elm_button.c:149)
>> >> ==24485== by 0x471082E: edje_match_callback_exec_check_finals
>> >> (edje_match.c:400)
>> >> ==24485== by 0x4710C3D: edje_match_callback_exec (edje_match.c:536)
>> >> ==24485== by 0x46FE380: _edje_emit_cb (edje_program.c:1280)
>> >> ==24485== by 0x46FE268: _edje_emit_handle (edje_program.c:1243)
>> >> ==24485== by 0x470DE00: _edje_message_process
>> >> (edje_message_queue.c:612)
>> >> ==24485== by 0x470E101: _edje_message_queue_process
>> >> (edje_message_queue.c:692)
>> >> ==24485== by 0x470D2BB: _edje_job (edje_message_queue.c:172)
>> >> ==24485== by 0x41526D3: _ecore_job_event_handler (ecore_job.c:102)
>> >> ==24485== by 0x414E03F: _ecore_event_call (ecore_events.c:550)
>> >> ==24485== by 0x41538DC: _ecore_main_loop_iterate_internal
>> >> (ecore_main.c:880) ==24485== Address 0x5d2e49c is 28 bytes inside a block
>> >> of size 36 free'd ==24485== at 0x4024836: free
>> >> (vg_replace_malloc.c:325)
>> >> ==24485== by 0x4084F68: evas_object_smart_free
>> >> (evas_object_smart.c:1029) ==24485== by 0x4079C09: evas_object_free
>> >> (evas_object_main.c:62) ==24485== by 0x40A935C:
>> >> evas_render_updates_internal (evas_render.c:1129) ==24485== by
>> >> 0x40A9689: evas_norender (evas_render.c:1248) ==24485== by 0x41EB48E:
>> >> _item_block_recalc (elm_genlist.c:1013) ==24485== by 0x41ECF24:
>> >> _item_idler (elm_genlist.c:1685) ==24485== by 0x41ED072: _item_queue
>> >> (elm_genlist.c:1720) ==24485== by 0x41ED24F: elm_genlist_item_append
>> >> (elm_genlist.c:1773) ==24485== by 0x6D454E7: musicBrowser_populate
>> >> (musicBrowser.c:608) ==24485== by 0x6D446CE: _browser_item_play_clicked
>> >> (musicBrowser.c:132) ==24485== by 0x4084018:
>> >> evas_object_smart_callback_call (evas_object_smart.c:507)
>> >> ==24485==
>> >> ==24485== Invalid read of size 4
>> >> ==24485== at 0x40849EC: evas_object_smart_callbacks_clear
>> >> (evas_object_smart.c:866)
>> >> ==24485== by 0x4084070: evas_object_smart_callback_call
>> >> (evas_object_smart.c:514)
>> >> ==24485== by 0x41D4CEB: _signal_clicked (elm_button.c:149)
>> >> ==24485== by 0x471082E: edje_match_callback_exec_check_finals
>> >> (edje_match.c:400)
>> >> ==24485== by 0x4710C3D: edje_match_callback_exec (edje_match.c:536)
>> >> ==24485== by 0x46FE380: _edje_emit_cb (edje_program.c:1280)
>> >> ==24485== by 0x46FE268: _edje_emit_handle (edje_program.c:1243)
>> >> ==24485== by 0x470DE00: _edje_message_process
>> >> (edje_message_queue.c:612)
>> >> ==24485== by 0x470E101: _edje_message_queue_process
>> >> (edje_message_queue.c:692)
>> >> ==24485== by 0x470D2BB: _edje_job (edje_message_queue.c:172)
>> >> ==24485== by 0x41526D3: _ecore_job_event_handler (ecore_job.c:102)
>> >> ==24485== by 0x414E03F: _ecore_event_call (ecore_events.c:550)
>> >> ==24485== Address 0x5d229a8 is 184 bytes inside a block of size 220
>> >> free'd
>> >> ==24485== at 0x4024836: free (vg_replace_malloc.c:325)
>> >> ==24485== by 0x4079CDC: evas_object_free (evas_object_main.c:79)
>> >> ==24485== by 0x40A935C: evas_render_updates_internal
>> >> (evas_render.c:1129) ==24485== by 0x40A9689: evas_norender
>> >> (evas_render.c:1248) ==24485== by 0x41EB48E: _item_block_recalc
>> >> (elm_genlist.c:1013) ==24485== by 0x41ECF24: _item_idler
>> >> (elm_genlist.c:1685) ==24485== by 0x41ED072: _item_queue
>> >> (elm_genlist.c:1720) ==24485== by 0x41ED24F: elm_genlist_item_append
>> >> (elm_genlist.c:1773) ==24485== by 0x6D454E7: musicBrowser_populate
>> >> (musicBrowser.c:608) ==24485== by 0x6D446CE: _browser_item_play_clicked
>> >> (musicBrowser.c:132) ==24485== by 0x4084018:
>> >> evas_object_smart_callback_call (evas_object_smart.c:507)
>> >> ==24485== by 0x41D4CEB: _signal_clicked (elm_button.c:149)
>> >> ==24485==
>> >> ==24485== Invalid read of size 4
>> >> ==24485== at 0x40849F8: evas_object_smart_callbacks_clear
>> >> (evas_object_smart.c:868)
>> >> ==24485== by 0x4084070: evas_object_smart_callback_call
>> >> (evas_object_smart.c:514)
>> >> ==24485== by 0x41D4CEB: _signal_clicked (elm_button.c:149)
>> >> ==24485== by 0x471082E: edje_match_callback_exec_check_finals
>> >> (edje_match.c:400)
>> >> ==24485== by 0x4710C3D: edje_match_callback_exec (edje_match.c:536)
>> >> ==24485== by 0x46FE380: _edje_emit_cb (edje_program.c:1280)
>> >> ==24485== by 0x46FE268: _edje_emit_handle (edje_program.c:1243)
>> >> ==24485== by 0x470DE00: _edje_message_process
>> >> (edje_message_queue.c:612)
>> >> ==24485== by 0x470E101: _edje_message_queue_process
>> >> (edje_message_queue.c:692)
>> >> ==24485== by 0x470D2BB: _edje_job (edje_message_queue.c:172)
>> >> ==24485== by 0x41526D3: _ecore_job_event_handler (ecore_job.c:102)
>> >> ==24485== by 0x414E03F: _ecore_event_call (ecore_events.c:550)
>> >> ==24485== Address 0x5d2e49c is 28 bytes inside a block of size 36 free'd
>> >> ==24485== at 0x4024836: free (vg_replace_malloc.c:325)
>> >> ==24485== by 0x4084F68: evas_object_smart_free
>> >> (evas_object_smart.c:1029) ==24485== by 0x4079C09: evas_object_free
>> >> (evas_object_main.c:62) ==24485== by 0x40A935C:
>> >> evas_render_updates_internal (evas_render.c:1129) ==24485== by
>> >> 0x40A9689: evas_norender (evas_render.c:1248) ==24485== by 0x41EB48E:
>> >> _item_block_recalc (elm_genlist.c:1013) ==24485== by 0x41ECF24:
>> >> _item_idler (elm_genlist.c:1685) ==24485== by 0x41ED072: _item_queue
>> >> (elm_genlist.c:1720) ==24485== by 0x41ED24F: elm_genlist_item_append
>> >> (elm_genlist.c:1773) ==24485== by 0x6D454E7: musicBrowser_populate
>> >> (musicBrowser.c:608) ==24485== by 0x6D446CE: _browser_item_play_clicked
>> >> (musicBrowser.c:132) ==24485== by 0x4084018:
>> >> evas_object_smart_callback_call (evas_object_smart.c:507)
>> >>
>> >>
>> >> --
>> >> brian
>> >> ------------------
>> >>
>> >> Cool-Karaoke - The smallest recording studio, in your palm, open-sourced
>> >> http://cool-idea.com.tw/
>> >>
>> >> iMaGiNaTiOn iS mOrE iMpOrTaNt tHaN kNoWlEdGe
>> >>
>> >> ------------------------------------------------------------------------------
>> >> Download Intel® Parallel Studio Eval
>> >> Try the new software tools for yourself. Speed compiling, find bugs
>> >> proactively, and fine-tune applications for parallel performance.
>> >> See why Intel Parallel Studio got high marks during beta.
>> >> http://p.sf.net/sfu/intel-sw-dev
>> >> _______________________________________________
>> >> enlightenment-devel mailing list
>> >> [email protected]
>> >> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
>> >>
>> >
>> >
>> > --
>> > ------------- Codito, ergo sum - "I code, therefore I am" --------------
>> > The Rasterman (Carsten Haitzler) [email protected]
>> >
>> >
>>
>>
>>
>> --
>> brian
>> ------------------
>>
>> Cool-Karaoke - The smallest recording studio, in your palm, open-sourced
>> http://cool-idea.com.tw/
>>
>> iMaGiNaTiOn iS mOrE iMpOrTaNt tHaN kNoWlEdGe
>>
>
>
> --
> ------------- Codito, ergo sum - "I code, therefore I am" --------------
> The Rasterman (Carsten Haitzler) [email protected]
>
>
--
brian
------------------
Cool-Karaoke - The smallest recording studio, in your palm, open-sourced
http://cool-idea.com.tw/
iMaGiNaTiOn iS mOrE iMpOrTaNt tHaN kNoWlEdGe
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel