It's weird, I got this user case crashes most of the time only if the host name provides as ip instead of name:
Test 1: Crashed
===============
string=chrome-extension://ghoecokkcppedofniagnacalihpgmmig/connect.html connection.js:81
hostname=192.168.10.10
username=testuser
password=testpassword
resolution=1024x768
starts getopt_long()
argc=10 opt=u optind=3 optIndex=1044709248
starts getopt_long()
argc=10 opt=p optind=5 optIndex=1044709248
starts getopt_long()
argc=10 opt=g optind=7 optIndex=1044709248
starts getopt_long()
argc=10 opt=a optind=9 optIndex=1044709248
starts getopt_long()
NativeClient: NaCl module crashed
Test 2: Worked
==============
string=chrome-extension://ghoecokkcppedofniagnacalihpgmmig/connect.html connection.js:81
hostname=testhost
username=testuser
password=testpassword
resolution=1024x768
starts getopt_long()
argc=10 opt=u optind=3 optIndex=1044709248
starts getopt_long()
argc=10 opt=p optind=5 optIndex=1044709248
starts getopt_long()
argc=10 opt=g optind=7 optIndex=1044709248
starts getopt_long()
argc=10 opt=a optind=9 optIndex=1044709248
starts getopt_long()
argc=10 opt=-1 optind=9 optIndex=1044709248
extern void nacl_debug(char *debugstr);
extern int optind ;
int testgetopt_main( int argc, char ** argv )
{
int opt ;
int optIndex ;
char dbgmsg[128];
static const struct option options[] = {
{ "color", required_argument, 0, 'a' },
{ "resolution", required_argument, 0, 'g' },
{ "user", required_argument, 0, 'u' },
{ "password", required_argument, 0, 'p' },
//Terminate the list
{ NULL, 0, 0, 0 }
} ;
#define OPTION_FLAGS ":045a:AbB:c:Cd:DeEfg:GhIk:KLmM:n:Np:Ps:S:r:t:T:u:x:X:z~:@:"
while ( 1 ) {
nacl_debug("starts getopt_long()");
opt = getopt_long( argc, argv, OPTION_FLAGS, options, &optIndex ) ;
if ( opt == -1 ) {
sprintf(dbgmsg, "argc=%d opt=%d optind=%d optIndex=%d", argc, opt, optind, optIndex);
nacl_debug(dbgmsg);
break ;
} else {
sprintf(dbgmsg, "argc=%d opt=%c optind=%d optIndex=%d", argc, opt, optind, optIndex);
nacl_debug(dbgmsg);
}
}
argc -= optind;
argv += optind;
return 1;