bugUnifont - Bugs: bug #48440, Unifontpic segmentation fault on...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #48440: Unifontpic segmentation fault on the Supplemental Multilingual Plane

Submitter:  Leo Famulari <lfam>
Submitted:  Thu 07 Jul 2016 07:20:17 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  unifoundry
Open/Closed:  Closed

Jump to the original submission

Sun 09 Jul 2017 09:46:15 PM UTC, comment #7: 

Glad you like it!


Paul Hardy

Paul Hardy <unifoundry>
Group administrator
Sun 09 Jul 2017 05:43:30 PM UTC, comment #6: 

Thanks Paul, it works great. I really appreciate that you took the time to implement this feature!

Leo Famulari <lfam>
Sat 08 Jul 2017 03:57:32 PM UTC, comment #5: 

Unifont version 10.0.04, just uploaded, adds multi-plane support.  Details are in the unifontpic man page, unifontpic texinfo file, and in doc/unifont.pdf.

Have fun!


Paul Hardy

Paul Hardy <unifoundry>
Group administrator
Sun 02 Jul 2017 08:37:03 PM UTC, comment #4: 

I have started working on this and plan to have it available in the next Unifont release. In the next version, an option will allow specifying the Unicode plane.  The plane number will be part of the chart title. I had hoped to include it in the Unifont 10.0.01 release, but spent my time adding quadruple-width glyph support instead for the new CJK Plane 0 ideographs.

Paul Hardy <unifoundry>
Group administrator
Sat 27 Aug 2016 04:35:00 PM UTC, comment #3: 

Because unifontpic expects to have the Plane 0 glyphs in forming its title and axis labels, it would take some work to modify it for higher planes. Therefore I have decided not to modify the program at this point to render higher planes. I will leave this report open for the future.

Paul Hardy <unifoundry>
Group administrator
Sat 09 Jul 2016 06:04:16 PM UTC, comment #2: 

Extending unifontpic so it can render the SMP would be a welcome change, but I understand that it's not a priority. Thanks for your reply!

Leo Famulari <lfam>
Fri 08 Jul 2016 03:23:21 AM UTC, comment #1: 

Leo,

The unifontpic program was only meant to be used with the Basic Multilingual Plane, but that is something I could change in the future.

I didn't design it to handle the Supplemental Multilingual Plane mainly because in the past the SMP did not have a lot of glyphs in it, and it has tens of thousands of unassigned code points.  But now that the SMP has over 8,000 glyphs, it is probably worth extending unifontpic.

I'll postpone this for now but might add the change to the next release.

Thank you,


Paul

Paul Hardy <unifoundry>
Group administrator
Thu 07 Jul 2016 07:20:17 PM UTC, original submission:  

While trying to render a bitmap of the Supplemental Multilingual Plane,
`unifontpic` suffered a segmentation fault.

Based on the traces below, I guessed that unifontpic is expecting
codepoints to be identified by 2 hex bytes, but the SMP uses 3 hex
bytes.

Using `cut` to remove the leading hex byte, the fault is avoided,
although the legends are not rendered with numerals, but instead some
other glyphs:

$ cut -c 3- < plane01.hex | unifontpic > out.bmp

Below, please find the results of `strace`, `ltrace`, and `valgrind`.

The traces were created using `unifontpic` and 'font/plane01/plane01.hex'
from Unifont version 9.0.01, built with GNU Guix. I get similar results
while using a Debian package of 8.0.01.

% strace unifontpic < ./plane01.hex > out.bmp
execve("/home/lfam/.guix-profile/bin/unifontpic", ["unifontpic"], [/* 33 vars */]) = 0
brk(NULL)                               = 0x19af000
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fae38e2c000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/gnu/store/8m00x5x8ykmar27s9248cmhnkdb2n54a-glibc-2.22/lib/tls/x86_64/libgcc_s.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/gnu/store/8m00x5x8ykmar27s9248cmhnkdb2n54a-glibc-2.22/lib/tls/x86_64", 0x7ffdeceae080) = -1 ENOENT (No such file or directory)
open("/gnu/store/8m00x5x8ykmar27s9248cmhnkdb2n54a-glibc-2.22/lib/tls/libgcc_s.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/gnu/store/8m00x5x8ykmar27s9248cmhnkdb2n54a-glibc-2.22/lib/tls", 0x7ffdeceae080) = -1 ENOENT (No such file or directory)
open("/gnu/store/8m00x5x8ykmar27s9248cmhnkdb2n54a-glibc-2.22/lib/x86_64/libgcc_s.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/gnu/store/8m00x5x8ykmar27s9248cmhnkdb2n54a-glibc-2.22/lib/x86_64", 0x7ffdeceae080) = -1 ENOENT (No such file or directory)
open("/gnu/store/8m00x5x8ykmar27s9248cmhnkdb2n54a-glibc-2.22/lib/libgcc_s.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/gnu/store/8m00x5x8ykmar27s9248cmhnkdb2n54a-glibc-2.22/lib", {st_mode=S_IFDIR|0555, st_size=4096, ...}) = 0
open("/gnu/store/v39bh3ln3ncnzhyw0kd12d46kww9747v-gcc-4.9.3-lib/lib/tls/x86_64/libgcc_s.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/gnu/store/v39bh3ln3ncnzhyw0kd12d46kww9747v-gcc-4.9.3-lib/lib/tls/x86_64", 0x7ffdeceae080) = -1 ENOENT (No such file or directory)
open("/gnu/store/v39bh3ln3ncnzhyw0kd12d46kww9747v-gcc-4.9.3-lib/lib/tls/libgcc_s.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/gnu/store/v39bh3ln3ncnzhyw0kd12d46kww9747v-gcc-4.9.3-lib/lib/tls", 0x7ffdeceae080) = -1 ENOENT (No such file or directory)
open("/gnu/store/v39bh3ln3ncnzhyw0kd12d46kww9747v-gcc-4.9.3-lib/lib/x86_64/libgcc_s.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/gnu/store/v39bh3ln3ncnzhyw0kd12d46kww9747v-gcc-4.9.3-lib/lib/x86_64", 0x7ffdeceae080) = -1 ENOENT (No such file or directory)
open("/gnu/store/v39bh3ln3ncnzhyw0kd12d46kww9747v-gcc-4.9.3-lib/lib/libgcc_s.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0p*\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0444, st_size=100848, ...}) = 0
mmap(NULL, 2185952, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fae389f8000
mprotect(0x7fae38a0e000, 2093056, PROT_NONE) = 0
mmap(0x7fae38c0d000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x15000) = 0x7fae38c0d000
close(3)                                = 0
open("/gnu/store/8m00x5x8ykmar27s9248cmhnkdb2n54a-glibc-2.22/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\260\7\2\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0555, st_size=1952536, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fae38e2b000
mmap(NULL, 3821248, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fae38653000
mprotect(0x7fae387ee000, 2097152, PROT_NONE) = 0
mmap(0x7fae389ee000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x19b000) = 0x7fae389ee000
mmap(0x7fae389f4000, 16064, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fae389f4000
close(3)                                = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fae38e2a000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fae38e29000
arch_prctl(ARCH_SET_FS, 0x7fae38e2a700) = 0
mprotect(0x7fae389ee000, 16384, PROT_READ) = 0
mprotect(0x7fae38e2e000, 4096, PROT_READ) = 0
fstat(0, {st_mode=S_IFREG|0644, st_size=496945, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fae38e28000
read(0, "010000:00000041417F4949080808080"..., 4096) = 4096
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x7ffdeceaf000} ---
+++ killed by SIGSEGV +++
zsh: segmentation fault  strace unifontpic < ./plane01.hex > out.bmp

I also found the ltrace helpful:

[... many lines omitted ...]
__isoc99_sscanf(0x7ffd74ffc497, 0x401ff7, 0x7ffd753fdcb0, 24)                                                                = 1
__isoc99_sscanf(0x7ffd74ffc49b, 0x401ff7, 0x7ffd753fdcb4, 24)                                                                = 1
__isoc99_sscanf(0x7ffd74ffc49f, 0x401ff7, 0x7ffd753fdcb8, 24)                                                                = 1
__isoc99_sscanf(0x7ffd74ffc4a3, 0x401ff7, 0x7ffd753fdcbc, 24)                                                                = 1
__isoc99_sscanf(0x7ffd74ffc4a7, 0x401ff7, 0x7ffd753fdcc0, 24)                                                                = 1
__isoc99_sscanf(0x7ffd74ffc4ab, 0x401ff7, 0x7ffd753fdcc4, 24)                                                                = 1
__isoc99_sscanf(0x7ffd74ffc4af, 0x401ff7, 0x7ffd753fdcc8, 24)                                                                = 1
__isoc99_sscanf(0x7ffd74ffc4b3, 0x401ff7, 0x7ffd753fdccc, 24)                                                                = 1
fgets("01005D:00000000000007C0010001003"..., 256, 0x7f077ed1b9c0)                                                            = 0x7ffd74ffc470
__isoc99_sscanf(0x7ffd74ffc470, 0x401ff4, 0x7ffd74ffc46c, 0xa30303030303030)                                                 = 1
strlen("00000000000007C0010001003FF82108"...)                                                                                = 65
__isoc99_sscanf(0x7ffd74ffc477, 0x401ff7, 0x7ffd753fdcd0, 0xc100000000000000)                                                = 1
__isoc99_sscanf(0x7ffd74ffc47b, 0x401ff7, 0x7ffd753fdcd4, 24)                                                                = 1
__isoc99_sscanf(0x7ffd74ffc47f, 0x401ff7, 0x7ffd753fdcd8, 24)                                                                = 1
__isoc99_sscanf(0x7ffd74ffc483, 0x401ff7, 0x7ffd753fdcdc, 24)                                                                = 1
__isoc99_sscanf(0x7ffd74ffc487, 0x401ff7, 0x7ffd753fdce0, 24)                                                                = 1
__isoc99_sscanf(0x7ffd74ffc48b, 0x401ff7, 0x7ffd753fdce4, 24)                                                                = 1
__isoc99_sscanf(0x7ffd74ffc48f, 0x401ff7, 0x7ffd753fdce8, 24)                                                                = 1
__isoc99_sscanf(0x7ffd74ffc493, 0x401ff7, 0x7ffd753fdcec, 24)                                                                = 1
__isoc99_sscanf(0x7ffd74ffc497, 0x401ff7, 0x7ffd753fdcf0, 24)                                                                = 1
__isoc99_sscanf(0x7ffd74ffc49b, 0x401ff7, 0x7ffd753fdcf4, 24)                                                                = 1
__isoc99_sscanf(0x7ffd74ffc49f, 0x401ff7, 0x7ffd753fdcf8, 24)                                                                = 1
__isoc99_sscanf(0x7ffd74ffc4a3, 0x401ff7, 0x7ffd753fdcfc, 24)                                                                = 1
__isoc99_sscanf(0x7ffd74ffc4a7, 0x401ff7, 0x7ffd753fdd00, 24)                                                                = 1
__isoc99_sscanf(0x7ffd74ffc4ab, 0x401ff7, 0x7ffd753fdd04, 24)                                                                = 1
__isoc99_sscanf(0x7ffd74ffc4af, 0x401ff7, 0x7ffd753fdd08, 24)                                                                = 1
__isoc99_sscanf(0x7ffd74ffc4b3, 0x401ff7, 0x7ffd753fdd0c, 24)                                                                = 1
fgets("010080:00000008087F1422222241414"..., 256, 0x7f077ed1b9c0)                                                            = 0x7ffd74ffc470
__isoc99_sscanf(0x7ffd74ffc470, 0x401ff4, 0x7ffd74ffc46c, 0xa30303030313431)                                                 = 1
strlen("00000008087F14222222414141410000"...)                                                                                = 33
__isoc99_sscanf(0x7ffd74ffc477, 0x401ff7, 0x7ffd753fe590, 0xfffffffc <no return ...>
--- SIGSEGV (Segmentation fault) ---
+++ killed by SIGSEGV +++

And the Valgrind:

% valgrind unifontpic < ./plane01.hex > out.bmp
==20660== Memcheck, a memory error detector
==20660== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==20660== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
==20660== Command: unifontpic
==20660==
==20660== Warning: client switching stacks?  SP change: 0xfff000638 --> 0xffec00628
==20660==          to suppress, use: --max-stackframe=4194320 or greater
==20660== Invalid write of size 8
==20660==    at 0x400840: ??? (in /gnu/store/704xxak3d90qnl92bvd4a5rb7y34v7wq-font-gnu-unifont-9.0.01-bin/bin/unifontpic)
==20660==  Address 0xffec00628 is on thread 1's stack
==20660==
==20660== Invalid write of size 8
==20660==    at 0x4C2E017: memset (in /gnu/store/ix0374l9qaijsngb3izmchaj8kzjamcg-valgrind-3.11.0/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==20660==    by 0x400844: ??? (in /gnu/store/704xxak3d90qnl92bvd4a5rb7y34v7wq-font-gnu-unifont-9.0.01-bin/bin/unifontpic)
==20660==    by 0x506968F: (below main) (in /gnu/store/8m00x5x8ykmar27s9248cmhnkdb2n54a-glibc-2.22/lib/libc-2.22.so)
==20660==  Address 0xffec00630 is on thread 1's stack
==20660==
==20660== Invalid read of size 8
==20660==    at 0x4C2E03D: memset (in /gnu/store/ix0374l9qaijsngb3izmchaj8kzjamcg-valgrind-3.11.0/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==20660==    by 0x400844: ??? (in /gnu/store/704xxak3d90qnl92bvd4a5rb7y34v7wq-font-gnu-unifont-9.0.01-bin/bin/unifontpic)
==20660==    by 0x506968F: (below main) (in /gnu/store/8m00x5x8ykmar27s9248cmhnkdb2n54a-glibc-2.22/lib/libc-2.22.so)
==20660==  Address 0xffec00628 is on thread 1's stack
==20660==  in frame #0, created by memset (???:)
==20660==
==20660== Invalid write of size 4
==20660==    at 0x50A1758: _IO_vfscanf (in /gnu/store/8m00x5x8ykmar27s9248cmhnkdb2n54a-glibc-2.22/lib/libc-2.22.so)
==20660==    by 0x50AFCEB: __isoc99_vsscanf (in /gnu/store/8m00x5x8ykmar27s9248cmhnkdb2n54a-glibc-2.22/lib/libc-2.22.so)
==20660==    by 0x50AFC76: __isoc99_sscanf (in /gnu/store/8m00x5x8ykmar27s9248cmhnkdb2n54a-glibc-2.22/lib/libc-2.22.so)
==20660==    by 0x400B88: ??? (in /gnu/store/704xxak3d90qnl92bvd4a5rb7y34v7wq-font-gnu-unifont-9.0.01-bin/bin/unifontpic)
==20660==    by 0x40084E: ??? (in /gnu/store/704xxak3d90qnl92bvd4a5rb7y34v7wq-font-gnu-unifont-9.0.01-bin/bin/unifontpic)
==20660==  Address 0xfff001030 is not stack'd, malloc'd or (recently) free'd
==20660==
==20660==
==20660== Process terminating with default action of signal 11 (SIGSEGV)
==20660==  Access not within mapped region at address 0xFFF001030
==20660==    at 0x50A1758: _IO_vfscanf (in /gnu/store/8m00x5x8ykmar27s9248cmhnkdb2n54a-glibc-2.22/lib/libc-2.22.so)
==20660==    by 0x50AFCEB: __isoc99_vsscanf (in /gnu/store/8m00x5x8ykmar27s9248cmhnkdb2n54a-glibc-2.22/lib/libc-2.22.so)
==20660==    by 0x50AFC76: __isoc99_sscanf (in /gnu/store/8m00x5x8ykmar27s9248cmhnkdb2n54a-glibc-2.22/lib/libc-2.22.so)
==20660==    by 0x400B88: ??? (in /gnu/store/704xxak3d90qnl92bvd4a5rb7y34v7wq-font-gnu-unifont-9.0.01-bin/bin/unifontpic)
==20660==    by 0x40084E: ??? (in /gnu/store/704xxak3d90qnl92bvd4a5rb7y34v7wq-font-gnu-unifont-9.0.01-bin/bin/unifontpic)
==20660==  If you believe this happened as a result of a stack
==20660==  overflow in your program's main thread (unlikely but
==20660==  possible), you can try to increase the size of the
==20660==  main thread stack using the --main-stacksize= flag.
==20660==  The main thread stack size used in this run was 8388608.
==20660==
==20660== HEAP SUMMARY:
==20660==     in use at exit: 0 bytes in 0 blocks
==20660==   total heap usage: 0 allocs, 0 frees, 0 bytes allocated
==20660==
==20660== All heap blocks were freed -- no leaks are possible
==20660==
==20660== For counts of detected and suppressed errors, rerun with: -v
==20660== ERROR SUMMARY: 524276 errors from 4 contexts (suppressed: 1 from 1)
zsh: segmentation fault  valgrind unifontpic < ./plane01.hex > out.bmp

Leo Famulari <lfam>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by unifoundry (Posted a comment)
  • -email is unavailable- added by lfam (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-07-08 unifoundry StatusIn Progress Fixed
        Open/ClosedOpen Closed
    2017-07-02 unifoundry StatusPostponed In Progress
    2016-07-08 unifoundry StatusNone Postponed
        Assigned toNone unifoundry

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code