Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 80050 - ttcp crashes on ia64 because of missing malloc.h in source
Summary: ttcp crashes on ia64 because of missing malloc.h in source
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: ttcp
Version: 7.2
Hardware: ia64
OS: Linux
medium
high
Target Milestone: ---
Assignee: Nalin Dahyabhai
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-12-19 08:00 UTC by Geert Albert Smant
Modified: 2007-04-18 16:49 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-02-13 10:38:56 UTC


Attachments (Terms of Use)
fix malloc issue + polish source code (clean compile) (deleted)
2005-01-20 15:11 UTC, Vladimir Mencl
no flags Details | Diff

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.



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