Bug 80050

Summary: ttcp crashes on ia64 because of missing malloc.h in source
Product: [Retired] Red Hat Linux Reporter: Geert Albert Smant <smant>
Component: ttcpAssignee: Nalin Dahyabhai <nalin>
Status: CLOSED RAWHIDE QA Contact:
Severity: high Docs Contact:
Priority: medium    
Version: 7.2CC: mencl
Target Milestone: ---   
Target Release: ---   
Hardware: ia64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-02-13 10:38:56 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:
Attachments:
Description Flags
fix malloc issue + polish source code (clean compile) none

Description Geert Albert Smant 2002-12-19 08:00:43 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20021003

Description of problem:
The ttcp program crashes when running on an IA-64 version
of RedHat 7.2

The reason for this, is a missing

#include <malloc.h>

in the beginning of the program's (ttcp.c) source file.
Thus the return of the function malloc in the program
is declared as (int) by the compiler and on a 64 bit
IA-64 the program will crash.

Kind Regards,
Geert Albert Smant

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


How reproducible:
Always

Steps to Reproduce:
It is easily reproducable if you open 2 windows on an IA-64
system and type the following commands:

in the first window you type:

$ ttcp -r -s

and in the second window you type:

$ ttcp -v -t -s localhost


Actual Results:  the program will core dump

Additional info:

This problem is fixed when the ttcp.c program is re-compiled
when the following line has been added to the list of
'#include' statements in the beginning of the source file:

#include <malloc.h>

Comment 1 Vladimir Mencl 2005-01-20 15:11:08 UTC
Created attachment 110012 [details]
fix malloc issue + polish source code (clean compile)

This bug was reported in Redhat 7.2, but still persists in FC3.

ttcp does not include stdlib.h, the right header to get malloc defined
(according to C99).

On IA64, sizeof(int) is 4 but sizeof(void *) is 8.

Thus, all allocated pointers are trimmed and ttcp core dumps.

In the attached patch, I have fixed this + polished ttcp to get a clean compile
(tested on FC3/i686, debian GNU/Linux on IA64, FreeBSD 4.10).

Please please, include this patch - although I acknowledge that IA64 is not
really supported by the Fedora Project now.

Comment 2 Florian La Roche 2005-02-13 10:38:56 UTC
Fixed in -11, soon in FC devel.