한국어 시스템에서 appstream 프리징 현상.
글쓴이: Yi Soo An@Google / 작성시간: 목, 2018/02/01 - 2:45오후
해당 이슈에 대한 OS 환경, 디버깅 정보는 이미 공식 레포에 이슈화 해놓은게 있어서 링크로 대체를 하겠습니다.
https://github.com/elementary/appcenter/issues/588
appcenter라는 어플리케이션이 초기에 개발되고 eOS에 탑재된 시점부터 버그가 있어왔다고 합니다.
링크 내용대로 디버깅을 해보니 as_pool_search 이후로 프리징이 생기고 있는데
해당 문제는 '오직' 한국어로 시스템 언어 설정을 하면 생기고 기타 언어에서는 전혀 생기지 않습니다.
appcenter뿐만 아니라 appstreamcli (0.11.3) 버전에서도 동일한 증상이 있었으나 0.11.8 컴파일후 테스트에서는 전혀 생기지 않았구요.
한국어 관련된 문제같은데 제 선에선 도저히 실마리를 못 찾겠네요..
* 분류가 여기가 맞는진 모르겠네요.
Forums:


버그 같은데요.
버그 같은데요.
어딘가에 있는 근본적인 버그가 잠재적이었던 버그를 현실화시킨 건지,
아니면 단순히 번역 실수가 잠재적이었던 버그를 현실화 시킨 것인지는 애매합니다.
as_str_replace("calligra", "", "") 처럼 호출되었고, for 문에서 무한루프 돌고 있습니다.
gdb) set args search Calligra (gdb) run Starting program: /usr/bin/appstreamcli search Calligra [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". [New Thread 0x7fffed40d700 (LWP 3306)] [New Thread 0x7fffecc0c700 (LWP 3307)] ^C Thread 1 "appstreamcli" received signal SIGINT, Interrupt. 0x00007ffff6fa004b in as_str_replace (str=str@entry=0x555557364bb0 "calligra", old=0x555555772940 "", new=new@entry=0x7ffff6fbf897 "") at /usr/src/debug/AppStream-0.10.6/src/as-utils.c:454 454 for (r = ret, p = str; (q = strstr(p, old)) != NULL; p = q + oldlen) { Missing separate debuginfos, use: dnf debuginfo-install gvfs-client-1.30.4-1.fc25.x86_64 pcre-8.40-7.fc25.x86_64 (gdb) l 454 449 retlen = strlen(str); 450 451 if ((ret = malloc(retlen + 1)) == NULL) 452 return NULL; 453 454 for (r = ret, p = str; (q = strstr(p, old)) != NULL; p = q + oldlen) { 455 /* this is undefined if q - p > PTRDIFF_MAX */ 456 ptrdiff_t l = q - p; 457 memcpy(r, p, l); 458 r += l; (gdb) p r $1 = (gchar *) 0x55555742cef0 "0\370\024WUU" (gdb) p ret $2 = (gchar *) 0x55555742cef0 "0\370\024WUU" (gdb) p p $3 = (const gchar *) 0x555557364bb0 "calligra" (gdb) p q $4 = <optimized out> (gdb) p old $5 = (const gchar *) 0x555555772940 "" (gdb) p p $6 = (const gchar *) 0x555557364bb0 "calligra" (gdb) p oldlen $7 = 0 (gdb) n 456 ptrdiff_t l = q - p; (gdb) p q $8 = (const gchar *) 0x555557364bb0 "calligra" (gdb) p l $9 = 0 (gdb) p p $10 = (const gchar *) 0x555557364bb0 "calligra" (gdb) p new $11 = (const gchar *) 0x7ffff6fbf897 ""처음부터 따라가보면,(gdb) b as_str
처음부터 따라가보면,
(gdb) b as_str_replace Function "as_str_replace" not defined. Make breakpoint pending on future shared library load? (y or [n]) y Breakpoint 1 (as_str_replace) pending. (gdb) set args search Calligra (gdb) run Starting program: /usr/bin/appstreamcli search Calligra [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". [New Thread 0x7fffed40d700 (LWP 15836)] [New Thread 0x7fffecc0c700 (LWP 15837)] Thread 1 "appstreamcli" hit Breakpoint 1, as_str_replace ( str=str@entry=0x55555742cf70 "calligra", old=0x555555771bf0 "app", new=new@entry=0x7ffff6fbf897 "") at /usr/src/debug/AppStream-0.10.6/src/as-utils.c:437 437 { Missing separate debuginfos, use: dnf debuginfo-install gvfs-client-1.30.4-1.fc25.x86_64 pcre-8.40-7.fc25.x86_64 (gdb) c Continuing. Thread 1 "appstreamcli" hit Breakpoint 1, as_str_replace ( str=str@entry=0x555557365420 "calligra", old=0x555555771c30 "앱", new=new@entry=0x7ffff6fbf897 "") at /usr/src/debug/AppStream-0.10.6/src/as-utils.c:437 437 { (gdb) c Continuing. Thread 1 "appstreamcli" hit Breakpoint 1, as_str_replace ( str=str@entry=0x55555742cf70 "calligra", old=0x555555771e00 "application", new=new@entry=0x7ffff6fbf897 "") at /usr/src/debug/AppStream-0.10.6/src/as-utils.c:437 437 { (gdb) c Continuing. Thread 1 "appstreamcli" hit Breakpoint 1, as_str_replace ( str=str@entry=0x555557365420 "calligra", old=0x555555772800 "애플리케이션", new=new@entry=0x7ffff6fbf897 "") at /usr/src/debug/AppStream-0.10.6/src/as-utils.c:437 437 { (gdb) c Continuing. Thread 1 "appstreamcli" hit Breakpoint 1, as_str_replace ( str=str@entry=0x55555742cf70 "calligra", old=0x555555772820 "package", new=new@entry=0x7ffff6fbf897 "") at /usr/src/debug/AppStream-0.10.6/src/as-utils.c:437 437 { (gdb) c Continuing. Thread 1 "appstreamcli" hit Breakpoint 1, as_str_replace ( str=str@entry=0x555557365420 "calligra", old=0x555555772840 "꾸러미", new=new@entry=0x7ffff6fbf897 "") at /usr/src/debug/AppStream-0.10.6/src/as-utils.c:437 437 { (gdb) c Continuing. Thread 1 "appstreamcli" hit Breakpoint 1, as_str_replace ( str=str@entry=0x55555742cf70 "calligra", old=0x555555772860 "program", new=new@entry=0x7ffff6fbf897 "") at /usr/src/debug/AppStream-0.10.6/src/as-utils.c:437 437 { (gdb) c Continuing. Thread 1 "appstreamcli" hit Breakpoint 1, as_str_replace ( str=str@entry=0x555557365420 "calligra", old=0x555555772880 "프로그램", new=new@entry=0x7ffff6fbf897 "") at /usr/src/debug/AppStream-0.10.6/src/as-utils.c:437 437 { (gdb) c Continuing. Thread 1 "appstreamcli" hit Breakpoint 1, as_str_replace ( str=str@entry=0x55555742cf70 "calligra", old=0x5555557728a0 "programme", new=new@entry=0x7ffff6fbf897 "") at /usr/src/debug/AppStream-0.10.6/src/as-utils.c:437 437 { (gdb) c Continuing. Thread 1 "appstreamcli" hit Breakpoint 1, as_str_replace ( str=str@entry=0x555557365420 "calligra", old=0x5555557728c0 "suite", new=new@entry=0x7ffff6fbf897 "") at /usr/src/debug/AppStream-0.10.6/src/as-utils.c:437 437 { (gdb) c Continuing. Thread 1 "appstreamcli" hit Breakpoint 1, as_str_replace ( str=str@entry=0x55555742cf70 "calligra", old=0x5555557728e0 "모음", new=new@entry=0x7ffff6fbf897 "") at /usr/src/debug/AppStream-0.10.6/src/as-utils.c:437 437 { (gdb) c Continuing. Thread 1 "appstreamcli" hit Breakpoint 1, as_str_replace ( str=str@entry=0x555557365420 "calligra", old=0x555555772900 "tool", new=new@entry=0x7ffff6fbf897 "") at /usr/src/debug/AppStream-0.10.6/src/as-utils.c:437 437 { (gdb) c Continuing. Thread 1 "appstreamcli" hit Breakpoint 1, as_str_replace ( str=str@entry=0x55555742cf70 "calligra", old=0x555555772920 "도구", new=new@entry=0x7ffff6fbf897 "") at /usr/src/debug/AppStream-0.10.6/src/as-utils.c:437 437 { (gdb) c Continuing. Thread 1 "appstreamcli" hit Breakpoint 1, as_str_replace ( str=str@entry=0x555557365420 "calligra", old=0x555555772940 "", new=new@entry=0x7ffff6fbf897 "") at /usr/src/debug/AppStream-0.10.6/src/as-utils.c:437 437 { (gdb) c Continuing. ^C비교를 위해 ja_KP.utf-8 로 해보면,(gdb
비교를 위해 ja_KP.utf-8 로 해보면,
(gdb) run Starting program: /usr/bin/appstreamcli search Calligra [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". [New Thread 0x7fffed40d700 (LWP 19982)] [New Thread 0x7fffecc0c700 (LWP 19983)] Thread 1 "appstreamcli" hit Breakpoint 1, as_str_replace ( str=str@entry=0x55555ab6ce80 "calligra", old=0x555555770550 "app", new=new@entry=0x7ffff6fbf897 "") at /usr/src/debug/AppStream-0.10.6/src/as-utils.c:437 437 { Missing separate debuginfos, use: dnf debuginfo-install gvfs-client-1.30.4-1.fc25.x86_64 pcre-8.40-7.fc25.x86_64 (gdb) c Continuing. Thread 1 "appstreamcli" hit Breakpoint 1, as_str_replace ( str=str@entry=0x5555557f8470 "calligra", old=0x555555770590 "application", new=new@entry=0x7ffff6fbf897 "") at /usr/src/debug/AppStream-0.10.6/src/as-utils.c:437 437 { (gdb) c Continuing. Thread 1 "appstreamcli" hit Breakpoint 1, as_str_replace ( str=str@entry=0x55555ab6ce80 "calligra", old=0x5555557706a0 "package", new=new@entry=0x7ffff6fbf897 "") at /usr/src/debug/AppStream-0.10.6/src/as-utils.c:437 437 { (gdb) c Continuing. Thread 1 "appstreamcli" hit Breakpoint 1, as_str_replace ( str=str@entry=0x5555557f8470 "calligra", old=0x5555557706c0 "program", new=new@entry=0x7ffff6fbf897 "") at /usr/src/debug/AppStream-0.10.6/src/as-utils.c:437 437 { (gdb) c Continuing. Thread 1 "appstreamcli" hit Breakpoint 1, as_str_replace ( str=str@entry=0x55555ab6ce80 "calligra", old=0x5555557706e0 "programme", new=new@entry=0x7ffff6fbf897 "") at /usr/src/debug/AppStream-0.10.6/src/as-utils.c:437 437 { (gdb) c Continuing. Thread 1 "appstreamcli" hit Breakpoint 1, as_str_replace ( str=str@entry=0x5555557f8470 "calligra", old=0x555555770700 "suite", new=new@entry=0x7ffff6fbf897 "") at /usr/src/debug/AppStream-0.10.6/src/as-utils.c:437 437 { (gdb) c Continuing. Thread 1 "appstreamcli" hit Breakpoint 1, as_str_replace ( str=str@entry=0x55555ab6ce80 "calligra", old=0x555555770720 "tool", new=new@entry=0x7ffff6fbf897 "") at /usr/src/debug/AppStream-0.10.6/src/as-utils.c:437 437 { (gdb) c Continuing. Identifier: stage.desktop [desktop-application] 名前: Stage 要約: Presentation パッケージ: calligra-stage ホームページ: <a href="http://www.calligra.org/stage/ アイコン:" rel="nofollow">http://www.calligra.org/stage/ アイコン:</a> stage.png ... ...> 어딘가에 있는 근본적인 버그가 잠재적이었던 버그를
> 어딘가에 있는 근본적인 버그가 잠재적이었던 버그를 현실화시킨 건지,
> 아니면 단순히 번역 실수가 잠재적이었던 버그를 현실화 시킨 것인지는 애매합니다.
>
한국어 번역 실수인 곳은 다음과 같습니다. (0.10.6 버전 기준으로)
맨 끝의 ';' 가 불필요하게 붙어있습니다. "...;도구;" 가 아니라 "...;도구" 여야 맞죠. 원문을 지키려면.
저 변역된 문장이 appstream 파서에 전달되는 바람에 맨 끝의 ';' 가 "" 단어를 만들어버렸고,
이 "" 라는 단어가 as_str_replace() 에 전달된 거.
감사합니다. 방금 다시 테스트하였고 올바르게 동작됨을
감사합니다. 방금 다시 테스트하였고 올바르게 동작됨을 확인하였습니다.
bushi님 덕분에 실마리를 찾을 수 있게되어 매우 기쁘네요 ㅎ
해당 문제에 대한 workaround 및 버그는 곧 PR 하도록 하겠습니다.
다시 한번 감사드립니다.
---------------
Happy Hacking!
댓글 달기