Hello everyone, While I was cleaning my home directory, I saw this program that I compiled. After that, I launched it and... My X became frozen and then crashed ( I executed the program in an Xterm). I think it's because it used all the memory available... I don't want to try but what could happen if I'd have run it from a console ? Whould the system crash ?
I think there is a way (or more than one) to be sure a user doesn't crash the system by using all the memory available. I've heard a bit about the /etc/limits file but it seems that it's a per login configuration, which has a lot of disadvantages. I'd like to know if there is a way to impose GLOBAL/per user limits. If a such {program ; configuration file } exist, I'd like to know why debian shouldn't be configured to impose quotas by default. I think it's very disapointing to let every user crash the system by default :-(( Have you a better idea to avoid this kind of program to crash the system ? Thank you very much for giving me much infos ----- CUT ----- #include <stdio.h> char *p; int main(void) { unsigned long j=0; while(1) { printf ("cheese: %dn",j); p=(char *) malloc(1024); j++; } } ----- CUT ----- -- DDDD EEEEE BBBB II AAAAA NN N LL II NN N U U X X DD D E__ B__B II A___A N N N LL II N N N U U XX DD D E B B II A A N N N LL II N N N U U XX DDDD EEEEE BBBB II A A N NN LLLLL II N NN UUUUU X X