[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <201004210105.20942.pluto@agmk.net>
Date: Wed, 21 Apr 2010 01:05:20 +0200
From: Paweł Sikora <pluto@...k.net>
To: libc-help@...rceware.org, linux-kernel@...r.kernel.org
Subject: mprotect() failed: Cannot allocate memory
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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists