Red Hat Bugzilla – Bug 74594
transfig fails with segmentation fault on ANY file
Last modified: 2012-05-31 14:33:20 EDT
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
Description of problem:
When I am trying to start transfig it fails with segmentation fault on any
input file in parse_arg function (at line transfig.c:215).
Reason of fault is because you use malloc function implicitly without
prototyping - gcc warns building package about it. Used implicitly, 'int'
return type is assumed. As you may be know on IA64 'int' type is only 32bit
width while pointers are 64bit width, so result from malloc is cutted to fit 32
bit. As a result bad pointer is used and application crashes. Also such error
appears in sys.c (function mksuff).
Workaround is to add #include <stdlib> in begin transfig.c and sys.c source
files. I'll attach patch fixing problem.
With it application becomes runnable.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. /usr/X11R6/bin/transfig SomeFile
Actual Results: Message:
Segmentation fault (core dumped)
Expected Results: Something more reliable
Created attachment 77446 [details]
patch adds #include <stdlib> to transfig.c and sys.c files
Fixed in transfig-3.2.4-8. Thanks for the patch.