After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 646213 - Hangul Jamo render as U+00xx boxes and produce valgrind errors
Hangul Jamo render as U+00xx boxes and produce valgrind errors
Status: RESOLVED FIXED
Product: pango
Classification: Platform
Component: hangul
1.28.x
Other Linux
: Normal normal
: ---
Assigned To: Changwoo Ryu
pango-maint
Depends on:
Blocks:
 
 
Reported: 2011-03-30 10:00 UTC by Daiki Ueno
Modified: 2011-04-08 00:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
test data to reproduce the bug (4 bytes, text/plain)
2011-03-30 10:00 UTC, Daiki Ueno
  Details
patch to fix valgrind errors (1.22 KB, patch)
2011-03-30 10:01 UTC, Daiki Ueno
none Details | Review

Description Daiki Ueno 2011-03-30 10:00:43 UTC
Created attachment 184677 [details]
test data to reproduce the bug

Downstream bug: https://bugzilla.redhat.com/show_bug.cgi?id=671131

valgrind produces the following error with pango-view test-ko.txt (attached), when no font with Hangul Jamo area is installed:

==1891== Conditional jump or move depends on uninitialised value(s)
==1891==    at 0x54C975C: _pango_cairo_font_private_get_glyph_extents (pangocairo-font.c:694)
==1891==    by 0xCE6DB8A: set_glyph.clone.0 (hangul-fc.c:63)
==1891==    by 0xCE6DEF5: render_syllable (hangul-fc.c:348)
==1891==    by 0xCE6E5D7: hangul_engine_shape (hangul-fc.c:459)

Actually, render_syllable (hangul-fc.c:348) accesses non-initialized memory area.
I'm attaching a patch.
Comment 1 Daiki Ueno 2011-03-30 10:01:56 UTC
Created attachment 184678 [details] [review]
patch to fix valgrind errors
Comment 2 Behdad Esfahbod 2011-04-06 20:04:34 UTC
I think we just need:

-                        PANGO_GET_UNKNOWN_GLYPH (text[i]));
+                        PANGO_GET_UNKNOWN_GLYPH (wc));


Fixed in master.
Comment 3 Daiki Ueno 2011-04-07 09:32:06 UTC
(In reply to comment #2)
> I think we just need:
> 
> -                        PANGO_GET_UNKNOWN_GLYPH (text[i]));
> +                        PANGO_GET_UNKNOWN_GLYPH (wc));
> 
> 
> Fixed in master.

I think this is wrong, since on the previous lines wc is mapped to a code point in "Hangul Compatibility Jamo" area from the original one in "Hangul Jamo" area.

With the previous pango-view example, I see "3131" instead of original "1100".  This is unwanted behavior for some applications like gucharmap.
Comment 4 Behdad Esfahbod 2011-04-07 17:12:50 UTC
Ah right.  I misunderstood your patch.  Fixed it.  Please test.Bug 646213 - Hangul Jamo render as U+00xx boxes and produce valgrind errors
Comment 5 Daiki Ueno 2011-04-08 00:55:29 UTC
Thanks, now it renders "1100" for U+1100 as expected.