public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* mprotect() failed: Cannot allocate memory
@ 2010-04-20 23:05 Paweł Sikora
  2010-04-20 23:17 ` Mike Frysinger
  2010-04-21 10:16 ` Peter Zijlstra
  0 siblings, 2 replies; 9+ messages in thread
From: Paweł Sikora @ 2010-04-20 23:05 UTC (permalink / raw)
  To: libc-help, linux-kernel

hi,

i'm trying to debug an ugly application with ElectricFence.
in fact, on x86-64 box with 8GB ram and 16GB swap i'm getting following error:

"ElectricFence Exiting: mprotect() failed: Cannot allocate memory"

the program has been compiled with gcc-4.5, glibc-2.11.1, kernel-2.6.32.
did you ever come across such (kernel/glibc) limitations?

here's a simple testcase which triggs -ENOMEM in mprotect().

#define N 100
#include<stdlib.h>

double **bm;
int main(){
    int i;
    long NN = 4*N*N;
    int kmax=100;

        bm = (double **)malloc((time_t)NN*sizeof(double *));
        for(i=0; i<NN; ++i){
                bm[i] = (double*)malloc((time_t)kmax*sizeof(double));
        }

        for(i=0; i<NN; ++i){
                free(bm[i]);
        }
        free(bm);
        return 0;
}

thanks for any hint,

BR,
Pawel.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2010-04-21 10:42 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-20 23:05 mprotect() failed: Cannot allocate memory Paweł Sikora
2010-04-20 23:17 ` Mike Frysinger
2010-04-20 23:44   ` Paweł Sikora
2010-04-21  2:23     ` Mike Frysinger
2010-04-21  8:22     ` Yann Droneaud
2010-04-21  7:33       ` Paweł Sikora
2010-04-21  7:42       ` Paweł Sikora
2010-04-21 10:16 ` Peter Zijlstra
2010-04-21  9:42   ` Paweł Sikora

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox