Bug 80050 - ttcp crashes on ia64 because of missing malloc.h in source
ttcp crashes on ia64 because of missing malloc.h in source
Product: Red Hat Linux
Classification: Retired
Component: ttcp (Show other bugs)
ia64 Linux
medium Severity high
: ---
: ---
Assigned To: Nalin Dahyabhai
Depends On:
  Show dependency treegraph
Reported: 2002-12-19 03:00 EST by Geert Albert Smant
Modified: 2007-04-18 12:49 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-02-13 05:38:56 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
fix malloc issue + polish source code (clean compile) (6.18 KB, patch)
2005-01-20 10:11 EST, Vladimir Mencl
no flags Details | Diff

  None (edit)
Description Geert Albert Smant 2002-12-19 03:00:43 EST
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:

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 10:11:08 EST
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 05:38:56 EST
Fixed in -11, soon in FC devel.

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