View Issue Details

IDProjectCategoryView StatusLast Update
0000895luatexluatex bugpublic2015-11-02 17:57
ReporterGraham Douglas Assigned ToHans Hagen  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionwon't fix 
Target Versionmaybe never (> v 1) 
Summary0000895: Crash when font id is incorrectly passed in as -1
DescriptionHi All

This is "user error" and (perhaps a bug too)

I encountered a "crash" caused by some Lua code I had written to build a TeX box from a set of glyph nodes. I had (somehow!) accidentally assigned the value of -1 the font id of glyph nodes which resulted in a crash via a failed call to node.hpack(...). Clearly, a silly mistake on my part but I though I would mention here that it might be useful to trap this and give an informative error message "Invalid font id (value) " or something like that.

I traced the problem to the function charinfo *char_info(internal_font_number f, int c)
contained in texfont.w

The value of f (internal_font_number) was passed in as -1, which caused a crash in the line:

proper_char_index(c))

This is #defined as

#define proper_char_index(c) (c<=font_ec(f) && c>=font_bc(f))

Best
Graham
Steps To Reproducethere are many more invalid values that can be added to fields an dehcking them all makes no sense (add much runtime esp for fields that are used a lot at the lua end) .. needs thinking
TagsNo tags attached.

Activities

Hans Hagen

2015-11-02 17:57

manager   ~0001497

users can assign all kind of (temporary) values to nodes including (temporary) invalid ones and checking all of that everywhere add too much overhead .. those who mess with nodes should know what they're doing anyway

Issue History

Date Modified Username Field Change
2014-05-04 18:56 Graham Douglas New Issue
2015-03-21 15:12 Hans Hagen Assigned To => Hans Hagen
2015-03-21 15:12 Hans Hagen Status new => assigned
2015-10-22 11:11 Hans Hagen Severity crash => minor
2015-10-22 11:11 Hans Hagen OS Windows 7 =>
2015-10-22 11:11 Hans Hagen OS Version Ultimate (64 b =>
2015-10-22 11:11 Hans Hagen Platform Windows =>
2015-10-23 09:13 Hans Hagen Target Version => maybe never (> v 1)
2015-10-23 09:13 Hans Hagen Steps to Reproduce Updated
2015-11-02 17:57 Hans Hagen Note Added: 0001497
2015-11-02 17:57 Hans Hagen Status assigned => closed
2015-11-02 17:57 Hans Hagen Resolution open => won't fix