From: Alan W. I. <ir...@be...> - 2002-07-14 18:58:19
|
For reasons explained in the recent commit messages I have stopped linking the dynamic drivers to libplplot (although I link libplplot to tk, xwin, and tkwin). The resulting C examples work fine, but the resulting python and java examples do not. (This is an old issue which we have discussed before which I am forced to revisit now.) Also, with this change valgrind starting complaining about the lack of an ".so" on the ends of the dynamic driver names and then aborted with an internal error. I got around that problem by changing all our dynamic driver dll file names so they had a ".so" suffix. With that change valgrind --num-callers=50 -v ./x01c -dev psc -o test.ps worked fine, but valgrind --num-callers=50 -v python ./test.py -dev psc -o test.ps did not. test.py is a modified version of pythondemos.py which executes just the first example. Here are the relevant valgrind messages: ==17017== Reading syms from /home/software/plplot_cvs/HEAD/plplot_working3/tmp/drivers/psd_drv.so ==17017== object doesn't have any debug info ==17017== discard syms in /home/software/plplot_cvs/HEAD/plplot_working3/tmp/drivers/psd_drv.so due to munmap() ==17017== discard 0 (0 -> 0) translations in range 0x43ADB000 .. 0x43AE1FFF Unable to load driver: psd_drv.so. Reason: /usr/local/plplot/lib/plplot5.1.0/data/../drivers/psd_drv.so: cannot open shared object file: No such file or directory ==17017== ==17017== Jump to the invalid address stated on the next line ==17017== at 0x0: ??? ==17017== by 0x43054483: c_plinit (in /home/software/plplot_cvs/HEAD/plplot_working3/tmp/libplplotd.so.5.1.0) ==17017== by 0x4300FBC9: _wrap_plinit (plplotcmodule.c:2636) ==17017== by 0x8058BFA: (within /usr/bin/python2.1) ==17017== by 0x8057699: (within /usr/bin/python2.1) ==17017== by 0x8054DD9: (within /usr/bin/python2.1) ==17017== by 0x806C933: (within /usr/bin/python2.1) ==17017== by 0x806C8EA: (within /usr/bin/python2.1) ==17017== by 0x806C8BE: (within /usr/bin/python2.1) ==17017== by 0x806BCD1: (within /usr/bin/python2.1) ==17017== by 0x806B82C: (within /usr/bin/python2.1) ==17017== by 0x8051EA0: (within /usr/bin/python2.1) ==17017== by 0x8051954: (within /usr/bin/python2.1) ==17017== by 0x4029B14F: (within /lib/libc-2.2.5.so) ==17017== by 0x8051881: (within /usr/bin/python2.1) ==17017== Address 0x0 is not stack'd, malloc'd or free'd Anybody got any clue why the syms are being discarded (presumably by the dynamic loader using munmap) from psd_drv.so above? If I link psd_drv.so to libplplot, that line and all subsequent error messages disappear from the valgrind output, psd_drv.so is loaded properly (presumably since there are no error messages saying anything is wrong about the load), and test.ps is generated without any further errors. There is no change in size of drivers/psd_drv.so whether it was linked to libplplot or not. I also used nm (with and without --dynamic) on psd_drv.so either linked with libplplot or not. There was no change in the number of symbols or their status flags. The offsets were changed by small amounts (variable, but usually 16 bytes) so some internal rearrangement was going on, but the changes apparently have nothing to do with the number of symbols or their status flags. I wouldn't be surprised if this issue (the dynamic loader [presumably] discarding symbols with munmap when psd_drv.so is not linked with libplplot) could be resolved by a ld option, but the question is which one? The other possibility is to resort to some Makefile trickery so that first libplplot is linked without the link to the tk, xwin, and tkwin dynamic drivers, then the dynamic drivers are linked to that libplplot, then libplplot is relinked with the proper links to the tk, xwin, and tkwin dynamic drivers. But if there is some other easy way around this problem, I would prefer to take it. Thus any help to sort out this problem would be most appreciated. Current status after recent round of commits. x??c examples work, and I also checked that plserver (either tkdemos.tcl or runAllDemos.tcl) works as well. python and java examples do not work because of the above problem. Alan email: ir...@be... phone: 250-727-2902 FAX: 250-721-7715 snail-mail: Dr. Alan W. Irwin Department of Physics and Astronomy, University of Victoria, P.O. Box 3055, Victoria, British Columbia, Canada, V8W 3P6 __________________________ Linux-powered astrophysics __________________________ |