I created simple C code on Linux (Fedora) using a whole chain of tools. This is for the purpose of the ARM Cortex-A8. This code runs on a Cortex A8 board running embedded Linux.
When I run this code for some test case that does dynamic memory allocation ( malloc) for a large size (10 MB), it after a while resets the error message as shown below:
select 1 (init), adj 0, size 61, to kill
select 1030 (syslogd), adj 0, size 64, to kill
select 1032 (klogd), adj 0, size 74, to kill
select 1227 (bash), adj 0, size 378, to kill
select 1254 (ppp), adj 0, size 1069, to kill
select 1255 (TheoraDec_Corte), adj 0, size 1159, to kill
send sigkill to 1255 (TheoraDec_Corte), adj 0, size 1159
Program terminated with signal SIGKILL, Killed.
Then, when I debug this code for the same test, using gdb built for the purpose, the point at which this dynamic memory allocation occurs, the code cannot allocate this memory, but mallocreturns NULL. But during a normal autonomous launch, I believe that it mallocshould not stand out, but it may strangely not return NULL, but it crashes and the OS kills my process.
- Why is this behavior different when running under gdb and without a debugger?
- Why
mallocfailed to return NULL. Is this possible, or the reason for the error message I get, yet? - How to fix it?
thank,
-AD