Operating System - HP-UX
1831213 Members
2700 Online
110021 Solutions
New Discussion

Re: Memory fault(coredump) after execute free

 
xuwentao
New Member

Memory fault(coredump) after execute free

My machine is :HP-UX B.11.00 A 9000/800

A simple program, It's filename is "t.c".

main()
{
char* buf;
buf=(char*)malloc(21);
printf("malloc is ok!\n");
free(buf);
printf("free is ok!\n");
return 0;
}
32bits application no problem.Compile command is:"cc -o t t.c".
Execute result is:
malloc is ok!
free is ok!

But 64bits application has problem,
Compile comand is:"cc -o t t.c +DA2.0W".
Execute result is:
malloc is ok!
Memory fault(coredump)

Why?Help me,thank you!

3 REPLIES 3
Steve Steel
Honored Contributor

Re: Memory fault(coredump) after execute free

Hi

What does
file core

Give from the coredump received

guess is kernel tuning

max?siz_64bit

The parameters which fit this description
probably maxdsiz_64bit maxssiz_64bit too small

Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
ranganath ramachandra
Esteemed Contributor

Re: Memory fault(coredump) after execute free

include the prototype for malloc:
#include
 
--
ranga
hp-ux 11i v3[i work for hpe]

Accept or Kudo

xuwentao
New Member

Re: Memory fault(coredump) after execute free

Thank ranganath ramachandra!
It's Ok!