views:

20577

answers:

20

News reports such as this one indicate that the above number may have arisen as a programming bug.

A man in the United States popped out to his local petrol station to buy a pack of cigarettes - only to find his card charged $23,148,855,308,184,500.

That is $23 quadrillion (£14 quadrillion) - many times the US national debt.*

In hex it's $523DC2E199EBB4 which doesn't appear terribly interesting at first sight.

Anyone have any thoughts about what programming error would have caused this?

+1  A: 

Probably just a corrupt bit or something during the network communication or a write that error checking failed to catch.

Or they were really nice cigarettes.

samoz
Which is probably what the software guys will say when they close the ticket.
gbarry
The corrupt bit or the quality of cigarettes?
samoz
+85  A: 

I once heard those numbers come over the radio as I was flying across the Pacific.

eduffy
that made me happy
Ori Cohen
THE NUMBERS ARE BAD!
Spencer Ruport
Did you crash landed anywhere afterwards? :D
Adrian Godong
Whatever you do, don't read them backwards!
Guffa
For those who missed the bus, this is a reference to "LOST"
zvolkov
That was lost on me... ;)
Guffa
What's the frequency, Kenneth?
Nosredna
was this on an air france jet by any chance?
Karl
http://www.archive.org/details/ird059
Doug Chase
terrific answer! )
Andrew
+1091  A: 

Add the cents to the number and you get 2314885530818450000, which in hexadecimal is 2020 2020 2020 1250.

Do you see the pattern? The first six bytes have been overwritten by spaces (hex 20, dec 32).

Guffa
Once again proving that whitespace is not innocuous.
Eric
A winner is you!
spoulson
if this is true, you just won a prize for "best debug of the year" :)
Stefano Borini
Like a buffer (or stack!) overflow
gbarry
Someone get this man a job at NASA or something.
spoulson
So I guess silence really is golden.
samoz
VISA might need him more than NASA.
Brandon
Probably mail that comment to the company, I'm sure they'd be interested in hearing from you.
samoz
Looks like he bought a carton, not a pack - hex 1250 = dec 4688, or £46.88
John Rasch
nerds: find out brand and amount of cigarettes a man smokes by debugging his wrong credit card report ;)
Stefano Borini
Thats why I always call .Trim(), just to be safe.
Frank Schwieterman
3 is a magic number
Nosredna
Now we just need a way to get them to deposit `______1000` into our accounts...
John Rasch
@John Rasch: it's dollar's not pounds. It happened in the US. The BBC does give the pounds equiv. in the article though.
Dinah
@John Rasch: Since it was a US buyer, it would be hex 1250 = dec 4688 or **$**46.88. That is a bit of a difference. Not sure why TFA also gave a price in pounds?
Mike Cooper
@Dinah,@Mike - meh, I had dollars originally than copy/pasted the pound sign because it was a UK article, oh well I can't edit it now!
John Rasch
For all we know the price could have been $12.50. Or some of the price could have been overwritten.
Nosredna
0x1250 could also be $18.80 (if cents are kept separately), or possibly the string Ctrl-R + P.
Wedge
I wonder if you should be sending them an email.
quillbreaker
As I added the two zeroes for the cents, that suggests that the amount is stored as cents in a 64 bit integer. If the two last bytes were untouched, that would make the original amount $46.88 + n * $655.36, where n is likely to be zero.
Guffa
$46.88 seems like about the right price for a carton of cigarettes in New Hampshire.
rmeador
The real question is: why would they store transaction amounts in a 64bit unsigned integer? Sure, 32 bits aren't enough for purchases >32 million, but maybe those should be treated specially anyway...
perimosocordiae
Perhaps anticipating the inflation, avoiding the $21M bug... :)
Guffa
can someone notify the media? i bet they would follow up on this if they could ever understand it
JoelFan
@Stefano - they're Lucky Strikes. Duh.
Don Branson
Best debug of the year? It was the very first thing I tried when I saw this.
Loren Pechtel
[x] Check here to make whitespace visible
wilhelmtell
I once wondered why 49.7 days was the magic time for Windows issues, since 2^22 seconds was 48.5 days. Then I read that it was 2^32 milliseconds.
Andrew Grimm
@perimosocordiae: it's not necessarily unsigned. The 1st nibble is 2 so that's: 0010. The first bit is likely the sign bit.
Dinah
WOW! +10000 from me :)
the_drow
Damm. Nice. Shame this thread is CW, you deserve those points.
Simon P Stevens
Now I know why you don't ask questions: you have all the answers. Nice show. :)
Robert S.
simply wow man :)
Gregory Mostizky
I think it supposed to be BCD, not 2's complement binary, so it is $12.50, not $46.88. There is more than one way to store numbers! This might be a COBOL problem
Gerry
@Gerry: It's definitely not $12.50. If it would be BCD then the value doesn't correspond to spaces, so there is no 1250 leftover...
Guffa
Upvoted because the score was 666 when I got here. :)
hobbs
highest voted answer of all time on SO?
Neil N
@Neil: no, I saw something higher than 1k once.
Stefano Borini
ohmygod this question has 911 votes!
martinus
Brilliant! Thumbs up.
NLV
Explanation for 12.50 and how this happened is here: http://stackoverflow.com/questions/1133581/is-23-148-855-308-184-500-a-magic-number-or-sheer-chance/2642339#2642339
Hans Passant
Even better is that this answer has 1024 upvotes
Jeff Davis
@Jess: Now it is 1048. But if we wait 1000 points, it will be cool again.
Andreas Rejbrand
A: 

4815162342 now that's a magic number.

Sani Huttunen
Man I'm so "lost"...
Will Bickford
A: 

If the number was in IEEE 754, then the significand could have been 2.3148855308184500 and the exponent got mangled from 1 to 54 by some bug, causing the massive price explosion.

Christopher
I work for a financial institution, and I can say that only a fool uses floating point for dollar amounts. (Rounding issues can cause major bugs.) Of course, something horrible did happen...
Adam Crume
@Adam Crume, what do you use? some Arbitrary-precision arithmetic? http://en.wikipedia.org/wiki/Arbitrary-precision_arithmeticPlain integers, other?
Liran Orevi
*All* financial institutions work in integer cents, or sometimes integer tenth-cents.
Xanthir
This is a popular misconception. You don't use floating point in accounting of actual cashflows, but you do use FP all over the place in financial modelling and derivatives pricing (which is what *financial institutions* also do). Just nitpicking.
quant_dev
+2  A: 

There are any number of things that could cause a very rare error like this - race conditions and alpha radiation, just to name two. If the error changed a pointer rather than the value being used, it would change the value to just about any random number. Bitwise, large random numbers are more likely than small random numbers.

Edit: It certainly appears to be a software bug, since 13000 other people were affected.

http://www.cnn.com/2009/US/07/15/quadrillion.dollar.glitch/index.html

Mark Ransom
aren't you talking about gamma radiation? When gamma ray it the atmosphere, they disintegrate into a gerb of neutrons which can in turn know off electrons from circuitry
Eric
know -> knock .
Eric
No, I was speaking of alpha radiation generated by the RAM packaging itself - http://en.wikipedia.org/wiki/Alpha_rays#Alpha_radiation_and_RAM_memory_errors . I don't know how gamma rays affect circuitry that isn't space hardened.
Mark Ransom
What I find intriguing is the fact that "fewer than 13000 transactions" were "inaccurately posted to a small number" of accounts. In the scale of Visa, yes, that 13k transactions is a small number, but ... Imagine being the one person that got *two* "erroneous postings".
Adrien
A: 

Even more magic-number-mania:

1,597,463,007

John Rasch
No sqrt for you!
Will Bickford
+1, I dunno, I kinda like it
Shawn
+15  A: 
The Windows calculator in scientific mode can do this, no need to go to a web calculator.
Loren Pechtel
Sorry, most people have the Web to hand.
hendry
@Loren Pechtel: many people don't use Windows... (of course they could probably use their native desktop calculator)
Zifre
@Zifre the kind of people who aren't using Windows are either a) the kind of people who do hexadecimal math in their heads, or b) the kind of people who don't know what a hexadecimal number is in the first place (I'm looking at you, graphic design MacHeads.)
raimesh
+16  A: 

If you remove the trailing zero, this validates as a VISA card number. My guess is they swiped the card then manually entered the number, thinking the swipe had failed.

lol - Have we just published his Visa Card number?.. What was his name again?
ian_scho
p.s. THIS is the most likely answer, the 200+ upvotes for the first answer are by geeks :)There are around 50+ Billion Visa Transactions a year.
ian_scho
No, it was a bug, not a usage error. About 13000 customers were affected by this bug.
Guffa
-1 - Visa card numbers start with 4, not 2
John Rasch
What's the likelihood that the first six bytes would be spaces by sheer chance?
Robert Harvey
Unlikely.. there were multiple transactions with different customers, all involving the exact same amount!
Roddy
John Rasch: Really? I didn't know that! So why do we always have to indicate whether it's Visa, Mastercard, etc. when we're shopping online?
MatrixFrog
@MatrixFrog: Not always. Some sites do recognize the card just by the number.
Chetan Sastry
@MatrixFrog: It's a legacy left over from Visa/Mastercard merchant contracts that require merchants to force the user to identify the card. This was a really bad attempt at improving security by obscurity - making the assumption that it's hard to guess the card issuer if you only had the number. The issuer was verified against the value that user selected. However the lead card number patterns are well known to developers and CC thieves so it's not really "required" any more.
Paul Alexander
+1  A: 

If you use the binary equivelant (1110101110110100) decode of the number 23148855308184500, you get K鑛, which is the Mandarin character for mining and ore. Kmine could mean "knowledge mine," or something like kmine Holdings Ltd. Perhaps there's a correlation between K(mine or ore) and Bank of America or Visa?

I think everything is much more deeper that this. If you multiply this number by the height of Pyramid of Khufu and then multiply every third number by 2012 you will get exactly 1/666 length to the Alpha Centauri.
serg
@serg555: This is scary...
Andreas Rejbrand
+50  A: 

What happens when you make a purchase by card is that the software immediately goes online to ensure you have sufficient funds for the purchase, but only places a hold on the funds for the transaction. At the end of the working day the software then gathers all the transactions placed in the last 24hrs and submits them to the acquiring bank for processing.

The submission to the bank is known as settlement, and its done by sending a plain text file in a very rigid format. (This was all developed decades ago and the number of systems now using it makes it hard to modernise)

Each transaction appears in the file as a line of text, and part of that is the transaction value. This field should be 11 numeric characters (zero padded on the left hand side) and will always hold the value in lowest common denominator (in this case cents). 11 numeric characters caters well for values in any currency.

Looks like the payment processor in this case had made some changes to their submission software and erroneously replaced the zero padding with space padding. Quite how this got by a) service provider, b) acquiring bank and c) Visa without being picked up escapes me. The net value of that settlement file (13,000 high value transactions) would have been astronomical, and maybe that also was a contributing factor somewhere.

PaulG
"11 numeric characters caters well for values in any currency." -- what about Zimbabwean dollars?
quant_dev
Who's paying by VISA in Zimbabwe? (^_^)
RegDwight
People with dollars.
Marcus Downing
Then they're not Zimbabwean dollars anyway, right?
Marcus Lindblom
That's a good comment. But if it was a software glitch, then there's no proving that a) service provider, b) acquiring bank and c) Visa all saw it at all. It could have arisen at any point.
Isaac Lubow
+29  A: 

Batman: Pretty fishy what happened to me on that ladder.

Gordon: You mean, where there's a fish, there could be a Penguin.

Robin: But wait! It happened at sea! See? "C" for Catwoman!

Batman: Yet... an exploding shark was pulling my leg!

Gordon: The Joker!

O'Hara: [It] all adds up to a sinister riddle. Riddle-er. Riddler?

Gordon: Oh! A thought strikes me! So dreadful I scarcely dare give it utterance.

Batman: The four of them. Their forces combined...

Robin: Holy nightmare!

Ryan
+1 for old school Batman reference
Andy_Vulhop
Is that actual dialog from the 60's show?
eduffy
The exploding shark pulling leg seems to trigger something in my addled brain. Isn't this the movie based on the classic Batman series, with the same actors in it?
peSHIr
Yes, this is the film, where the four baddies team up and dehydrates the members of the UN, turning them into piles of different-coloured sand which soon gets all mixed up. Luckily Batman has a machine that can sort out the sand into its component colours, and manages to rehydrate the ambassadors - who carry on arguing in their own languages as if nothing has happened. Impressive that I remember all that, or just sad?
Daniel Roseman
Holy bad dialog, Batman! That show is campier than I remember!
Beska
@Daniel Roseman - Almost correct, though the ambassadors are rehydrated and continuing to argue, their languages are mixed up (i.e. their minds got swapped around)
Grant Peters
+20  A: 

Nope you're all wrong, these are just london prices :-)

Karl
+9  A: 

More Information:

More information from Consumerist and Slashdot

abelenky
A: 

Most financial cc gateways use SOAP as a transfer protocol. Extra spaces in there along with a changed gateway interface on the receiving end could definitely account for this.

+173  A: 
Synetech inc.
+1: nice answer
Stefano Borini
Another one in salem: http://www.1010wins.com/Visa-Accidentally-Bills-New-York-Teen--23-Quadrill/4867372
Otto Allmendinger
That article doesn’t specify the number, but I think it is safe to assume that it is identical to all the others.
Synetech inc.
Possibly the number hex 1250 = dec 4688 is the minimum to cause some sort of extra methods of fraud checking. If it is exactly equal to this a bug in the code is introduced?
PeteT
+1 can you imagine what would happen if the 13,000 customers did a chargeback at the same time? :P
pageman
@petebob796 actually each byte is treated separately, so 1250 (12 50) is 18 and 80. 18 is a control char and 80 is capital P (at least in ASCII). Hmmm... Ctrl+P?
WildJoe
$12.50 is a relativly small and round numer. It's not at all surprizing that out of millions of transactions 13,000 had that exact amount. But it does need to be combined with some other logic flaw that triggered the overwrite.
Tom A
12.50 is small and round, but it's a completely different number from 0x12.50. And if there's anyone out there paying $12.50 for one pack of cigarettes, I'm glad I quit.
Roger Pate
+1  A: 

Sounds like Salami Slicing, LOL

Phill Pafford
+53  A: 

Well, let's look at the number 23,148,855,308,184,500. The first two digits are 23 - a number known to be tied to many numerological conspiracies, and even the subject of several documentaries. Add all the digits, 2+3+1+4+8+8+5+5+3+0+8+1+8+4+5+0+0 = 11, which we'll get back to in a moment. The hexadecimal form of the number, 523DC2E199EBB4, shows a pair of 9s. So we have three numbers that stand out - 23, 9, and 11. Thus, this case is really the final proof that the Illuminati was behind 9/11.

2 + 3 + 1 + 4 + 8 + 8 + 5 + 5 + 3 + 0 + 8 + 1 + 8 + 4 **+ 5** + 0 + 0 = 65. 6 + 5 = 11. It's all in the numerology. ;-)
Head Geek
absolutely hilarious!
Andrew
But 11 is not a valid number in numerology, it has to be reduced to: 11=1+1=2.
Synetech inc.
So the illuminati were behind 9/11 and this transaction signifies the second coming.
Kevin Peno
+5  A: 

The ultimate mystery is still where 12 50 is coming from. They are the ASCII codes for Ctrl+R, P. Which happens to be the secret keystrokes you have to type to enter the validation code for QuickBooks.

Link: Where to enter Validation code

Quite a coincidence. I wonder what happens when you type these keys in the wrong place...

Hans Passant
+2  A: 

If you shift left 64-bit representation 8 bits left (multiply by 256) You will get a well formed credit card number and 3 empty positions for thise 3 secure extra numbers (all zeroes for some reason). There is only 1 out of 10 chance that random number gives a well formed CC number.

5926 1069 5889 5232 000

RocketSurgeon