On 06/10/14 16:22, Tom Hughes wrote: > On 06/10/14 16:08, Skarakis, Konstantinos wrote: > >> I am having trouble running programs that need to use "ulimit" under >> valgrind. For instance, here is a simple script that changes the limit of >> open files to 100000. All commands below are executed as root: >> >>> cat foo >> #!/bin/sh >> ulimit -n 100000 >> >> I can run it fine on its own. >> >>> ./foo >>> echo $? >> 0 >> >> But under valgrind I get blocked with "Operation not permitted": > > Because valgrind needs to reserve a few file descriptors for it's own > use it effectively reduces the hard limit slightly, so you won't be able > to raise your own soft limit above that reduced hard limit.
Actually it's worse than that, we allocate the 10 reserved descriptors immediately above the soft limit (assuming there is space) and effectively convert the initial soft limit to a hard limit. Tom -- Tom Hughes (t...@compton.nu) http://compton.nu/ ------------------------------------------------------------------------------ Slashdot TV. Videos for Nerds. Stuff that Matters. http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk _______________________________________________ Valgrind-users mailing list Valgrind-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-users