J
Joakim Hove
Hello,
in my application I have a typedefed struct:
typedef struct {
double d1;
int i1;
/* I have simplified the object here. */
} data_ptr_type;
I allocate storage for such object many times in my application, and
at some point in time (repeatedly at the same spot, but seemingly
random to me), the application fails with a SIGSEGV at:
data_ptr_type * data = malloc(sizeof *data);
To me it seems quite illogical that the malloc implementation should
be able to die with a SIGSEGV(?) - either it should return a pointer
to freshly allocated storage, or if that is not possible it should
return NULL. Can this be a sign of a bug in the malloc()
implementation - I know that sounds unlikely but??
My system is:
RedHat Enterprise Linux
gcc-3.4.6
64 bit computer, but comiled with -m32 switch.
Any suggestions?
Regards Joakim
in my application I have a typedefed struct:
typedef struct {
double d1;
int i1;
/* I have simplified the object here. */
} data_ptr_type;
I allocate storage for such object many times in my application, and
at some point in time (repeatedly at the same spot, but seemingly
random to me), the application fails with a SIGSEGV at:
data_ptr_type * data = malloc(sizeof *data);
To me it seems quite illogical that the malloc implementation should
be able to die with a SIGSEGV(?) - either it should return a pointer
to freshly allocated storage, or if that is not possible it should
return NULL. Can this be a sign of a bug in the malloc()
implementation - I know that sounds unlikely but??
My system is:
RedHat Enterprise Linux
gcc-3.4.6
64 bit computer, but comiled with -m32 switch.
Any suggestions?
Regards Joakim