|
From: Tom H. <th...@cy...> - 2005-02-09 19:57:53
|
CVS commit by thughes:
Don't modify LD_LIBRARY_PATH as it is no longer needed now that we are
using the system pthread library. This fixes the long standing problem
with the JVM continuously re-execing itself.
M +2 -33 vg_main.c 1.245
--- valgrind/coregrind/vg_main.c #1.244:1.245
@@ -738,8 +738,6 @@ static char **fix_environment(char **ori
{
static const char inject_so[] = "vg_inject.so";
- static const char ld_library_path[] = "LD_LIBRARY_PATH=";
static const char ld_preload[] = "LD_PRELOAD=";
static const char valgrind_clo[] = VALGRINDCLO "=";
- static const int ld_library_path_len = sizeof(ld_library_path)-1;
static const int ld_preload_len = sizeof(ld_preload)-1;
static const int valgrind_clo_len = sizeof(valgrind_clo)-1;
@@ -773,5 +771,5 @@ static char **fix_environment(char **ori
/* Allocate a new space */
- ret = malloc(sizeof(char *) * (envc+3+1)); /* 3 new entries + NULL */
+ ret = malloc(sizeof(char *) * (envc+1+1)); /* 1 new entry + NULL */
vg_assert(ret);
@@ -785,23 +783,5 @@ static char **fix_environment(char **ori
/* Walk over the new environment, mashing as we go */
for (cpp = ret; cpp && *cpp; cpp++) {
- if (memcmp(*cpp, ld_library_path, ld_library_path_len) == 0) {
- /* If the LD_LIBRARY_PATH already contains libdir, then don't
- bother adding it again, even if it isn't the first (it
- seems that the Java runtime will keep reexecing itself
- unless its paths are at the front of LD_LIBRARY_PATH) */
- if (!scan_colsep(*cpp + ld_library_path_len, contains)) {
- int len = strlen(*cpp) + vgliblen*2 + 16;
- char *cp = malloc(len);
- vg_assert(cp);
-
- snprintf(cp, len, "%s%s:%s",
- ld_library_path, VG_(libdir),
- (*cpp)+ld_library_path_len);
-
- *cpp = cp;
- }
-
- ld_library_path_done = 1;
- } else if (memcmp(*cpp, ld_preload, ld_preload_len) == 0) {
+ if (memcmp(*cpp, ld_preload, ld_preload_len) == 0) {
int len = strlen(*cpp) + inject_path_len;
char *cp = malloc(len);
@@ -820,15 +800,4 @@ static char **fix_environment(char **ori
/* Add the missing bits */
-
- if (!ld_library_path_done) {
- int len = ld_library_path_len + vgliblen*2 + 16;
- char *cp = malloc(len);
- vg_assert(cp);
-
- snprintf(cp, len, "%s%s", ld_library_path, VG_(libdir));
-
- ret[envc++] = cp;
- }
-
if (!ld_preload_done) {
int len = ld_preload_len + inject_path_len;
|