2b74a1c5c26450d0201a91d35c81dc844eddaedd kent Sun Feb 2 15:59:22 2014 -0800 Fixing crash on empty message sent to main message queue. diff --git src/parasol/paraHub/paraHub.c src/parasol/paraHub/paraHub.c index 93ff967..bfb4e6b 100644 --- src/parasol/paraHub/paraHub.c +++ src/parasol/paraHub/paraHub.c @@ -3357,31 +3357,33 @@ startSpokes(); logDebug("sockSuck,Heartbeat,Spokes have been started"); /* Bump up our priority to just shy of real-time. */ nice(-40); /* Main event loop. */ for (;;) { struct paraMessage *pm = hubMessageGet(); findNow(); line = pm->data; logDebug("hub: %s", line); command = nextWord(&line); - if (sameWord(command, "jobDone")) + if (command == NULL) + warn("Empty command"); + else if (sameWord(command, "jobDone")) jobDone(line); else if (sameWord(command, "recycleSpoke")) recycleSpoke(line); else if (sameWord(command, "heartbeat")) processHeartbeat(); else if (sameWord(command, "setPriority")) setPriorityAcknowledge(line, pm); else if (sameWord(command, "setMaxJob")) setMaxJobAcknowledge(line, pm); else if (sameWord(command, "resetCounts")) resetCountsAcknowledge(line, pm); else if (sameWord(command, "freeBatch")) freeBatchAcknowledge(line, pm); else if (sameWord(command, "flushResults")) flushResultsAcknowledge(line, pm); @@ -3423,31 +3425,33 @@ listBatches(pm); else if (sameWord(command, "listAllBatches")) listAllBatches(pm); else if (sameWord(command, "listSick")) listSickNodes(pm); else if (sameWord(command, "status")) status(pm); else if (sameWord(command, "pstat")) pstat(line, pm, FALSE); else if (sameWord(command, "pstat2")) pstat(line, pm, TRUE); else if (sameWord(command, "addSpoke")) addSpoke(); else if (sameWord(command, "plan")) plan(pm); - if (sameWord(command, "quit")) + else + warn("Unrecognized command %s", command); + if (command != NULL && sameWord(command, "quit")) break; pmFree(&pm); } endHeartbeat(); killSpokes(); saveJobId(); #ifdef SOON #endif /* SOON */ } void fillInSubnet() /* Parse subnet paramenter if any into subnet variable. */ { char *sns = optionVal("subnet", NULL); if (sns == NULL)