diff --git a/.hgtags b/.hgtags index ab9da41a35db6bc4683be49bfc93dc6c03a304bb..d6e1cb6b7a6fd5a80dd7846947035b7ade2297e4 100644 --- a/.hgtags +++ b/.hgtags @@ -1280,3 +1280,8 @@ fa7fe6dae563edaae8a8bbe8ac4bd4fa942bde0c jdk8u232-b03 921c5ee7965fdfde75f578ddda24d5cd16f124dc jdk8u232-b04 b13d7942036329f64c77a93cffc25e1b52523a3c jdk8u232-b05 760b28d871785cd508239a5f635cfb45451f9202 jdk8u242-b00 +fea2c7f50ce8e6aee1e946eaec7b834193747d82 jdk8u232-b06 +c751303497d539aa85c6373aa0fa85580d3f3044 jdk8u232-b07 +4170228e11e6313e948e6ddcae9af3eed06b1fbe jdk8u232-b08 +12177d88b89c12c14daa5ad681030d7551e8a5a0 jdk8u232-b09 +12177d88b89c12c14daa5ad681030d7551e8a5a0 jdk8u232-ga diff --git a/THIRD_PARTY_README b/THIRD_PARTY_README index eddee26a02c039e7e9763fbc56a6a43f8b6bd1c8..7dc54a05723a0056c78d88ffc9f5515672643204 100644 --- a/THIRD_PARTY_README +++ b/THIRD_PARTY_README @@ -2130,13 +2130,13 @@ Exhibit B - "Incompatible With Secondary Licenses" Notice ------------------------------------------------------------------------------- -%% This notice is provided with respect to PC/SC Lite for Suse Linux v.1.1.1, +%% This notice is provided with respect to PC/SC Lite v1.8.24, which may be included with JRE 8, JDK 8, and OpenJDK 8 on Linux and Solaris. --- begin of LICENSE --- -Copyright (c) 1999-2004 David Corcoran -Copyright (c) 1999-2004 Ludovic Rousseau +Copyright (c) 1999-2003 David Corcoran +Copyright (c) 2001-2011 Ludovic Rousseau All rights reserved. Redistribution and use in source and binary forms, with or without @@ -2148,15 +2148,10 @@ are met: 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. -3. All advertising materials mentioning features or use of this software - must display the following acknowledgement: - This product includes software developed by: - David Corcoran - http://www.linuxnet.com (MUSCLE) -4. The name of the author may not be used to endorse or promote products +3. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. -Changes to this license can be made only by the copyright author with +Changes to this license can be made only by the copyright author with explicit written consent. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR diff --git a/agent/src/os/linux/ps_proc.c b/agent/src/os/linux/ps_proc.c index abf2d60fd5bc6315eb773f0934abe86feba74a40..c4d6a9ecc5daaa0311f203c6103a57ac18e72baa 100644 --- a/agent/src/os/linux/ps_proc.c +++ b/agent/src/os/linux/ps_proc.c @@ -345,7 +345,7 @@ static bool add_new_thread(struct ps_prochandle* ph, pthread_t pthread_id, lwpid static bool read_lib_info(struct ps_prochandle* ph) { char fname[32]; - char buf[256]; + char buf[PATH_MAX]; FILE *fp = NULL; sprintf(fname, "/proc/%d/maps", ph->pid); @@ -355,10 +355,41 @@ static bool read_lib_info(struct ps_prochandle* ph) { return false; } - while(fgets_no_cr(buf, 256, fp)){ - char * word[6]; - int nwords = split_n_str(buf, 6, word, ' ', '\0'); - if (nwords > 5 && find_lib(ph, word[5]) == false) { + while(fgets_no_cr(buf, PATH_MAX, fp)){ + char * word[7]; + int nwords = split_n_str(buf, 7, word, ' ', '\0'); + + if (nwords < 6) { + // not a shared library entry. ignore. + continue; + } + + // SA does not handle the lines with patterns: + // "[stack]", "[heap]", "[vdso]", "[vsyscall]", etc. + if (word[5][0] == '[') { + // not a shared library entry. ignore. + continue; + } + + if (nwords > 6) { + // prelink altered mapfile when the program is running. + // Entries like one below have to be skipped + // /lib64/libc-2.15.so (deleted) + // SO name in entries like one below have to be stripped. + // /lib64/libpthread-2.15.so.#prelink#.EECVts + char *s = strstr(word[5],".#prelink#"); + if (s == NULL) { + // No prelink keyword. skip deleted library + print_debug("skip shared object %s deleted by prelink\n", word[5]); + continue; + } + + // Fall through + print_debug("rectifying shared object name %s changed by prelink\n", word[5]); + *s = 0; + } + + if (find_lib(ph, word[5]) == false) { intptr_t base; lib_info* lib; #ifdef _LP64 diff --git a/test/runtime/RedefineTests/RedefineDoubleDelete.java b/test/runtime/RedefineTests/RedefineDoubleDelete.java index 7b18b45f1fd708d058fc26bc6dd5e99b9d756a2d..1f4533f8e6e6f4f9c7f72fa54924432d926564a7 100644 --- a/test/runtime/RedefineTests/RedefineDoubleDelete.java +++ b/test/runtime/RedefineTests/RedefineDoubleDelete.java @@ -24,7 +24,11 @@ /* * @test * @bug 8178870 + * @library /testlibrary * @summary Redefine class with CFLH twice to test deleting the cached_class_file + * @build RedefineClassHelper + * @run main RedefineClassHelper + * @run main/othervm -javaagent:redefineagent.jar RedefineDoubleDelete */ public class RedefineDoubleDelete {