Bug 1303268 - [freetype] : running 32 bit apps on amd64 arch which use freetype so, not using stat64
Summary: [freetype] : running 32 bit apps on amd64 arch which use freetype so, not usi...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: freetype
Version: 7.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Marek Kašík
QA Contact: Desktop QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-01-30 02:53 UTC by zuogang
Modified: 2016-11-04 01:26 UTC (History)
1 user (show)

Fixed In Version: freetype-2.4.11-12.el7
Doc Type: Bug Fix
Doc Text:
Cause: A font file with inode number higher than or equal to 2^31 opened by a 32bit version of freetype library. Consequence: Opening of such font file failed. Fix: Add support for Large File Support by defining _FILE_OFFSET_BITS to 64. Result: Font files with inode numbers higher than or equal to 2^31 are opened correctly.
Clone Of:
Environment:
Last Closed: 2016-11-04 01:26:49 UTC
Target Upstream Version:


Attachments (Terms of Use)
source of sfnt2fon (28.68 KB, text/plain)
2016-02-03 07:32 UTC, zuogang
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:2234 0 normal SHIPPED_LIVE freetype bug fix update 2016-11-03 13:27:48 UTC

Description zuogang 2016-01-30 02:53:51 UTC
Description of problem:

running 32 bit apps on amd64 arch which use freetype so, not using stat64 

Version-Release number of selected component (if applicable):
freetype-2.4.11-11.el7 i686

How reproducible:

using wine's tool sfnt2fon within win1.9.2 , when the ttf file 's stat info struct has some field exceed the old stat struct's member, the error overflow returned.

sfnt2fon -o coue1255.fon courier.ttf -d 128 13,1255,8

(gdb) shell stat courier.ttf 
  File: ‘courier.ttf’
  Size: 17884           Blocks: 40         IO Block: 4096   regular file
Device: fd00h/64768d    Inode: 7079994055  Links: 1
Access: (0664/-rw-rw-r--)  Uid: ( 1000/    zoge)   Gid: ( 1000/    zoge)
Access: 2016-01-29 11:10:33.653143506 +0800
Modify: 2016-01-22 22:28:32.000000000 +0800
Change: 2016-01-28 19:45:15.078754468 +0800
 Birth: -

on my machine and my fs, the inode field exceed u32.

I define a macro before the stat.h, every thing is ok.

--- a/builds/unix/ftsystem.c 2009-03-14 21:45:26.000000000 +0800
+++ b/builds/unix/ftsystem.c 2016-01-30 10:28:10.199751965 +0800
@@ -58,6 +58,7 @@
 
 
 #include <sys/types.h>
+#define __USE_FILE_OFFSET64 1
 #include <sys/stat.h>
 
 #ifdef HAVE_FCNTL_H


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 2 Marek Kašík 2016-02-02 10:16:43 UTC
Hi zougang,

is the specific version of wine you use available via a repository? Which version of freetype are you compiling? How do you run the gdb?
Also, you report that this happened in Red Hat Enterprise Linux 7.4 which does not exist. Which version of Red Hat Enterprise Linux do you use?
I would like to try to reproduce the problem.

Regards

Comment 3 zuogang 2016-02-03 07:23:50 UTC
(In reply to Marek Kašík from comment #2)
> Hi zougang,
> 
> is the specific version of wine you use available via a repository? Which

yes, wine 1.9.2 upstream version

> version of freetype are you compiling? How do you run the gdb?
freetype-2.4.11-11.el7 i686

run the gdb : 
gdb  sfnt2fon 
set args -o coue1255.fon courier.ttf -d 128 13,1255,8

b XXX

run



> Also, you report that this happened in Red Hat Enterprise Linux 7.4 which
> does not exist. Which version of Red Hat Enterprise Linux do you use?
> I would like to try to reproduce the problem.
how to check the el's version? I upgraded from the very beginning verison, I think 7.4 is the newest version, so ....

freetype-2.4.11-11.el7 i686----from the pkg's version can you get the os verison?

last, I think this question is because my disk and fs layout(maybe none business of the os?), the courier.ttf  file's stat info has some field very big, so the old stat syscall failed with overflow. (the field inode below : Inode: 7079994055  )

(gdb) shell stat courier.ttf 
  File: ‘courier.ttf’
  Size: 17884           Blocks: 40         IO Block: 4096   regular file
Device: fd00h/64768d    Inode: 7079994055  Links: 1
Access: (0664/-rw-rw-r--)  Uid: ( 1000/    zoge)   Gid: ( 1000/    zoge)
Access: 2016-01-29 11:10:33.653143506 +0800
Modify: 2016-01-22 22:28:32.000000000 +0800
Change: 2016-01-28 19:45:15.078754468 +0800
 Birth: -


> 
> Regards

Comment 4 zuogang 2016-02-03 07:32:07 UTC
Created attachment 1120652 [details]
source of sfnt2fon

Comment 5 Marek Kašík 2016-02-10 17:01:09 UTC
Thank you for the info. I was able to reproduce the problem. Setting _FILE_OFFSET_BITS to 64 at configure time solves the problem for me.
I'm proposing the fix for 7.3.

Comment 9 errata-xmlrpc 2016-11-04 01:26:49 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-2234.html


Note You need to log in before you can comment on or make changes to this bug.