Hi Gene, I still have an issue on this point.
I want to overload pthread_create. I tried to use ld --wrap, LD_PRELOAD or DMTCP plugin but I always fail. I send you the small test I made. Using ld --wrap mechanism, dmtcp_checkpoint works fine, I can see that my function is called. But dmtcp_restart doesn't use it to restart the threads, my function will be called only for the new threads created after the checkpoint. You should reproduce it with my test : $ make clean all USE_WRAP=1 $ dmtcp_checkpoint ./test_pthread => you will see the "wrap_new.c Wrapper around __wrap_pthread_create" messages $ ./dmtcp_restart_script_xxx_00002.sh => the message is not printed at the beginning of the run Using LD_PRELOAD with a pthread_create function, my function is never called $ make clean all USE_WRAP=0 $ export LD_PRELOAD=./libwrap.so Using the DMTCP plugin, I have the same behaviour as the first case : $ unset LD_PRELOAD $ make clean all USE_WRAP=0 $ dmtcp_checkpoint --with-module ./libmodule.so ./test_pthread => you will see the "wrap_dmtcp.c Wrapper around pthread_create" messages $ ./dmtcp_restart_script_xxx_00002.sh => the message is not printed at the beginning of the run Is it possible to the user function to be called at restart time ? Thanks, Fred 2012/5/15, Gene Cooperman <[email protected]>: > Hi Fred, > > Sorry for the delay in replying. If you're using the --wrap option for > your own symbols (which is the common case), I'm sure there's no conflict. > > If you should also want to write a wrapper around a system call > (around a function from libc.so, libpthread.so, etc.), then it > should work, but we haven't done much testing in this case. If you > find a problem here, please tell us, and we'll fix it. > > Also, an easy way to write wrappers around system calls is to > use the DMTCP plugin facility (formerly called DMTCP modules). > DMTCP version 1.2.5 should appear "any day now", and will use the > new "plugin" terminology. For more information, see: > http://dmtcp.sourceforge.net/FAQ.html#plugins > (In DMTCP-1.2.3 and DMTCP-1.2.4, the directory was called 'module'.) > > Best, > - Gene (for the DMTCP team) > > On Thu, May 10, 2012 at 06:57:52PM +0200, rtsw dev wrote: >> Hi, >> >> Does DMTCP supports if I used function interpositions with the linker >> option --wrap ? >> >> If I overload functions and use dlsym to call the original one, the >> LD_PRELOAD of DMTCP will overload my functions and it seems to work >> fine. But when the function is called __wrap_xxx will it be overloaded >> ? >> >> Regards, >> Fred >> >> ------------------------------------------------------------------------------ >> 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/ >> _______________________________________________ >> Dmtcp-forum mailing list >> [email protected] >> https://lists.sourceforge.net/lists/listinfo/dmtcp-forum > ------------------------------------------------------------------------------ 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/ _______________________________________________ Dmtcp-forum mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/dmtcp-forum
