Short version: -------------- The glibc argz functions in RHEL produce valgrind warnings about illegal reads. Can I force the use of libltdl's internal argz functionality to avoid these issues?
More details: ------------- This weekend, I finally sat down to figure out some valgrind libltdl warnings that have annoyed me for a very long time (from the embedded libltdl that we have in Open MPI). Here's an example: ----- ==8436== Invalid read of size 8 ==8436== at 0x3D5908848D: _wordcopy_fwd_dest_aligned (in /lib64/libc-2.12.so) ==8436== by 0x3D5908211D: __GI_memmove (in /lib64/libc-2.12.so) ==8436== by 0x3D590897DB: argz_insert (in /lib64/libc-2.12.so) ==8436== by 0x403C8B: lt_argz_insert (ltdl.c:1723) ==8436== by 0x403E71: lt_argz_insertinorder (ltdl.c:1768) ==8436== by 0x4040F3: lt_argz_insertdir (ltdl.c:1826) ==8436== by 0x404298: list_files_by_dir (ltdl.c:1854) ==8436== by 0x40433D: foreachfile_callback (ltdl.c:1882) ==8436== by 0x402053: foreach_dirinpath (ltdl.c:720) ==8436== by 0x404429: lt_dlforeachfile (ltdl.c:1920) ==8436== by 0x40120B: main (main.c:44) ==8436== Address 0x4c2e780 is 16 bytes inside a block of size 21 alloc'd ==8436== at 0x4A066FA: malloc (vg_replace_malloc.c:263) ==8436== by 0x405C96: lt__malloc (lt__alloc.c:54) ==8436== by 0x404049: lt_argz_insertdir (ltdl.c:1814) ==8436== by 0x404298: list_files_by_dir (ltdl.c:1854) ==8436== by 0x40433D: foreachfile_callback (ltdl.c:1882) ==8436== by 0x402053: foreach_dirinpath (ltdl.c:720) ==8436== by 0x404429: lt_dlforeachfile (ltdl.c:1920) ==8436== by 0x40120B: main (main.c:44) ----- You can see that the error is that the glibc argz_insert is apparently doing an optimized memmove that is assumedly doing some kind of 8 byte read. The only problem is that there is less than 8 bytes left in the string (specifically: doing an 8 byte read starting 16 bytes into a 21-byte allocation). This is quite definitely a problem with the RHEL glibc argz -- not libltdl. But it's still quite annoying. I would very much like to avoid the system-level argz for this reason, and use libltdl's internal argz instead. If I manually edit libltdl's m4 to make it fail all the argz tests -- thereby forcing libltdl to use its internal argz functionality -- then all is fine. Can an option be added to make this supported functionality, perchance? I would be happy to provide a patch if the idea isn't terrible. -- Jeff Squyres jsquy...@cisco.com For corporate legal information go to: http://www.cisco.com/web/about/doing_business/legal/cri/ _______________________________________________ https://lists.gnu.org/mailman/listinfo/libtool