|
From: Andy B. <aba...@ca...> - 2003-04-16 03:38:53
|
I think I found the problem with wrapperBuildJavaCommand() in wrapper_unix.c on Mac OS X. I don't know what the size of a "char *" is on other systems, but on my Mac "sizeof(char *)" returns 4. So code like this is inadequate: > wrapperData->jvmCommand = malloc(sizeof(char *) * length + 1); Instead of "+1" you need "+4", or better yet: > wrapperData->jvmCommand = malloc(sizeof(char *) * (length + 1)); Likewise for the other malloc line in that method: > wrapperData->jvmCommand[i] = malloc(sizeof(char *) * > (strlen(strings[i]) + 1)); Perhaps I should put 'C Programming' back on my resume :) ~Andy On Tuesday, April 15, 2003, at 05:19 PM, Mike Castle wrote: > In article <bs4...@th...>, > Mike Castle <wra...@li...> wrote: >> Hmm... I was going to try ElectricFence, but that didn't get me very >> far. >> Changing console() to do >> exec df $WRAPPER_CMD ... >> And core dump right away. >> >> Running NodeWarrior Analytics Server... >> >> Electric Fence 2.2.0 Copyright (C) 1987-1999 Bruce Perens >> <br...@pe...> >> >> ElectricFence Aborting: Allocating 0 bytes, probably a bug. > > Ok, setting EF_ALLOW_MALLOC_0 seems to fix that (bug mabye OSX has > issues > with malloc(0); wouldn't think so being BSD derived, but you never > know). |