ng client, core dump on OpenSolaris
Status: Alpha
Brought to you by:
mlamb
Nailgun client will segfault on OpenSolaris, it appears to be because the strlen function on Solaris purposely doesn't handle nulls.
http://technopark02.blogspot.com/2006/04/solaris-null-pointer-bugs-usrlib00so1.html
To fix I modified the sendText function:
void sendText(char chunkType, char *text) {
int len = 0;
if ( text ) {
len = strlen(text);
}
sendHeader(len, chunkType);
sendAll(nailgunsocket, text, len);
}
Fixed in rev 95. Thanks for the fix!
The root cause here is that getcwd on opensolaris is weird. If the first argument you pass it is NULL, it allocates space according to the second argument instead of figuring out how much it should allocate itself and ignoring the second argument. I changed the lone call to getcwd to pass it NULL, MAXPATHLEN (which required adding #include <sys/param.h>). Without that, getcwd was returning a NULL pointer which then got passed to SendText.