Software Bug Adds 5K Votes To Election
eldavojohn writes "You may be able to argue that a five-thousand-vote error is a small price to pay for a national election, but these errors are certainly inadmissible on a much smaller scale. According to the Rapid City Journal, a software glitch added 4,875 phantom ballots in a South Dakota election for a seat on the city council. It's not a hardware security problem this time; it's a software glitch. Although not unheard of in electronic voting, this bug was about to cause a runoff vote since the incumbent did not hold a high enough percentage of the vote. That is no longer the case after the numbers were corrected. Wired notes it's probably a complex bug as it is not just multiplying the vote count by two. Here's to hoping that AutoMark follows suit and releases the source code for others to scrutinize."
Ah, "Shaky" Jim was off his meds again.
Additions just aren't so simple anymore in concurrent computing. The obvious way to do addition in gcc c would be:
totalVotes[candidate]++;
but this will totally screw up the vote count, whereas
__sync_add_and_fetch(&totalVotes[candidate], 1);
gets it right.
void vote(int candidate)
{
switch (candidate)
{
case GEORGE_BUSH:
totalVotes[GEORGE_BUSH] ++;
case AL_GORE:
totalVotes[AL_GORE] ++;
break;
}
}
Someone forgot to clear the chad bit!
"The only legitimate use of a computer is to play games." - Eugene Jarvis
Yes, but it's hilarious when there were only 5600 actual votes cast. +/-100% error bars, is good enough for government work apparently.
eh...your first case statement is missing a break. As it currently stands, a vote for GEORGE_BUSH also adds a vote for AL_GORE. I dunno maybe you left it out on purpose to make a point? I guess the bigger question is: why do I care? The answer of course is because I have no friends.