All,

I wrote a discrete-event simulator that requires intercepting several
system calls via LD_PRELOAD. (https://shadow.cs.umn.edu). When I intercept
malloc, and run my program through valgrind, it barfs with the error:

"valgrind: Cannot continue: malloc of new_line failed."

My command is something like:
LD_PRELOAD=/path/to/mypreload.so /usr/bin/valgrind /path/to/myprogram...

where mypreload.so contains the malloc() that I am intercepting. The
printf() in my implementation of malloc never gets triggered.

$ uname -a
Linux thor 3.4.6-2.fc17.x86_64 #1 SMP Thu Jul 19 22:54:16 UTC 2012 x86_64
x86_64 x86_64 GNU/Linux

$ valgrind --version
valgrind-3.7.0

I am wondering if there is a way to tell valgrind that I want to set a
library in the LD_PRELOAD env variable AFTER the valgrind initialization is
done but BEFORE my program is run. It seems like this could be a useful
feature for programs that intercept malloc(). What are the options for
programs that want to LD_PRELOAD malloc and run valgrind at the same time?

Regards,
Rob
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to