Share

SILGraphite: rendering non-roman scripts

Tracker: Bugs

5 engine crashes if Font::getTable() returns length = 0 - ID: 1755651
Last Update: Comment added ( sharoncorrell )

According to both the documentation (V2_Engine_Interface.odt, §3.1)
and the comments in Font.h, the getTable() method is allowed to set
the table length output parameter to zero (while returning the
correct table pointer), if it cannot readily determine the actual
table size.

However, if a Font class actually does this, the engine crashes; for
example:

----------------------------------------------------------
Exception: EXC_BAD_ACCESS (0x0001)
Codes: KERN_PROTECTION_FAILURE (0x0002) at 0x00000000

Thread 0 Crashed:
0 libgraphite.3.dylib 0x010283d8 gr::EngineState::InitializeStreams
(gr::GrTableManager*, gr::GrCharStream*, int, unsigned char*, bool,
int*) + 772 (GrTableManager.cpp:1560)
1 libgraphite.3.dylib 0x01029fc4 gr::GrTableManager::Run
(gr::Segment*, gr::Font*, gr::GrCharStream*, gr::IGrJustifier*, int,
gr::LayoutEnvironment&, int, float, float, bool, bool, int, bool,
bool, int, int, gr::tagSegEnd) + 596 (GrTableManager.cpp:399)
2 libgraphite.3.dylib 0x01014bf4 gr::GrEngine::MakeSegment
(gr::Segment*, gr::Font*, gr::ITextSource*, gr::IGrJustifier*,
gr::LayoutEnvironment&, int, int, float, bool, bool, float,
gr::tagSegEnd) + 932 (GrEngine.cpp:692)
3 libgraphite.3.dylib 0x0100b774 gr::Font::RenderLineFillSegment
(gr::Segment*, gr::ITextSource*, gr::LayoutEnvironment&, unsigned,
unsigned, float, bool) + 148 (Font.cpp:397)
4 libgraphite.3.dylib 0x0102f9ac
gr::LineFillSegment::LineFillSegment[in-charge](gr::Font*,
gr::ITextSource*, gr::LayoutEnvironment*, unsigned, unsigned, float,
bool) + 208 (Segment.cpp:148)
5 regression-test 0x00003724 RunOneTestCase(TestCase*,
gr::Segment*, gr::Segment**, RtTextSrc**) + 1484 (RegressionTest.cpp:
235)
6 regression-test 0x00004950 RunTests(int, TestCase*) + 956
(RegressionTest.cpp:148)
7 regression-test 0x00004d78 main + 876 (RegressionTest.cpp:110)
8 regression-test 0x00001fec _start + 340 (crt.c:272)
9 regression-test 0x00001e94 start + 60
----------------------------------------------------------

This happened first with my own Font subclass, but then I tried it
using the regression-test tool, after modifying FileFont.cpp so as to
return zero instead of the actual table size. So it seems that the
option to return zero for an unknown table size is broken.

JK


Sharon Correll ( sharoncorrell ) - 2007-07-17 19:08

5

Closed

None

Sharon Correll

None

None

Public


Comment ( 1 )




Date: 2007-07-17 19:11
Sender: sharoncorrellProject Admin


Fixed. The engine will now simply create a temporary pointer to the
crucial tables (cmap and name in particular) and then update the pointers
as necessary when creating a segment.


Log in to comment.

Attached File

No Files Currently Attached

Changes ( 3 )

Field Old Value Date By
status_id Open 2007-07-17 19:11 sharoncorrell
assigned_to nobody 2007-07-17 19:11 sharoncorrell
close_date - 2007-07-17 19:11 sharoncorrell