View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000890 | luatex | luatex bug | public | 2014-02-19 19:57 | 2015-03-21 15:00 |
Reporter | phg | Assigned To | Taco | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | no change required | ||
Summary | 0000890: memleak in the font library | ||||
Description | In luafont.w, the return value of n_string_field() is xstrdup()’ed on two occasions, but the function already does this job. | ||||
Steps To Reproduce | \ifdefined \luatexsuppresslongerror \input luaotfload.sty \fi \font \mainfont = file:lmroman10-regular.otf at 42pt \mainfont %% nop \bye | ||||
Additional Information | Run the above snippet under either the luatex-plain format or with the luatex format of texlive. According to Valgrind, the attached patch saves about 117 KB from leaking. I’m running LuaTeX, Version beta-0.78.3 (TeX Live 2014/dev) (rev 4804) | ||||
Tags | No tags attached. | ||||
|
luafont.w-font-library-memleak.patch (1,097 bytes)
Fix memleak due to redundant call to xstrdup() in luafont.w. Index: source/texk/web2c/luatexdir/font/luafont.w =================================================================== diff --git a/trunk/source/texk/web2c/luatexdir/font/luafont.w b/trunk/source/texk/web2c/luatexdir/font/luafont.w --- a/trunk/source/texk/web2c/luatexdir/font/luafont.w (revision 4822) +++ b/trunk/source/texk/web2c/luatexdir/font/luafont.w (working copy) @@ -1245,15 +1245,9 @@ k = n_boolean_field(L, luaS_used_index, 0); set_charinfo_used(co, k); s = n_string_field(L, luaS_name_index, NULL); - if (s != NULL) - set_charinfo_name(co, xstrdup(s)); - else - set_charinfo_name(co, NULL); + set_charinfo_name(co, s); s = n_string_field(L, luaS_tounicode_index, NULL); - if (s != NULL) - set_charinfo_tounicode(co, xstrdup(s)); - else - set_charinfo_tounicode(co, NULL); + set_charinfo_tounicode(co, s); if (has_math) { j = n_numeric_field(L, luaS_top_accent_index, INT_MIN); |
|
fyi: luigi and i are currently optimizing / normalizing some of that code but part of that will probably show up after the frozen tex live release. |
|
superceded by intermediate changes to luafont.w |
Date Modified | Username | Field | Change |
---|---|---|---|
2014-02-19 19:57 | phg | New Issue | |
2014-02-19 19:57 | phg | File Added: luafont.w-font-library-memleak.patch | |
2014-02-20 09:29 | Hans Hagen | Note Added: 0001225 | |
2014-03-14 11:58 | Taco | Note Added: 0001247 | |
2014-03-14 11:58 | Taco | Status | new => resolved |
2014-03-14 11:58 | Taco | Resolution | open => no change required |
2014-03-14 11:58 | Taco | Assigned To | => Taco |
2015-03-21 15:00 | Hans Hagen | Status | resolved => closed |