bugThe FreeType Project - Bugs: bug #30717, ftbench -c 1 takes ages on a 23MiB...

 
 

bug #30717: ftbench -c 1 takes ages on a 23MiB TTF file

Submitted by:  Robert Swiecki <jagger>
Submitted on:  Mon 09 Aug 2010 07:12:02 PM UTC  
 
Severity: 3 - NormalItem Group: Incorrect behaviour
Status: FixedPrivacy: Public
Assigned to: Werner LEMBERG <wl>Open/Closed: Closed
Planned Release: 2.4.3

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 18 Aug 2010 02:22:59 AM UTC, comment #5:

Thanks for testing.

Werner LEMBERG <wl>
Project AdministratorIn charge of this item.
Tue 17 Aug 2010 03:52:47 PM UTC, comment #4:

It's gone now. Hm.. now it runs relatively quickly. It's magic :)

$ time ./ftbench -c 1 sigsegv30_1.ttf
Load : 37.414 us/op
Load_Advances (Normal) : 0.636 us/op
Load_Advances (Fast) : 0.056 us/op
Render : 30.609 us/op
Get_Glyph : 1.194 us/op
Get_CBox : 0.742 us/op
Get_Char_Index : 0.117 us/op
Iterate CMap : 1173.973 us/op
New_Face : 538.111 us/op
Embolden : 0.052 us/op

real 1m24.161s
user 1m24.040s
sys 0m0.040s

Robert Swiecki <jagger>
Tue 17 Aug 2010 06:10:46 AM UTC, comment #3:

I still can't repeat that. Actually, for glyph_index 5562, I get no call to Ins_SxVTL at all...

For testing purposes I have now added option `-i' to ftbench to specify the first index. Could you please check whether

FT2_DEBUG=any:7 ftbench -c 1 -b d -i 5562 &> 5562.log

still takes such a long time rendering glyph 5562? And please send me the debug output for this glyph so that I can compare it with my results.

Werner LEMBERG <wl>
Project AdministratorIn charge of this item.
Wed 11 Aug 2010 04:06:57 PM UTC, comment #2:

Yeah.. it passes the 'Render' stage, but again, it spends a lot of time in the 'Get_Glyph' stage.

For example (for the glyph_index: 5562). I do not understand the internal login beneath ttyinterp.c but, are negative values of Vy (as an argument to Normalize()) valid? If yes, and Get_Glyph should take long when processing this file (at least dozens of minutes), then I guess it's been fixed.

Program received signal SIGINT, Interrupt.
0x000000000041a1ec in Normalize (exc=0x6b1350, Vx=17037, Vy=-1439771368, R=0x6b156a) at /home/swiecki/freetype/freetype2/src/truetype/ttinterp.c:2781
2781 while ( W >= 0x10004000L )
(gdb) bt
#0 0x000000000041a1ec in Normalize (exc=0x6b1350, Vx=17037, Vy=-1439771368, R=0x6b156a) at /home/swiecki/freetype/freetype2/src/truetype/ttinterp.c:2781
#1 0x000000000041a336 in Ins_SxVTL (exc=0x6b1350, aIdx1=87, aIdx2=7, aOpc=6, Vec=0x6b156a) at /home/swiecki/freetype/freetype2/src/truetype/ttinterp.c:2847
#2 0x000000000041f92b in TT_RunIns (exc=0x6b1350) at /home/swiecki/freetype/freetype2/src/truetype/ttinterp.c:7528
#3 0x0000000000418ac9 in TT_Run_Context (exec=0x6b1350, debug=0 '\000') at /home/swiecki/freetype/freetype2/src/truetype/ttinterp.c:743
#4 0x0000000000413b4e in TT_Hint_Glyph (loader=0x7fffffffdd70, is_composite=0 '\000') at /home/swiecki/freetype/freetype2/src/truetype/ttgload.c:816
#5 0x0000000000414123 in TT_Process_Simple_Glyph (loader=0x7fffffffdd70) at /home/swiecki/freetype/freetype2/src/truetype/ttgload.c:937
#6 0x0000000000415104 in load_truetype_glyph (loader=0x7fffffffdd70, glyph_index=5562, recurse_count=0, header_only=0 '\000')
at /home/swiecki/freetype/freetype2/src/truetype/ttgload.c:1425
#7 0x000000000041653e in TT_Load_Glyph (size=0x6b4960, glyph=0x6b4710, glyph_index=5562, load_flags=0)
at /home/swiecki/freetype/freetype2/src/truetype/ttgload.c:2074
#8 0x00000000004118d7 in Load_Glyph (ttslot=0x6b4710, ttsize=0x6b4960, glyph_index=5562, load_flags=0)
at /home/swiecki/freetype/freetype2/src/truetype/ttdriver.c:334
#9 0x00000000004058f2 in FT_Load_Glyph (face=0x6b2a70, glyph_index=5562, load_flags=0) at /home/swiecki/freetype/freetype2/src/base/ftobjs.c:677
#10 0x0000000000401909 in test_get_glyph (timer=0x7fffffffe090, face=0x6b2a70, user_data=0x0) at /home/swiecki/freetype/freetype2-demos/src/ftbench.c:316
#11 0x000000000040158e in benchmark (face=0x6b2a70, test=0x7fffffffe100, max_iter=1, max_time=2) at /home/swiecki/freetype/freetype2-demos/src/ftbench.c:189
#12 0x0000000000402729 in main (argc=1, argv=0x7fffffffe270) at /home/swiecki/freetype/freetype2-demos/src/ftbench.c:818

(gdb) continue
Continuing.

^C
Program received signal SIGINT, Interrupt.
Normalize (exc=0x6b1350, Vx=17037, Vy=-1014907537, R=0x6b156a) at /home/swiecki/freetype/freetype2/src/truetype/ttinterp.c:2781
2781 while ( W >= 0x10004000L )
(gdb) bt
#0 Normalize (exc=0x6b1350, Vx=17037, Vy=-1014907537, R=0x6b156a) at /home/swiecki/freetype/freetype2/src/truetype/ttinterp.c:2781
#1 0x000000000041a336 in Ins_SxVTL (exc=0x6b1350, aIdx1=87, aIdx2=7, aOpc=6, Vec=0x6b156a) at /home/swiecki/freetype/freetype2/src/truetype/ttinterp.c:2847
#2 0x000000000041f92b in TT_RunIns (exc=0x6b1350) at /home/swiecki/freetype/freetype2/src/truetype/ttinterp.c:7528
#3 0x0000000000418ac9 in TT_Run_Context (exec=0x6b1350, debug=0 '\000') at /home/swiecki/freetype/freetype2/src/truetype/ttinterp.c:743
#4 0x0000000000413b4e in TT_Hint_Glyph (loader=0x7fffffffdd70, is_composite=0 '\000') at /home/swiecki/freetype/freetype2/src/truetype/ttgload.c:816
#5 0x0000000000414123 in TT_Process_Simple_Glyph (loader=0x7fffffffdd70) at /home/swiecki/freetype/freetype2/src/truetype/ttgload.c:937
#6 0x0000000000415104 in load_truetype_glyph (loader=0x7fffffffdd70, glyph_index=5562, recurse_count=0, header_only=0 '\000')
at /home/swiecki/freetype/freetype2/src/truetype/ttgload.c:1425
#7 0x000000000041653e in TT_Load_Glyph (size=0x6b4960, glyph=0x6b4710, glyph_index=5562, load_flags=0)
at /home/swiecki/freetype/freetype2/src/truetype/ttgload.c:2074
#8 0x00000000004118d7 in Load_Glyph (ttslot=0x6b4710, ttsize=0x6b4960, glyph_index=5562, load_flags=0)
at /home/swiecki/freetype/freetype2/src/truetype/ttdriver.c:334
#9 0x00000000004058f2 in FT_Load_Glyph (face=0x6b2a70, glyph_index=5562, load_flags=0) at /home/swiecki/freetype/freetype2/src/base/ftobjs.c:677
#10 0x0000000000401909 in test_get_glyph (timer=0x7fffffffe090, face=0x6b2a70, user_data=0x0) at /home/swiecki/freetype/freetype2-demos/src/ftbench.c:316
#11 0x000000000040158e in benchmark (face=0x6b2a70, test=0x7fffffffe100, max_iter=1, max_time=2) at /home/swiecki/freetype/freetype2-demos/src/ftbench.c:189
#12 0x0000000000402729 in main (argc=1, argv=0x7fffffffe270) at /home/swiecki/freetype/freetype2-demos/src/ftbench.c:818

Robert Swiecki <jagger>
Tue 10 Aug 2010 01:03:04 AM UTC, comment #1:

This could be fixed now. Please test the git version.

Werner LEMBERG <wl>
Project AdministratorIn charge of this item.
Mon 09 Aug 2010 07:12:02 PM UTC, original submission:

Hi, I have a 23MiB font file, and running ftbench -c 1 on it takes ages.

Font: http://alt.swiecki.net/j/f/sigsegv30_1.ttf

<user> 25232 99.0 0.1 39588 10928 pts/1 T Aug06 4474:41 /usr/local/google/fuzz/ttf/ftbench -c 1 sigsegv30_1.ttf

which is 74 hours now (4474 / 60)

under gdb, pressing Ctrl+C in various moments gives the following results (please notice super-hige values of ey, x1 etc...)

Program received signal SIGTSTP, Stopped (user).
0x000000000046f084 in gray_render_line (worker=0x6a81d0, to_x=780, to_y=-2991304946248318796) at /usr/local/google/src/freetype2-c9de9cbd56caea5ceeab8d984e71441803c41aef/src/smooth/ftgrays.c:837
837 gray_set_cell( RAS_VAR_ TRUNC( x ), ey1 );
(gdb) continue
Continuing.

Program received signal SIGTSTP, Stopped (user).
0x000000000046f084 in gray_render_line (worker=0x6a81d0, to_x=780, to_y=-2991304946248318796) at /usr/local/google/src/freetype2-c9de9cbd56caea5ceeab8d984e71441803c41aef/src/smooth/ftgrays.c:837
837 gray_set_cell( RAS_VAR_ TRUNC( x ), ey1 );
(gdb) continue
Continuing.
^C
Program received signal SIGINT, Interrupt.
0x000000000046e8a7 in gray_render_scanline (worker=0x6a81d0, ey=-6864211254637, x1=6864211255348, y1=256, x2=6864211255349, y2=0) at /usr/local/google/src/freetype2-c9de9cbd56caea5ceeab8d984e71441803c41aef/src/smooth/ftgrays.c:619
619 ras.area += (TArea)(( fx1 + fx2 ) * delta);
(gdb) continue
Continuing.
^C
Program received signal SIGINT, Interrupt.
0x000000000046e824 in gray_render_scanline (worker=0x6a81d0, ey=-6864462471763, x1=6864462472474, y1=256, x2=6864462472475, y2=0) at /usr/local/google/src/freetype2-c9de9cbd56caea5ceeab8d984e71441803c41aef/src/smooth/ftgrays.c:604
604 fx1 = (TCoord)( x1 - SUBPIXELS( ex1 ) );
(gdb) continue
Continuing.
^C
Program received signal SIGINT, Interrupt.
gray_render_scanline (worker=0x6a81d0, ey=-7407012046954, x1=7407012047665, y1=256, x2=7407012047666, y2=0) at /usr/local/google/src/freetype2-c9de9cbd56caea5ceeab8d984e71441803c41aef/src/smooth/ftgrays.c:600
600 dx = x2 - x1;
(gdb) continue

^C
Program received signal SIGINT, Interrupt.
gray_set_cell (worker=0x6a81d0, ex=10, ey=-7407592631278) at /usr/local/google/src/freetype2-c9de9cbd56caea5ceeab8d984e71441803c41aef/src/smooth/ftgrays.c:553
553 ras.ey = ey;

(gdb) bt
#0 gray_set_cell (worker=0x6a81d0, ex=10, ey=-7407592631278) at /usr/local/google/src/freetype2-c9de9cbd56caea5ceeab8d984e71441803c41aef/src/smooth/ftgrays.c:553
#1 0x000000000046f096 in gray_render_line (worker=0x6a81d0, to_x=780, to_y=-2991304946248318796) at /usr/local/google/src/freetype2-c9de9cbd56caea5ceeab8d984e71441803c41aef/src/smooth/ftgrays.c:837
#2 0x0000000000470015 in gray_line_to (to=0x7fffffffdd70, worker=0x6a81d0) at /usr/local/google/src/freetype2-c9de9cbd56caea5ceeab8d984e71441803c41aef/src/smooth/ftgrays.c:1154
#3 0x000000000040b984 in FT_Outline_Decompose (outline=0x6a88f8, func_interface=0x4881e0, user=0x6a81d0) at /usr/local/google/src/freetype2-c9de9cbd56caea5ceeab8d984e71441803c41aef/src/base/ftoutln.c:160
#4 0x0000000000470696 in gray_convert_glyph_inner (worker=0x6a81d0) at /usr/local/google/src/freetype2-c9de9cbd56caea5ceeab8d984e71441803c41aef/src/smooth/ftgrays.c:1724
#5 0x0000000000470be7 in gray_convert_glyph (worker=0x6a81d0) at /usr/local/google/src/freetype2-c9de9cbd56caea5ceeab8d984e71441803c41aef/src/smooth/ftgrays.c:1845
#6 0x00000000004710e9 in gray_raster_render (raster=0x6ad7a0, params=0x7fffffffe1f0) at /usr/local/google/src/freetype2-c9de9cbd56caea5ceeab8d984e71441803c41aef/src/smooth/ftgrays.c:1975
#7 0x000000000047174d in ft_smooth_render_generic (render=0x6ad6e0, slot=0x6af710, mode=FT_RENDER_MODE_NORMAL, origin=0x0, required_mode=FT_RENDER_MODE_NORMAL)
at /usr/local/google/src/freetype2-c9de9cbd56caea5ceeab8d984e71441803c41aef/src/smooth/ftsmooth.c:274
#8 0x00000000004719cb in ft_smooth_render (render=0x6ad6e0, slot=0x6af710, mode=FT_RENDER_MODE_NORMAL, origin=0x0) at /usr/local/google/src/freetype2-c9de9cbd56caea5ceeab8d984e71441803c41aef/src/smooth/ftsmooth.c:360
#9 0x000000000040a936 in FT_Render_Glyph_Internal (library=0x6a8040, slot=0x6af710, render_mode=FT_RENDER_MODE_NORMAL) at /usr/local/google/src/freetype2-c9de9cbd56caea5ceeab8d984e71441803c41aef/src/base/ftobjs.c:3914
#10 0x000000000040aa0b in FT_Render_Glyph (slot=0x6af710, render_mode=FT_RENDER_MODE_NORMAL) at /usr/local/google/src/freetype2-c9de9cbd56caea5ceeab8d984e71441803c41aef/src/base/ftobjs.c:3954
#11 0x0000000000401947 in test_render (timer=0x7fffffffe470, face=0x6ada70, user_data=0x0) at /usr/local/google/src/freetype2-demos/src/ftbench.c:270
#12 0x00000000004016fe in benchmark (face=0x6ada70, test=0x7fffffffe4e0, max_iter=1, max_time=2) at /usr/local/google/src/freetype2-demos/src/ftbench.c:189
#13 0x0000000000402869 in main (argc=1, argv=0x7fffffffe650) at /usr/local/google/src/freetype2-demos/src/ftbench.c:813

Robert Swiecki <jagger>

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by wl (Posted a comment)
  • -unavailable- added by jagger (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 18 Aug 2010 02:22:59 AM UTCwlStatusNeed Info=>Fixed
      Open/ClosedOpen=>Closed
    Tue 17 Aug 2010 06:10:46 AM UTCwlStatusReady For Test=>Need Info
    Tue 10 Aug 2010 01:03:04 AM UTCwlStatusNone=>Ready For Test
      Assigned toNone=>wl
      Planned ReleaseNone=>2.4.3

    Back to the top


    Powered by Savane 3.1-cleanup1