Bug 71955

Summary: mkcatdefs I built from sources fails with segmentation fault
Product: [Retired] Red Hat Linux Reporter: Sysoltsev Slawa <vyatcheslav.sysoltsev>
Component: openmotif21Assignee: Than Ngo <than>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 7.3   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-08-20 13:29:58 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Sysoltsev Slawa 2002-08-20 13:29:54 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)

Description of problem:
$(unpacked_source_rpm)/localized/util contain source of mkcatdefs I've tried to 
build. But built version of mkcatdefs fails with segmentation fault on any 
input file.
I investigated the error and found that in function "static void mkcatdefs(char 
*fname)" : mkcatdefs.c : line 265 you are trying to allocate local array 'line' 
with MAXLINELEN elements. MAXLINELEN is defined here as NL_TEXTMAX. But in my 
system NL_TEXTMAX is defined as INT_MAX in /usr/include/bits/xopen_lim.h. 
INT_MAX in turn is defined equal 0x7fffffff. So you are trying to allocate 
2*2Gb length local variable! Executable fails doing it.

I changed MAXLINELEN to more reasonable value (8192 looks OK) and mkcatdefs 
becomes OK.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. Unpack openmotif21-2.1.30-1.src.rpm to some local dir
2. Prepare sources (rpm -bp openmotif.spec)
3. cd to BUILD/motif/localized/util directory
4. `xmkmf && make`
5. `ls > messages`
6. `mkcatdefs slawa.h messages`
	

Actual Results:  Segmentation fault


Expected Results:  Imakefile
Makefile
messages
mkcatdefs
mkcatdefs.c
mkcatdefs.c.pl3
mkcatdefs.o
mkmsgcat
mkmsgcat.c
mkmsgcat.c.pl3
mkmsgcat.o
slawa.h
mkcatdefs: No symbolic identifiers; no slawa.h created

Or something like...

Additional info:

Comment 1 Ngo Than 2002-08-26 22:50:32 UTC
It's fixed in 2.1.30-6. Thank you for the info.