Page MenuHomePhabricator

[bug] can't add group in Menu Edit
Closed, ResolvedPublic3 Story Points

Description

run eflete, open some project, open Menu Edit, add group, set name and press ok - Abort trap: 6

Process: eflete [10239]
Path: /usr/local/bin/eflete
Identifier: eflete
Version: 0
Code Type: X86-64 (Native)
Parent Process: bash [88740]
Responsible: Terminal [88737]
User ID: 501

Date/Time: 2016-07-19 11:06:27.202 +0300
OS Version: Mac OS X 10.9.5 (13F1808)
Report Version: 11
Anonymous UUID: E4F93FF4-4CC1-A8C9-CEC0-E95BAC7A4B09

Sleep/Wake UUID: DAA59D5F-ED7A-4B6D-B74A-51D5BE4DB199

Crashed Thread: 0 Dispatch queue: com.apple.main-thread

Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000

Application Specific Information:
abort() called

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x00007fff9280a866 __pthread_kill + 10
1 libsystem_pthread.dylib 0x00007fff943d335c pthread_kill + 92
2 libsystem_c.dylib 0x00007fff93b9db2e abort + 125
3 eflete 0x0000000104b20798 gm_group_edit_object_load + 344 (group_manager.c:58)
4 eflete 0x0000000104b22bcf _group_load + 239 (group_manager.c:649)
5 eflete 0x0000000104b22aa9 gm_group_add + 217 (group_manager.c:756)
6 eflete 0x0000000104b82103 _btn_add_group_cb + 787 (project_navigator.c:556)
7 libevas.1.dylib 0x000000010555ffdb _eo_evas_smart_cb + 75 (evas_object_smart.c:71)
8 libeo.1.dylib 0x0000000105f19fc8 _eo_base_event_callback_call + 952 (eo_base_class.c:1178)
9 libeo.1.dylib 0x0000000105f1ef88 eo_event_callback_call + 248 (eo_base.eo.c:142)
10 libevas.1.dylib 0x00000001055604d4 evas_object_smart_callback_call + 132 (evas_object_smart.c:840)
11 eflete 0x0000000104b7a132 _shortcut_handle + 274 (shortcuts.c:163)
12 eflete 0x0000000104b7a013 shortcuts_shortcut_send + 19 (shortcuts.c:576)
13 eflete 0x0000000104b731f5 _menu_cb + 453 (menu.c:169)
14 libecore.1.dylib 0x0000000105d2c028 _ecore_call_handler_cb + 40 (ecore_private.h:317)
15 libecore.1.dylib 0x0000000105d2baa7 _ecore_event_call + 503 (ecore_events.c:518)
16 libecore.1.dylib 0x0000000105d33568 _ecore_main_loop_iterate_internal + 552 (ecore_main.c:2345)
17 libecore.1.dylib 0x0000000105d336f3 ecore_main_loop_begin + 211 (ecore_main.c:1286)
18 libelementary.1.dylib 0x0000000104e3d0b9 elm_run + 9 (elm_main.c:1249)
19 eflete 0x0000000104b1e131 elm_main + 3809 (main.c:334)
20 eflete 0x0000000104b1e514 main + 132 (main.c:339)
21 libdyld.dylib 0x00007fff97aea5fd start + 1

ERR<10239>:eina_safety lib/eina/eina_mempool.c:273 eina_mempool_del() safety check failed: mp == NULL
ERR<10239>:eflete ../../src/bin/project_manager/group_manager.c:55 gm_group_edit_object_load() Can't set mmap object
Abort trap: 6

Related Objects

se.osadchy added a subscriber: thiepha.

If we adding group with "copy of" default group - segfault

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 ??? 0x000000056d6f7573 0 + 23310857587
1 libedje.1.dylib 0x000000010550d54f eina_mempool_malloc + 47
2 libedje.1.dylib 0x000000010550d320 mem_alloc_part + 32
3 libeet.1.dylib 0x0000000105d6cb92 _eet_data_descriptor_decode + 274
4 libeet.1.dylib 0x0000000105d71609 eet_data_get_unknown + 1081
5 libeet.1.dylib 0x0000000105d6d372 _eet_data_descriptor_decode + 2290
6 libeet.1.dylib 0x0000000105d71fbc eet_data_get_array + 1740
7 libeet.1.dylib 0x0000000105d6d372 _eet_data_descriptor_decode + 2290
8 libeet.1.dylib 0x0000000105d6c8b3 eet_data_read_cipher + 259
9 libeet.1.dylib 0x0000000105d6da3f eet_data_read + 47
10 libedje.1.dylib 0x0000000105510b4a edje_edit_group_copy + 490
11 eflete 0x0000000104eefdbc editor_group_copy + 252 (editor_group.c:49)
12 eflete 0x0000000104f2b1ea _btn_add_group_cb + 522 (project_navigator.c:471)
13 libevas.1.dylib 0x000000010576f25b _eo_evas_smart_cb + 75
14 libeo.1.dylib 0x0000000105ff6208 _eo_base_event_callback_call + 952
15 libeo.1.dylib 0x0000000105ffb1d8 eo_event_callback_call + 248
16 libevas.1.dylib 0x000000010576f754 evas_object_smart_callback_call + 132
17 eflete 0x0000000104f231f2 _shortcut_handle + 274 (shortcuts.c:163)
18 eflete 0x0000000104f230d3 shortcuts_shortcut_send + 19 (shortcuts.c:576)
19 eflete 0x0000000104f1c2c5 _menu_cb + 453 (menu.c:169)
20 libecore.1.dylib 0x0000000105e3c318 _ecore_call_handler_cb + 40
21 libecore.1.dylib 0x0000000105e3bd97 _ecore_event_call + 503
22 libecore.1.dylib 0x0000000105e43738 _ecore_main_loop_iterate_internal + 552
23 libecore.1.dylib 0x0000000105e438a3 ecore_main_loop_begin + 179
24 libelementary.1.dylib 0x00000001051e69d9 elm_run + 9
25 eflete 0x0000000104ec68c1 elm_main + 3809 (main.c:334)
26 eflete 0x0000000104ec6ca4 main + 132 (main.c:339)
27 libdyld.dylib 0x00007fff923385fd start + 1

raster added a subscriber: raster.Jul 26 2016, 3:48 PM

argh.... ummm... no file or line num? thi smells like a need for a real bt and/or valgrind.

se.osadchy added a comment.EditedJul 29 2016, 5:29 AM

run with: valgrind --leak-check=full --log-file="eflete.log" eflete -r
log (on macOS):

If we adding group with "copy of" default group - segfault
but if set mark in 'alias' - layout created

rimmed edited projects, added Eflete (0.7.0 release); removed Eflete.
NikaWhite edited projects, added efl; removed macOS.
NikaWhite added a subscriber: NikaWhite.

I investigated that issue.

The problem is using edje_cache for edje_edit library. This reproduces on Linux platform too. Need to set number of Edje Collection Cache to 0.
Why it happens:

  1. new group added into cache (edje_edit.c +1829).
 EAPI Eina_Bool
 edje_edit_group_add(Evas_Object *obj, const char *name)
 {
    Edje_Part_Collection_Directory_Entry *de;
    Edje_Part_Collection_Directory_Entry *d;
    .....
  _mempools_add(de);
==>   ed->file->collection_cache = eina_list_prepend(ed->file->collection_cache, pc);
  _edje_cache_coll_clean(ed->file);
because cache size equal 0, the //ed->file->collection_cache// will be empty.
  1. On saving routine going next:
Eina_Bool
_edje_edit_internal_save(Evas_Object *obj, int current_only, Eina_Bool generate_source)
{
   Edje_File *ef;
   Eet_File *eetf;

....

Empty here ==>       EINA_LIST_FOREACH(ef->collection_cache, l, edc)
         {
            INF("** Writing cache Edje_Part_Collection* ed->collection "
                "[id: %d]", edc->id);
            if (!_edje_edit_collection_save(eetf, edc))
              {
                 eet_close(eetf);
                 return EINA_FALSE;
              }
         }
Does not added here ==>       it = eina_hash_iterator_data_new(ef->collection);
       while (eina_iterator_next(it, (void **)&ce))
         {
            if (ce->ref)
              {
                 INF("** Writing hash Edje_Part_Collection* ed->collection "
                     "[id: %d]", ce->id);
                 if (!_edje_edit_collection_save(eetf, ce->ref))
                   {
                      eet_close(eetf);
                      return EINA_FALSE;
                   }
              }
         }
       eina_iterator_free(it);

I think we are need avoid usage edje_cache in case when something need write into edje file.

@raster what do you think about this? Is it correct to skip edje_cache usage in this cases?

NikaWhite set the point value for this task to 3.
FurryMyad moved this task from Wish list to KanBan (Bugs pool) on the Eflete board.
FurryMyad triaged this task as Showstopper Issues priority.
rimmed edited projects, added Eflete (Eflete 0.7.6); removed Eflete.
rimmed moved this task from Backlog to Done on the Eflete (Eflete 0.7.8) board.Nov 7 2016, 4:15 AM
rimmed moved this task from Done to Backlog on the Eflete (Eflete 0.7.8) board.
rimmed moved this task from Eflete 0.7.8 to Pending/3rd party on the Eflete board.
rimmed edited projects, added Eflete; removed Eflete (Eflete 0.7.8).
rimmed closed this task as Resolved.Feb 6 2017, 6:34 AM
rimmed added a subscriber: rimmed.

Long time as resolved. :)