* RE: [Linux-ia64] Re: malloc problems
2001-04-26 15:03 [Linux-ia64] Re: malloc problems Bill Nottingham
@ 2001-04-26 16:41 ` Donny Cooper
2001-04-26 18:44 ` David Mosberger
1 sibling, 0 replies; 3+ messages in thread
From: Donny Cooper @ 2001-04-26 16:41 UTC (permalink / raw)
To: linux-ia64
Bill,
This code is a small subset of a very large application, that runs on many
platforms, an is being ported and tuned for IA64 Linux.
The executable builds and runs fine, but always grabs a different memory
area on the one BigSur, as opposed to the others.
Thanks.
Donny
-----Original Message-----
From: linux-ia64-admin@linuxia64.org
[mailto:linux-ia64-admin@linuxia64.org]On Behalf Of Bill Nottingham
Sent: Thursday, April 26, 2001 10:03 AM
To: !IA64-Dist-Linuxia64 (E-mail)
Subject: [Linux-ia64] Re: malloc problems
Donny Cooper (dcooper@hstc.necsyl.com) said:
> dynamic_area = (unsigned char *) malloc ( membytes );
> printf(" dyn_area = %x %lx, mem= %x
\n",dynamic_area,dynamic_area,membytes);
>
> Result from Tom: (1-way BigSur)
> dyn_area = 40000010 40000010, mem= 2000018
It looks like you forgot a prototype for malloc.
Bill
_______________________________________________
Linux-IA64 mailing list
Linux-IA64@linuxia64.org
http://lists.linuxia64.org/lists/listinfo/linux-ia64
^ permalink raw reply [flat|nested] 3+ messages in thread* RE: [Linux-ia64] Re: malloc problems
2001-04-26 15:03 [Linux-ia64] Re: malloc problems Bill Nottingham
2001-04-26 16:41 ` Donny Cooper
@ 2001-04-26 18:44 ` David Mosberger
1 sibling, 0 replies; 3+ messages in thread
From: David Mosberger @ 2001-04-26 18:44 UTC (permalink / raw)
To: linux-ia64
>>>>> On Thu, 26 Apr 2001 11:41:37 -0500, "Donny Cooper" <dcooper@hstc.necsyl.com> said:
Donny> Bill, This code is a small subset of a very large
Donny> application, that runs on many platforms, an is being ported
Donny> and tuned for IA64 Linux. The executable builds and runs
Donny> fine, but always grabs a different memory area on the one
Donny> BigSur, as opposed to the others.
You didn't include a complete test case, so you shouldn't be surprised
if you're sending people off to a wild goose chase. As Bill said, the
code you quoted is indeed incorrect as it shows no declaration of
malloc(), nor does it include <stdlib.h>.
Since you say your code works fine, let's assume that malloc() does
get declared *somewhere*. Based on the addresses you quote:
Result from Tom: (1-way BigSur)
dyn_area = 40000010 40000010, mem= 2000018
Result from Dick & Harry:(2-way BigSur & 4-way Lion)
dyn_area = 10 2000000000000010, mem= 2000018
I'd say that the binary on "Tom" is an IA-32 binary. Please use
"file" to verify and let us know (if it's not an IA-32 binary, then a
kernel bug would be the next candidate).
For example, if I compile the attached test program once for IA-32
(t.x86) and once for IA-64 (t.ia64), I get:
$ ./t.x86
0x40134008
$ ./t.ia64
0x20000000002a0010
Hope this helps,
--david
--
#include <stdio.h>
#include <stdlib.h>
int main (int argc, char **argv) {
return printf ("%p\n", malloc(2000018));
}
^ permalink raw reply [flat|nested] 3+ messages in thread