From: Hari <har...@ya...> - 2018-02-28 03:39:21
|
Hi, I have a query on using LD_PRELOAD with valgrind. I have a process which is LD_PRELOADED with a libraray libfake.so (name changed) which registers a signal handler and when the signal to the process is received, prints the memory statistics of this process into the log file. The same is monitored by the test framework to see if the memory is increasing on executing a test multiple times. Apart from monitoring the memory, we also need valgrind to give backtraces of all memory allocations while the tests run just in case the test framework detects memory increase. LD_PRELOAD with my process just runs fine printing the memory statistics, however when the process is run from valgrind, the signal doesnt seem to reach my process at all. For ex: LD_PRELOAD=./libfake.so ./my_process --> runs fine and prints memory stats But, LD_PRELOAD=./libfake.so valgrind ./my_process --> doesnt print the memory stats >From few online blogs, i understand that valgrind does forward any signals to the child process that it is running on but it doesnt seem to work here. Any inputs here will be of great help. I am using valgrind 3.11 for my use. ThanksHari |