On Thu, Nov 12, 2009 at 9:36 PM, Gustavo Sverzut Barbieri
<barbi...@profusion.mobi> wrote:
> On Thu, Nov 12, 2009 at 7:59 AM, Brian Wang <brian.wang.0...@gmail.com> wrote:
>> Hello all,
>>
>> I have some problem with elm_label, which is causing the CPU usage to
>> go rocket high (from top: 97+%) and does not show anything.  The test
>> program simply freezes and does not handle 'Ctrl+c'.
>>
>> The problem, which is repeatable, occurs on my ARM board and happens
>> with specific text.  I cannot reproduce the problem on my x86 box.
>>
>> I initially thought there may be problem with the freetype2 library I
>> installed.  However, the same string shows up correctly as the label
>> of elm_button.  I also wrote a simple program with evas and that also
>> shows the string correctly.
>>
>> The string is in Chinese:
>> "追 "
>> which is a very common Chinese character.  There's nothing special about it.
>>
>> The program does not step out of elm_label_label_set(xxx).  The next
>> line of code does not run at all.  The last few lines of the eina log:
>> DBG:eina_stringshare eina_stringshare.c:1194 eina_stringshare_del()
>> str=0x60b74 (style)
>> DBG:eina_stringshare eina_stringshare.c:1227 eina_stringshare_del()
>> str=0x60b74 (style) refs=0, delete.
>> DBG:eina_stringshare eina_stringshare.c:1194 eina_stringshare_del()
>> str=0x62824 (tabstops)
>> DBG:eina_stringshare eina_stringshare.c:1227 eina_stringshare_del()
>> str=0x62824 (tabstops) refs=0, delete.
>> DBG:eina_stringshare eina_stringshare.c:1194 eina_stringshare_del()
>> str=0x6271c (linesize)
>> DBG:eina_stringshare eina_stringshare.c:1227 eina_stringshare_del()
>> str=0x6271c (linesize) refs=0, delete.
>> DBG:eina_stringshare eina_stringshare.c:1194 eina_stringshare_del()
>> str=0x61a14 (linerelsize)
>> DBG:eina_stringshare eina_stringshare.c:1227 eina_stringshare_del()
>> str=0x61a14 (linerelsize) refs=0, delete.
>> DBG:eina_stringshare eina_stringshare.c:1194 eina_stringshare_del()
>> str=0x40169ae5 (
>> )
>>
>> It stops/freezes after that.
>>
>> How do I dig deeper into this?
>
> gdb --pid $TEST_PID
>
> or start from inside gdb. When it reaches this point, just do "Control
> + c" and "bt" to print stack. Then try couple of "n" (next) to see
> what it is doing, why it's looping...
>
> Of course you might be lucky and be inside a tight loop, but sometimes
> it's more complex and you'll take more time doing "n" to see what's
> happening.

OK.  With the help of gdbserver/gdb, I am able to find where it's looping.
However, I don't know what causes it.  Here it goes:
[svn r43601]
evas/src/lib/canvas/evas_object_textblock.c:3152
evas_object_textblock_text_markup_get() calls
escape = _escaped_char_match(p, &adv);
_escaped_char_match() returns "" and 'adv' is set to 0
thus the looping.

Here is the gdb backtrace:
--------------------------------------
(gdb) bt
#0  _escaped_char_match (s=0x780a1 "追 ", adv=0xbec8c490)
    at evas_object_textblock.c:2732
#1  0x4008338c in evas_object_textblock_text_markup_get (obj=0x75380)
    at evas_object_textblock.c:3152
#2  0x40826be0 in _edje_part_recalc_single (ed=0x0, ep=0x0, desc=0x75ae0,
    chosen_desc=0x40300000, rel1_to_x=0x0, rel1_to_y=0x40884c2c,
    rel2_to_x=0x3, rel2_to_y=0x751c0, confine_to=0x0, params=0x749ac, flags=3)
    at edje_calc.c:651
#3  0x408271c8 in _edje_part_recalc (ed=0x10, ep=0x748bc, flags=1)
    at edje_calc.c:1721
#4  0x40828e10 in _edje_recalc_do (ed=0x780a1) at edje_calc.c:224
#5  0x408473b4 in edje_object_size_min_restricted_calc (
    obj=<value optimized out>, minw=0x0, minh=0x4025e27c, restrictedw=0,
    restrictedh=-1) at edje_util.c:2362
#6  0x40847618 in edje_object_size_min_calc (obj=0x780a1, minw=0xbec8c490,
    minh=0x40144860) at edje_util.c:2311
#7  0x40210a6c in _sizing_eval (obj=0x5d060) at elm_label.c:55
#8  0x40210e10 in elm_label_label_set (obj=0x5d060, label=0x8c88 " 追 ")
    at elm_label.c:121
#9  0x00008b1c in elm_main (argc=1, argv=0xbec8cd04) at elm-label-bug-test.c:36
#10 0x00008bac in main (argc=1, argv=0xbec8cd04) at elm-label-bug-test.c:64
--------------------------------------

I don't know what's special about the string that makes it end up the condition.
Checking if (strlen(escape)==0 && adv==0) seems to terminate the loop.
 But I totally have no clue what's going on here...  Fixing it without
knowing what's causing the condition is wrong.

The string "追 " in UTF-8 is of value: 0xe8 0xbf 0xbd 0x20

Is the info above enough to track down the problem?

Thanks in advance. :-)


brian



>
> --
> Gustavo Sverzut Barbieri
> http://profusion.mobi embedded systems
> --------------------------------------
> MSN: barbi...@gmail.com
> Skype: gsbarbieri
> Mobile: +55 (19) 9225-2202
>



-- 
brian
------------------

Cool-Karaoke - The smallest recording studio, in your palm, open-sourced
http://cool-idea.com.tw/

iMaGiNaTiOn iS mOrE iMpOrTaNt tHaN kNoWlEdGe

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to