Page MenuHomePhabricator

edje_cc: fix crash on image data initialization
Needs ReviewPublic

Authored by YOhoho on Jul 23 2020, 3:52 AM.



Since commit a8538bacce1457a91e28b39a6417eaadb4744b50 a crash occurs when
Images.Set.Image is unused.

To avoid a crash, this patch skips setting image data for unused image sets.

Test Plan

$edje_cc basic.edc


collections {
   set {
      name: "bubble";
      image {
         image: "bubble.png" COMP;

Diff Detail

rEFL core/efl
No Linters Available
No Unit Test Coverage
Build Status
Buildable 17145
Build 11421: arc lint + arc unit
YOhoho created this revision.Jul 23 2020, 3:52 AM
YOhoho requested review of this revision.Jul 23 2020, 3:52 AM

bt when a crash occurs

(gdb) r
Starting program: /usr/bin/edje_cc basic2.edc
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/".
[New Thread 0x7ffff0bfc700 (LWP 4878)]
[New Thread 0x7ffff03fb700 (LWP 4879)]
[Detaching after fork from child process 4880]
Warning: Image 'bubble.png' not used
Warning: Image set 'bubble' not used
  Contains 'bubble.png' size 0x0 -> 0x0

Thread 1 "edje_cc" received signal SIGSEGV, Segmentation fault.
0x000000000040a42f in data_image_sets_init () at ../src/bin/edje/edje_cc_out.c:1473
1473	             set_entry->name = img->entry;
(gdb) bt
#0  0x000000000040a42f in data_image_sets_init () at ../src/bin/edje/edje_cc_out.c:1473
#1  0x000000000040ef72 in data_write () at ../src/bin/edje/edje_cc_out.c:2887
#2  0x00000000004062e3 in main (argc=2, argv=0x7fffffffd8d8) at ../src/bin/edje/edje_cc.c:448
(gdb) q
YOhoho edited the test plan for this revision. (Show Details)Jul 23 2020, 3:53 AM
YOhoho updated this revision to Diff 30890.Jul 23 2020, 4:24 AM
YOhoho retitled this revision from edje_cc: decrease image sets_count if it is unused to edje_cc: fix crash on image data initialization.
YOhoho edited the summary of this revision. (Show Details)

I think it is better to fix crash..