Beta
×

### Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

# Swedish Stock Exchange Hit By Programming Snafu

#### Soulskill posted about 2 years ago | from the take-a-check? dept.

136

New submitter whizzter writes "I was reading the Swedish national news today and an image in a stock exchange related article struck my eye. An order had been placed for 4 294 967 290 futures (0xfffffffa or -6 if treated as a 32-bit signed integer), each valued at approximately 16,000 USD, giving a neat total of almost 69 trillion USD. The order apparently started to affect valuations and was later annulled, however it is said to have caused residual effects in the system and trading was halted for several hours."

### Sven and Ole Found a Trading App (5, Funny)

#### eldavojohn (898314) | about 2 years ago | (#42121749)

Sven: Hey der Ole, check out dis new app I got on my phone here.
Ole: *takes the phone and looks at the screen* Oh hey idn't dat neat? A stock trading app!
Sven: Yeah I'm like a big shot power björker now! Börk! Börk! Börk!
Ole: Oh ja, you betcha, hey I gotta a hot tip, I'm gonna buy six futures of Ikea for ya.
Sven: Ole, you idiot! Stop that, I've only got a few cents on my account.
Ole: Oh! Jajaja, oops, you're in da red now. Oofta, I'll fix this here, lemme just sell 'em real quick.
Sven: No, stop, you'll just make things worse!
Ole: I don't see a 'sell' button on dis thing, oh, I know! *punches some buttons* Oh dear. Oh shoot. Ja, I'm in a little over my head here, Sven.
Sven: *grabs the phone* Negative 460 trillion dollars!? OLE, WHAT DID YOU DO?
Ole: Oh well, ya see, I just bought negative six shares, ja? To undo me buying six positive shares, ja? And I guess der was like ... some underflow involved der? With de app, ja? Ah gosh gee, Sven, I'm sorry, I'll pay ya back after I settle up with da liquor store first, of course.

### Re:Sven and Ole Found a Trading App (2, Funny)

#### sl4shd0rk (755837) | about 2 years ago | (#42122151)

'll pay ya back after I settle up with da liquor store first, of course.

Slashdot: We aren't racist/sexist. We shamelessly pick on everyone.

### Re:Sven and Ole Found a Trading App (5, Informative)

#### Anonymous Coward | about 2 years ago | (#42122835)

As a Swede I found the above posts very funny, though some things could be pointed out for the sake of clarity.

1) Björk is actually from Iceland. Can we elect The Swedish House Mafia as representatives of our culture instead please?
2) While I think Swedes on average consume a bit more hard liquor than the US, it's nothing like eastern Europe. We are mostly a beer people, and we are not afraid to import quality stuff. Though I guess in comparison to what goes for beer in the US, it's can almost be considered hard liquor ;-)
3) IKEA isn't a publicly traded company, and it's now owned by what is a series of (supposedly) non-profit trusts across the world with the single objective to keep it alive forever. Yes, Billy the bookcase will probably outlive you.

### Re:Sven and Ole Found a Trading App (0)

#### Anonymous Coward | about 2 years ago | (#42122975)

Signs you haven't been to the US: mentioning that "what goes for beer in the US" is low alcohol...

### Re:Sven and Ole Found a Trading App (1)

#### Anonymous Coward | about 2 years ago | (#42123021)

While we are happy to absolve you of the atrocity known as Bjork, us Americans of a certain age will always remember our first encounter with the Swedes:

http://muppet.wikia.com/wiki/The_Swedish_Chef

Börk! Börk! Börk!

Good times.

### Re:Sven and Ole Found a Trading App (2)

#### Grog6 (85859) | about 2 years ago | (#42124303)

One of the first Slashdot April Fool's Day jokes had stories written in different fake languages; the Swedish one was written as tho by the Muppets' Swedish Chef. :)

### Re:Sven and Ole Found a Trading App (1)

#### lgw (121541) | about 2 years ago | (#42124621)

From the very early days of usenet:

alt.swedish.chef.bork.bork.bork

alt.french.captain.borg.borg.borg

alt.ensign.crusher.die.die.die

CleverNickname took the last one a bit personally, but he was young then.

### Re:Sven and Ole Found a Trading App (0)

#### Anonymous Coward | about 2 years ago | (#42125195)

It's funny though. To me as a born and raised Swede, "the Swedish chef" never sounded Swedish at all, he sounded like an American mumbling gibberish.. The muppet show was a regular part of what was shown on Swedish television in the 70-80's as well.

### Re:Sven and Ole Found a Trading App (2)

#### Kozz (7764) | about 2 years ago | (#42123569)

As a USAian of midwestern extraction and mixed Scandinavian heritage, we enjoy our "Sven & Ole" (and sometimes Lena) jokes. I was most impressed by eldavojohn's shibboleth, "oofta" (though more usually spelled uff-da). eldavojohn, where are you from? Wisconsin, Minnesota, or Michigan's U.P.? :)

### Re:Sven and Ole Found a Trading App (0)

#### Anonymous Coward | about 2 years ago | (#42124955)

"uff-da" I suppose that is supposed to mean usch då..? :) /Svensk rättstavningsfröken

### Re:Sven and Ole Found a Trading App (0)

#### Anonymous Coward | about 2 years ago | (#42124467)

1: The Swedish House Mafia? You must be kidding me. http://de1.eu.apcdn.com/full/88837.jpg
2: The US has well over 2000 breweries, Sweden has 20-something. Mainly because of a absolutely dominating beer oligopoly with synergetic effects in dominating the pub distribution making sure that there are very few and expensive, or none other brand beers sold in bars. They call them "guest beers" and the owner loses bonuses if he/she has too many. Scary stuff, that has made sure swedish beer culture is low in european standards. Swedish standard draft is 5,2% and is like making love in a canoe, f* close to water.

/ Ludvig
Skåne, Sweden (+ a year of two of pacificNW microbrewery pub indulgement :)

### Re:Sven and Ole Found a Trading App (0)

#### Anonymous Coward | about 2 years ago | (#42124751)

Considering there are actually no "liquor stores" at all in Sweden.. Apart from the state monopoly "Systembolaget".

### Re:Sven and Ole Found a Trading App (0)

#### Anonymous Coward | about 2 years ago | (#42124635)

Lol. "Ole" is Norwegian. Ola, is a Swedish guy though. I know him..

### 64 bits (0)

#### Anonymous Coward | about 2 years ago | (#42121787)

Lucky they weren't using a 64 bit platform !

### Just be happy they weren't using 64-bit integers (2, Funny)

#### Anonymous Coward | about 2 years ago | (#42121789)

Imagine it 0xFFFFFFFFFFFFFFFA. That's a big enough number that it's unreasonable to type without scientific notation :)

### Re:Just be happy they weren't using 64-bit integer (2)

Not so unreasonable to copy and paste, though:
18,446,744,073,709,551,610

### Re:Just be happy they weren't using 64-bit integer (4, Funny)

#### NatasRevol (731260) | about 2 years ago | (#42122997)

That's a big enough subnet for everybody. /IPv6 humor

### Re:Just be happy they weren't using 64-bit integer (1)

#### SpazmodeusG (1334705) | about 2 years ago | (#42125039)

IPV6 is 128bits. So 340,282,366,920,938,463,463,374,607,431,768,211,456 addresses.

### Re:Just be happy they weren't using 64-bit integer (1)

#### SpazmodeusG (1334705) | about 2 years ago | (#42125061)

Oh you were talking about the subnet portion. Fair enough, that is a mere 64bit.

### Re:Just be happy they weren't using 64-bit integer (0)

#### Anonymous Coward | about 2 years ago | (#42122271)

More like 0xFUUUUUUUUUUUUU... amirite?

### Re:Just be happy they weren't using 64-bit integer (-1)

#### Anonymous Coward | about 2 years ago | (#42122323)

I just imagine it as what someone would say when they saw that happen. 0xFFFFFFFFFFFFFFFUUUUUUUUUUUUU...

### SNAFU..... (4, Insightful)

#### m.shenhav (948505) | about 2 years ago | (#42121813)

..... the word is being abused here.

### Re:SNAFU..... (3, Insightful)

#### Anonymous Coward | about 2 years ago | (#42122211)

What, you think the markets aren't normally AFU?

### Re:SNAFU..... (1, Redundant)

#### mcgrew (92797) | about 2 years ago | (#42122225)

It's not a word, it's an acronym for "situation normal, all fucked up." Seems appropriate to me.

### Re:SNAFU..... (2)

#### Aighearach (97333) | about 2 years ago | (#42123215)

Wrong. It is a word whose first reference was an acronym, though used from the start as a word.

m-w defines it: a situation marked by errors or confusion : muddle; also : an error causing such a situation <a scheduling snafu>

Remember kids, etymology is fun and educational but it should not be used as a guide for the definition of a word. Instead... use the definition as the definition. Etymology's value is historical and linguistic, not communicative.

### Re:SNAFU..... (1)

#### idontgno (624372) | about 2 years ago | (#42123613)

Agreed. I think the acro-word they're looking for is FUBAR. [wikipedia.org]

Although the authorities believe the CAN fix it. So "Beyond all repair" may not be literally true.

### Mismatched types in caller/callee: Re:SNAFU..... (3, Insightful)

#### girlinatrainingbra (2738457) | about 2 years ago | (#42123985)

SNAFU = Situation Normal: All Fucked Up.
That seems like the perfect description of what happened, either in terms of bad coding without type checking or input validation or in terms of the stock exchanges so frequently doing stupid things these days.
.
I think most likely it's a case of mismatched types between the calling function and how the function itself defines the calling variables. Errors that occured (possibly) (is there a link to the description/report that shows how this really happened?):
.
1 -- No Sanity Checking at Broker's end of transaction request: no validation of input at the customer or broker's computer, thus allowing a negative number entry for amount of shares to sell by the broker. aka Trusting the user to not input stupid values into a field.
2 -- Poor division of actionsactually not spliiting BUY and SELL into two different transaction categories and letting the sign of the number be the indicator as to the intent to buy or sell
3 -- Allowing wild extrema and outliers to affect trading: it's crazy to allow BID/buy orders at (average sale price)\dividedby(large positive integer) or to allow ASK/sell orders at (average sale price)\times(large positive integer). It's crazy for algorithms or humans to interpret any buy or sell price requests that are more than 50% deviated from the current running average price to be considered as anything other than either an anomaly or a deliberate attempt to fuck things up.
4 -- No sanity checking at the Stock Exchange board computer:no bounds checking on the board computer that accepts the buy/sell from the brokers. seriously, shouldn't there have been at least two places this poor interpretation could have been caught?
5 -- Unit Error / Representation Error: like letting a spacecraft go lost or kablooey by thinking the units are Imperial instead of Metric/Systeme_Internationale, maybe the order entry system represents the number X as signed long integer value, and the order-taker system (who knows what it's really called?) at the exchange interprets the number X as unsigned long integer value.
;>)
Now that number (5) error seems likely to me, as I have been learning C programmng and note that since it does not do type checking, it's possible to call a function with a variable that is holding a signed long integer, but the program is written with a
unsigned int functionname(unsigned long c1) {
\\... code goes here
}
\\... more intervening stuff
signed long int resultinganswer = 0;
so the same bit-representation is seen as two things. Akin to using the same words to mean two different things.

### Speed at the cost of accuracy (1, Insightful)

#### Anonymous Coward | about 2 years ago | (#42121817)

This is what happens when you want million transactions a second. You have to forgo input validation on your trading systems. Do these people ever learn?

### Re:Speed at the cost of accuracy (0)

#### Anonymous Coward | about 2 years ago | (#42121979)

It takes sub millisecond to validate input.... probably takes far longer to verify that all parties have enough money/stock to trade which might involve checking against a database.

### Re:Speed at the cost of accuracy (1)

#### Anonymous Coward | about 2 years ago | (#42122069)

Do you have any evidence that this bug was caused by input validation being skipped to enable high-frequency transactions? No? Didn't think so.

### Re:Speed at the cost of accuracy (0)

#### Anonymous Coward | about 2 years ago | (#42122907)

I never referred to high-frequency trading. The exchanges in general never validate input. They assume the brokers validate them and just execute them. And is there even a question of input not being validated? I would love to see how this passed validation.

### Re:Speed at the cost of accuracy (1)

#### The_Wilschon (782534) | about 2 years ago | (#42124075)

They used an unsigned int -- how could they possibly validate against a negative value? It's not their fault that the computer on the other end of the network was using a signed int. /sarc

### Re:Speed at the cost of accuracy (2)

#### skovnymfe (1671822) | about 2 years ago | (#42122089)

Why bother? If something gets fucked up, Mr. Street just rolls back all the bad, and gives us another chance. No problem.

### Different article on same website (1)

#### schneidafunk (795759) | about 2 years ago | (#42121823)

I have never seen that website before and decided to scroll down to see the other articles. There's a much more interesting article at the bottom titled:
"The body as a network"

### remember all those pesky compiler warnings (0)

#### Anonymous Coward | about 2 years ago | (#42121867)

warning: conversion from int to unsigned int, possible loss of data

Gotcha!

### Re:remember all those pesky compiler warnings (0)

#### Anonymous Coward | about 2 years ago | (#42122897)

Not loss, win! -6 is much less than a few billion.
(the warning would be quite nonsense though, I don't think you would ever lose any information/data by converting int to unsigned, it just might not be in the representation you expected - unsigned to int is a different, e.g. when using one's complement you could indeed lose information)

### Not so local (3, Informative)

#### j1976 (618621) | about 2 years ago | (#42121883)

The stockholm stock exchange is part of the NASDAQ-OMX group ( http://www.nasdaqomx.com/aboutus/whatisnasdaq/ [nasdaqomx.com] ) . Do they use the same software?

### 32 Bit (0)

#### Anonymous Coward | about 2 years ago | (#42121905)

Let's see into what problems they run if programs start using 64 bit...

### Good Point Here (1)

#### Murdoch5 (1563847) | about 2 years ago | (#42121907)

This is why you always use dynamic storage like a link list when you potentially have to deal with numbers bigger then the address bus width.

### Re:Good Point Here (5, Funny)

#### vlm (69642) | about 2 years ago | (#42122057)

This is why you always use dynamic storage like a link list when you potentially have to deal with numbers bigger then the address bus width.

Naah just use a FLOAT. After all, nothing bad could ever happen when doing financial calcs with FLOATs, right?

(note to sarcasm impaired... ahh on 1.9999999nd thought forget about it)

### Re:Good Point Here (1)

#### Murdoch5 (1563847) | about 2 years ago | (#42122167)

HAHA Oh of course! Also NEVER check the scope of the value stored or initialize to 0.

### Re:Good Point Here (0)

#### Anonymous Coward | about 2 years ago | (#42125013)

Rofl, the software that my company makes does quantity on hand calculations by float. Seems weird when I run into someone who apparently has 34.00000000000043 bottles of something on hand.

"Look for the little bit that spilled on the floor, that is what it is counting"

### Re:Good Point Here (4, Insightful)

#### gstoddart (321705) | about 2 years ago | (#42122111)

This is why you always use dynamic storage like a link list when you potentially have to deal with numbers bigger then the address bus width.

A linked list of digits? Seems a little much given that there's data types meant to handle really big numbers.

At a minimum someone should be bounds/sanity checking their inputs before it goes anywhere past the user interface -- you have to assume your users will type all sorts of random stuff into your fields.

Then again, I am often surprised when testing new software that when I do something completely random I often see issues.

I remember a developer saying to me once "but nobody is ever going to do that" -- the reality is, unless you actively prevent it, sooner or later they will; and in the case of many users, it's more like within the first 5 minutes. They don't know or care what you think is 'normal' inputs -- they're going to do what they do no matter what.

### Re:Good Point Here (1)

#### Murdoch5 (1563847) | about 2 years ago | (#42122531)

Oh I agree that you need to scope check everything and using big data types can help. If I was working something as big and complex as a stock system I would make my own big data storage, sure a link list is over kill but if you ever think is it big enough then you need to make it bigger.

### Re:Good Point Here (0)

#### Anonymous Coward | about 2 years ago | (#42122553)

This is why you always use dynamic storage like a link list when you potentially have to deal with numbers bigger then the address bus width.

A linked list of digits? Seems a little much given that there's data types meant to handle really big numbers.

It's also not very difficult to take a valid guess at maximum allocation size of a result, like b111 * b111 is b110001 or b111 + b111 is b1110. You can with reasonable efficiency just use a normal continuous buffer.

From my experience timed used to allocate memory blocks or copy bits is trivial compared to operations like division (which is pretty complicated).

Libraries like gmp optimized structures to improve performance, and I don't believe memory allocations are a primary issue.

### Re:Good Point Here (0)

#### Anonymous Coward | about 2 years ago | (#42124527)

Google's C++ style guide suggests using int for all small numbers, and never using unsigned ints for numbers that are expected to be non-negative. Instead asserts should be used to check that inputs are non-negative. Anyway, this would have caught this bug.

### Re:Good Point Here (0)

#### Anonymous Coward | about 2 years ago | (#42122519)

Dynamic storage allocation is not deterministic.

### oopsie... (4, Informative)

#### maz2331 (1104901) | about 2 years ago | (#42121919)

...someone forgot that putting an int into a function that expects a UINT32 is not a good idea....

### Re:oopsie... (2, Insightful)

#### Anonymous Coward | about 2 years ago | (#42124457)

If I was writing an exchange system, I'd use something like Ada, where there are well tested add-ons that let you prove the accuracy and integrity of the algorithms.

In C, I almost never use signed integers. It's rare that I ever need negative values. If I'm subtracting, in the vast, vast majority of situations I expect to end up with a positive number. If the result would prove negative, something is broken. Using unsigned integers with modulo arithmetic I at least get a value in the correct domain. I only ever have to check for sane upper bounds, not upper _and_ lower bounds. It's half as much work, and half as much to go wrong.

### Re:Curious how they did that ... (0)

#### Anonymous Coward | about 2 years ago | (#42122309)

Hopefully they start by draining your bank account.

### Re:Curious how they did that ... (0)

#### Anonymous Coward | about 2 years ago | (#42122037)

Perhaps someone wanted to sell 6 shares? ;)

### Re:Curious how they did that ... (1)

#### Anonymous Coward | about 2 years ago | (#42122087)

It's called a trading algorithm bug. It's not malicious intent since you'd never know how stocks change after a trade like this, so the obvious conclusion is that someone fucked up when coding their algo and as it traded it went into a stack overflow of some sort and we got this trade for -6 units, which became 4 294 967 290 units.

### Re:Curious how they did that ... (2)

#### timeOday (582209) | about 2 years ago | (#42122123)

It is always painful coding an arbitrary maximum "I don't believe" you value though. Evidently somebody declined to do so :)

### Re:Curious how they did that ... (2)

> It is always painful coding an arbitrary maximum
> "I don't believe you" value though.

Don't I know it.

Once when I was setting up a very small mail server once (think: about a dozen users), I looked at the "max number of recipients per message" variable, thought about how many distinct recipients it might potentially be reasonable to have for a single (non-mailing-list) message, and set the value to five. It was overkill, of course...

Those of you who have ever run a mail server know what happened next. Within a day of deploying the thing I'd raised the limit at least three times. At that point the new limit lasted for a few months, but then...

What, seriously? You really have a legitimate work-related need to send exactly the same message word-for-word to more than fifty addresses at once, for real?

Yeah. More than fifty individually hand-typed addresses, even.

### Re:Curious how they did that ... (4, Informative)

#### vlm (69642) | about 2 years ago | (#42122139)

Since I doubt you can buy -6 shares,

I'm willing to bet (if only I lived in a free country where I could go on Intrade to place the bet, but I digress) that someone has a UTF-8 input field with input sanitizing that only looks for one of the bazillion "minus/dash like" glyphs and a UTF-8 to int input routine that understands all or at least most of the "minus/dash like" glyphs. Happened to me once. Of course I didn't crash a world wide financial exchange, or you would have heard about it...

"Similar looking" yet different UTF-8 glyphs are one of the most exciting parts of the standard. "glyph to concept" mapping is not 1:1 any more like the old 7 bit ASCII days.

### Re:Curious how they did that ... (1)

#### scared masked man (2776663) | about 2 years ago | (#42122911)

That is why, whenever you are parsing user input, you should be doing all the conversions in the UI layer and, once they have entered the value, display what you think they've asked for, before doing anything potentially irreversible. Likewise, your validation should come after you've parsed the data, not before.

Of course, just because that's something which should have been pointed out in Intro to Computing right after atoi(3) is mentioned doesn't mean that people actually remember to do it, but you would think that people would get that sort of thing right in important software.

### Re:Curious how they did that ... (0)

#### Anonymous Coward | about 2 years ago | (#42124487)

Indeed. One should always validate values, not representations. It's typical of novice and intermediate programmers in almost all languages to not fully understand the difference between representation and logical value. It's why new C programmers type-pun the hell out of pointers, often with unintended or dire consequences.

### Re:Curious how they did that ... (0)

#### Anonymous Coward | about 2 years ago | (#42122973)

If you do a blacklist on characters in a number input field instead of a whitelist you're way out in "that's not how it's done" land...

### Re:Curious how they did that ... (0)

#### Anonymous Coward | about 2 years ago | (#42122173)

Some 10 keys have the minus sign and plus sign precariously close to the six (split the middle horizontally). Entirely possible that the bug existed and someone accidentally entered a minus sign at time they struck the six key.

### Re:Curious how they did that ... (4, Funny)

#### TheCarp (96830) | about 2 years ago | (#42122781)

"I can put in trades for any amount with this terminal"
"Any amount? What happens if you put in a negative trade?"
"It should kick out an error like this watch... I will place negative 6."
"Hey it took it! Lol I bet you just bought 6 shares!"
"Lets see it looks like it just....oh shit".

### Re:Curious how they did that ... (1)

Account balance = $100 -6 *$16,000 $100 Transaction approved ### Re:Curious how they did that ... (1) #### alexander_686 (957440) | about 2 years ago | (#42124025) Since I doubt you can buy -6 shares, . It's a future - so yes - For derivatives, for every long trade there has to be a short side. Technically it’s “Selling to Open” but I have seen systems treat it as a buying a negative quantity. ### Re:Curious how they did that ... (1) #### tolkienfan (892463) | about 2 years ago | (#42124559) Buying and selling are treated as separate cases on the 20 or so exchanges I have experience with. The one area where negatives ARE used is in multi-legged instruments such as calendar spreads, but that's in the price not the quantity. ### Re:Curious how they did that ... (0) #### Anonymous Coward | about 2 years ago | (#42124249) > Since I doubt you can buy -6 shares ... We're talking about equity index futures, you most certainly can. ### Re:Curious how they did that ... (1) #### tolkienfan (892463) | about 2 years ago | (#42124523) I'd suspect it was triggered by a bug at a trading company with a seat on the exchange. Some exchange protocols are in binary. The exchange may have validated only one side, assuming qtys would always be positive. ### Stop annulling these trades. (5, Insightful) #### Anonymous Coward | about 2 years ago | (#42122031) The way to prevent this kind of mistaken (or even malicious) trade is to stop protecting the trader by canceling the trade as soon as the mistake is realized. If you issue a trade order, you should be liable for paying for it. If you can't, normal bankruptcy laws should apply. ### what's a "trade order" ? (0) #### Anonymous Coward | about 2 years ago | (#42123465) A trade requires both a buyer and a seller. I'm sure if you post an offer (either to buy or to sell) for$69 trillion, there's nobody around who can take you up that offer.

You might be liable for some sort of misuse of the service, or breaking its rules etc. but obviously you won't owe anybody \$69 trillion.

### Re:what's a "trade order" ? (1)

#### Anonymous Coward | about 2 years ago | (#42123971)

No, that's not how exchanges work. If you put in a buy order for 0xFFFFFFFA shares, and I put in a sell order for a million shares, your order is partially fulfilled. (Assuming the prices match). It would be far too impractical to match all offers by both price and volume.

The exception is a take-over bid in which the potential buyer may make a conditional offer for a majority, and decline to buy less.

### Re:Stop annulling these trades. (2)

#### tolkienfan (892463) | about 2 years ago | (#42124639)

Not if the order or quote makes no sense or somehow isn't valid.
In this case it actually caused ongoing problems with the exchange. Probably caused an overflow in the book handling logic in the matching engine.
Erroneous trades that result from bad behaviour in the exchange software should be rolled back, as they are not the fault of the trading parties.
If we were simply talking about the order being overfilled, then I'd agree with you.

### Re:Stop annulling these trades. (2)

#### Idarubicin (579475) | about 2 years ago | (#42125691)

The way to prevent this kind of mistaken (or even malicious) trade is to stop protecting the trader by canceling the trade as soon as the mistake is realized. If you issue a trade order, you should be liable for paying for it. If you can't, normal bankruptcy laws should apply.

First of all, it's not clear exactly what the trade order even meant. At worst, an offer to buy -6 futures should have been interpreted as an offer to sell 6 futures at the stated price--not as an (underflow-generated) bid for 4 billion futures. Who, exactly, do you hold liable for failing to sanity-check their inputs--the trader, his company, the exchange, their various software subcontractors who themselves may have been bought, sold, and restructured long since...?

Second, insisting that the trade happened and then forcing the trader into bankruptcy (and associated bankruptcy protection) is likely to punish the 'innocent' participants in the market more than anyone else.

### Re:Stop annulling these trades. (0)

#### Anonymous Coward | about 2 years ago | (#42125897)

I agree, as long as the software developers are free of all liability.

Stop validating inputs, and turn off compiler warnings asbout signed/unsigned, and whatever you do, do not use a high-level programming language with bignum integers. Stop short when you have a slightly improved C with garbage collection.

Nail that damn end-user's ass to the wall for putting in a -6 where a positive value is required!

### New math (3, Funny)

#### girlintraining (1395911) | about 2 years ago | (#42122119)

Well, at least now we know how RIAA calculates its damages; They must have hired the same developer...

### Re:New math (1)

#### swampfriend (2629073) | about 2 years ago | (#42122845)

Is this another way of saying, "They should be paying us to listen to this crap!"

### Must be a hoax (2)

#### mcmonkey (96054) | about 2 years ago | (#42122199)

According to most of the folks posting in another thread about computer-driven cars, programming errors rarely make it out in to the world.

Is there was an issue, it must be user error. Programmers aren't supposed to make mistakes!

<snark/>

### Re:Must be a hoax (2)

#### LateArthurDent (1403947) | about 2 years ago | (#42122787)

According to most of the folks posting in another thread about computer-driven cars, programming errors rarely make it out in to the world.

Is there was an issue, it must be user error. Programmers aren't supposed to make mistakes!

<snark/>

Nobody ever said that. What we do say is that known programming errors get fixed, known human issues do not.

While coming back from lunch today I saw somebody go through a stop sign at 40 mph and t-boning another car. Luckily everyone walked away (go modern cars and their crumple zones), and while I'm sure that particular driver will be more careful in the future, other human drivers are going to be making the same mistake forever.

A programming error causes something like this and the fix for it will be on an update for every single other car out there. It will never happen again. Other mistakes will happen, sure, but that one is fixed forever.

### Re:Must be a hoax (1)

#### mcmonkey (96054) | about 2 years ago | (#42123683)

Nobody ever said that. What we do say is that known programming errors get fixed, known human issues do not.

While coming back from lunch today I saw somebody go through a stop sign at 40 mph and t-boning another car. Luckily everyone walked away (go modern cars and their crumple zones), and while I'm sure that particular driver will be more careful in the future, other human drivers are going to be making the same mistake forever.

A programming error causes something like this and the fix for it will be on an update for every single other car out there. It will never happen again. Other mistakes will happen, sure, but that one is fixed forever.

*facepalm*

1) Not every known programming error gets fixed prior to release.

2) Even if 1 were not true, it's the unknown errors that will get you.

Stock exchanges have been electronic for quite some. And they process quite a large number of transactions. I did some back of envelope googling. The average trading volume of the NYSE is 700 million. Figure they're open 200 days per year, electronic trading been around maybe 20 years, maybe NYSE is 25% of the world trading (yes, I know the volume of trading the amount electronic trading has been increasing over that time, but I'm not counting other forms of electronic trading (e.g. bonds, commodities)), puts us north of 11 quadrillion trading transactions.

And yet there are still bugs in that system.

### Re:Must be a hoax (1)

#### tolkienfan (892463) | about 2 years ago | (#42125409)

Er, that's more that 1 trading system. Plus this wasn't a bug in a US equities exchange.
Also, GP was saying a bug in a piece of software only needs to get fixed once, he never said that was before release.

### 64-bit (1)

#### Citizen of Earth (569446) | about 2 years ago | (#42122219)

Thank goodness they weren't using 64-bit unsigned integers!

### Whoa, you can annul transactions? (0)

#### Anonymous Coward | about 2 years ago | (#42122241)

I saw The Dark Knight Rises and I thought that even when armed men with guns break into a stock exchange and do mysterious things with a computer, that it is not possible to annul an obviously stupid transaction done right at that time that takes a millionaire and leaves him penniless.

Oh well, I guess I'll just have to settle for realistic movies, like Skyfall where they take an unknown computer running unknown software and plug it right in to their secure network, inside their firewall. Some bad stuff does happen but who could have foreseen it?

#### PPH (736903) | about 2 years ago | (#42122273)

... an order to sell short 6 futures that the user inadvertently entered into the 'buy' field?

### Monster Orders upholstered Exchange (1)

#### Minwee (522556) | about 2 years ago | (#42122367)

I love automated translation.

### Re:Monster Orders upholstered Exchange (1)

#### sootman (158191) | about 2 years ago | (#42122647)

I just figured "upholstered" was slang over there, like "plastered" in the US. Love it. A great day for words over here -- first escape goat [slashdot.org] , now this. :-)

### I did something like that once... (0)

#### Kaenneth (82978) | about 2 years ago | (#42122625)

Dial up BBS with time limits; but you could gamble an amount of time for a 1 in 3 chance of getting double the time...

So I gambled -50,000 minutes.

And lost.

Which gave me 100,000 minutes.

Which overflowed the 16 bit counter.

Which crashed the BBS.

Which dumped me into a remote shell.

### Re:I did something like that once... (0)

#### Anonymous Coward | about 2 years ago | (#42123585)

"I did something like that once... "

When you were dreaming you were a cool haxx0r. I call B.S...

### -6? Not always... (1)

#### Ichijo (607641) | about 2 years ago | (#42122649)

(0xfffffffa or -6 if treated as a 32-bit signed integer)

In two's complement, sure. But this is Slashdot, pedantry is allowed, even encouraged.

### Are you guys ( and girl ) sure this was a mistake? (4, Interesting)

#### vikingpower (768921) | about 2 years ago | (#42122745)

It did, after all, influence trading. What if this stunt was disguised as an - admittedly stupid - mistake, but in fact wasn't one ?

### Just wrote a 2500 pg paper on flash trading (1, Interesting)

#### GodfatherofSoul (174979) | about 2 years ago | (#42122839)

For an ethics class. The only real solution is to ban it outright. These algorithms can never be fully tested because they interact with algorithms from other institutions which can lead to death spirals as algorithms cause feedback loops; bouncing trades off of one another until someone pulls the plug. And at automated speeds, that can be long after your company goes bankrupt.

From the sounds of the translated page, this was just a one-shot jacked up algorithm working in isolation which is still a problem in itself.

### Re:Just wrote a 2500 pg paper on flash trading (4, Funny)

#### girlinatrainingbra (2738457) | about 2 years ago | (#42124087)

Re:Just wrote a 2500 pg [page?] paper on flash trading
.
Dude, you must be tired. 2500 pages? Or did you really mean 2500 words? Or was this a deliberate attempt to add to the humor by using the wrong units with the number? Or an amusing way to show how easily errors can slip by humans? Or just a result of tired-ness after typing and proof-reading that 2500 page essay?
;>)

### Re:Just wrote a 2500 pg paper on flash trading (1)

#### GodfatherofSoul (174979) | about 2 years ago | (#42124291)

lol didn't even see that. 2500 WORD!!!!!

### Re:Just wrote a 2500 pg paper on flash trading (1)

#### PhamNguyen (2695929) | about 2 years ago | (#42124353)

How is this an ethical matter? Or more precisely, how are people studying ethics qualified to speak about what is really a matter of finance or economics?

It's not like in (academic) finance and economics they ignore the overall net benefit of trading rules to society. In fact, this is usually all that is considered.

### Re:Just wrote a 2500 pg paper on flash trading (1)

#### GodfatherofSoul (174979) | about 2 years ago | (#42124445)

You're assuming that the professor has a doctorate in ethics. Ethical issues of flash trading off the top of my head:

* Flash trading violates the "spirit" of stock markets by allowing flash traders to exploit price swings not related to market fundamentals. The purpose of stock markets is to place capital in the hands of industry, not game the system.
* Flash trading favors extremely well funded organizations that have the resources to create these algorithms as well has throw enough cash or credit at trades designed to profit from minute stock price changes.
* Flash trading can be used nefariously to bring companies down.
* Flash trading can be used nefariously to prop up overvalued stocks; e.g. the Facebook IPO where the price was held artificially high to allow profit takers to unload their allotments.

### Re:Just wrote a 2500 pg paper on flash trading (1)

#### PhamNguyen (2695929) | about 2 years ago | (#42124683)

The professor's degree isn't really what is important, what is important is whether the issues belong to ethics or economics. E.g. would you say that the decision between using drug A and drug B to treat an illness was an ethical issue, because using the wrong one would cause less people to become better?

Furthermore, you are making some wrong assumptions. E.g. you say that "The purpose of stock markets is to place capital in the hands of industry, not game the system." but if incorrect prices exist, then the wrong decisions will be made, and so people deserve a reward by trading on market fluctuations, if such trading tends to drive prices towards their correct values (and economics theory states that it does). That is, what you consider gaming the system is actually placing capital in the hands of the right people.

### Looking good, Billy Ray! (1)

#### whovian (107062) | about 2 years ago | (#42122945)

Ripple effects are pretty scary. Good thing trading can be halted to let problems subside.

### Obama placed an order (-1)

#### Anonymous Coward | about 2 years ago | (#42122993)

It's not a SNAFU. US President Obama just placed an order.

... raped it?

### Immutable arbitrary-precision integers (1)

#### ls671 (1122017) | about 2 years ago | (#42125049)

Nowadays, with the speed of CPUs, any financial application should use immutable arbitrary-precision integers (or floats). I worked for many banks and it was funny how either they found out by themselves before I got there or when I I had to tell them about it. Either way, they had to modify existing applications.

There is no limit to the number one can express that way, put apart memory constraints. Just restraint input to some number equals to the estimated number of atoms in the universe and you should be fine memory wise ;-)

In java :

Now, I hope anybody coding financial or accounting apps will get the picture...

That's all for now.

# Slashdot: News for Nerds

Matter cannot be created or destroyed, nor can it be returned without a receipt.