NULL Big Deal
August 14, 2019 1:04 PM   Subscribe

Security researcher Joseph Tartaro (a.k.a. droogie) decided to play a prank on the California DMV by registering the vanity license plate "NULL" -- a programming term for items without a specific value. The prank, as Tartaro has explained in a recent DEF CON talk and to WIRED, has resulted in him erroneously receiving over $12,000 in traffic fines. (Previously.)
posted by Cash4Lead (115 comments total) 26 users marked this as a favorite
 
in b4 ne1 drops the story about bobby tables
posted by Reclusive Novelist Thomas Pynchon at 1:12 PM on August 14, 2019 [54 favorites]


LOL, well, that's what you get for trying to be super clevar with your license plate.
posted by grumpybear69 at 1:14 PM on August 14, 2019 [4 favorites]


HAhahahahahhahahahhaha, oh, errrr, OH.
posted by sfts2 at 1:14 PM on August 14, 2019


bobby tables story drops itself
posted by It's Raining Florence Henderson at 1:14 PM on August 14, 2019 [108 favorites]




Chris Null to this guy: "Oh, you think NULL is your ally! But you merely adopted the NULL; I was born in it, moulded by it!"
posted by demonic winged headgear at 1:20 PM on August 14, 2019 [9 favorites]


“WHERE ticket.plate = ‘NULL’” is not the same as “WHERE ticket.plate IS NULL”, so I’m not sure that this is a SQL bug. Is there some crappy ORML in PHP that interpolates this stupidly?
posted by jenkinsEar at 1:21 PM on August 14, 2019 [19 favorites]


As was pointed out elsewhere, this is the more applicable XKCD strip.
posted by NoxAeternum at 1:21 PM on August 14, 2019 [10 favorites]


I've heard of similar things happening to people with license plates that are all zeros and/or O's.
posted by SansPoint at 1:22 PM on August 14, 2019


"The California DMV decided to play a prank on security researcher Jospeh Tartaro by allowing him to register the vanity license plate 'NULL'."
posted by Wolfdog at 1:22 PM on August 14, 2019 [97 favorites]


this reminds me of the (essentially same) story from shortly after vanity plates became a thing many years ago. some genius chose "NONE" as their license plate. not sure if it was the intention but it turned out that any parking tickets written (very much pre-dating digital tickets and internet) appeared as if the car in violation had no plates. the NONE plate was banned shortly thereafter.
posted by rude.boy at 1:25 PM on August 14, 2019 [3 favorites]


“WHERE ticket.plate = ‘NULL’” is not the same as “WHERE ticket.plate IS NULL”, so I’m not sure that this is a SQL bug. Is there some crappy ORML in PHP that interpolates this stupidly?

There are lots of data table handling systems that will not-so-helpfully autointerpret the string NULL or NA into those values rather than leaving them alone.
posted by benzenedream at 1:27 PM on August 14, 2019 [13 favorites]


These horror stories abound. Spare a thought for Jennifer Null, whose last name effectively makes it impossible to do things like buy plane tickets or exist in office management systems at all, or that poor bastard who's been receiving random medications, prescriptions and shipments from hospitals and medical facilities on and off for years because he's ended up in medical database somewhere and his last name is "Test".

At least we're mostly past the point where anyone with an O'Anything name was inadvertently pressed into service as the world's SQL pen-testers thanks to that single-quote, but the list of Falsehoods Programmers Believe About Names will haunt us forever.
posted by mhoye at 1:31 PM on August 14, 2019 [22 favorites]


Like a prank-Icarus flying too close to the sun
posted by sallybrown at 1:35 PM on August 14, 2019 [11 favorites]


If your name happens to be Prawo Jazdy, do NOT register for a DL in Ireland.
posted by Meatbomb at 1:42 PM on August 14, 2019 [14 favorites]



“WHERE ticket.plate = ‘NULL’” is not the same as “WHERE ticket.plate IS NULL”, so I’m not sure that this is a SQL bug. Is there some crappy ORML in PHP that interpolates this stupidly?

There are lots of data table handling systems that will not-so-helpfully autointerpret the string NULL or NA into those values rather than leaving them alone.


In addition, selecting a null value into a string can result in the string literal "NULL" so the code that is doing the logic probably checks for both, because what kind of noodlebrain would have that as a vanity plate.
posted by grumpybear69 at 1:44 PM on August 14, 2019 [1 favorite]


There are over 10k people in our lab test environment (made from real people's names in the US) whose last name is Null.
posted by The_Vegetables at 1:45 PM on August 14, 2019 [10 favorites]


DMV: Ah-ha-ha, oh hacker, you're so funny! Seriously though, where's our $12,000?
posted by The Tensor at 1:47 PM on August 14, 2019 [2 favorites]


Pretty awesome that privately run ticketing rackets get access to DMV info.
posted by ODiV at 1:51 PM on August 14, 2019 [12 favorites]


> DMV: Ah-ha-ha, oh hacker, you're so funny! Seriously though, where's our $12,000?

Yeah, even though they* designed it that way, they didn't design it that way on purpose so they're totally off the hook and have no responsibility to fix anything.

Cf. discussion earlier today on Youtube's recommendation algorithm.

*Another issue is who the designers actually are. Obviously it's a bunch of different systems designed by a bunch of different people, organizations, agencies, and companies, that all more-or-less works together.

Given the inevitability of bugs in such a situation, it seems that there ought to be a better way of dealing with them than via sub-sub-sub-sourced collection agencies and low-level municipal courts.
posted by flug at 1:55 PM on August 14, 2019 [4 favorites]


In addition, selecting a null value into a string can result in the string literal "NULL" so the code that is doing the logic probably checks for both, because what kind of noodlebrain would have that as a vanity plate.

Wait, we're talking about the apocalyptic idiocy of allowing coercions like NULL -> "NULL" and the license plate owner is the noodlebrain? This is why I hate the argument that permissive semantics around coercions (JavaScript) or memory safety (C++) are just warts that you learn to avoid or work around. That's true for any individual programmer, but it's not true for programmers in the aggregate, and some of those are working on systems like this. With the point that we're at in terms of computer systems managing our PII, it should be literal criminal negligence to implement a new system that handles sensitive personal data in such a language. It wouldn't prevent occurrences of stuff like this, but it sure would reduce their number.
posted by invitapriore at 1:56 PM on August 14, 2019 [18 favorites]


This is like that scene in Miracle on 34th Street where the post office delivers all the Santa Claus letters to Kris Kringle at the New York courthouse, only this time all of the letters are bills, and instead of getting Kris released, he goes to debtor's prison. A story of our times, I think. I'd watch it.
posted by It's Raining Florence Henderson at 1:57 PM on August 14, 2019 [18 favorites]


As was pointed out elsewhere, this is the more applicable XKCD strip.
posted by NoxAeternum at 4:21 PM on August 14 [+] [!]


I was just telling my nephew he should get a licence place of all 0s and Os. Not the clever plan I thought it was.
posted by any portmanteau in a storm at 2:03 PM on August 14, 2019 [1 favorite]


Tony Hoare (via Wikipedia)
I call it my billion-dollar mistake. It was the invention of the null reference in 1965. At that time, I was designing the first comprehensive type system for references in an object oriented language (ALGOL W). My goal was to ensure that all use of references should be absolutely safe, with checking performed automatically by the compiler. But I couldn't resist the temptation to put in a null reference, simply because it was so easy to implement. This has led to innumerable errors, vulnerabilities, and system crashes, which have probably caused a billion dollars of pain and damage in the last forty years.
posted by swr at 2:08 PM on August 14, 2019 [12 favorites]


the license plate owner is the noodlebrain?

He said himself that one of hoped-for outcomes is that he'd be able to get out of tickets. When your own attempted abuse of a possible vulnerability backfires, a) yes, you're the noodlebrain and 2) [nelson]HA-ha[/nelson]
posted by hanov3r at 2:10 PM on August 14, 2019 [14 favorites]


A *good* programmer plans for ALL outcomes and exit conditions
posted by Greg_Ace at 2:21 PM on August 14, 2019 [1 favorite]


Wait, we're talking about the apocalyptic idiocy of allowing coercions like NULL -> "NULL" and the license plate owner is the noodlebrain?

It isn't so much allowing coercions as is it programming defensively to account for the quirky behavior of myriad integrated systems, some of which are likely decades old, the behavior of which is likely not in alignment with 2019 best practices.

With the point that we're at in terms of computer systems managing our PII, it should be literal criminal negligence to implement a new system that handles sensitive personal data in such a language.

I seriously doubt the California DMV system is new, license plates are not sensitive personal information, and good luck applying laws criminalizing code decisions in a just way.
posted by grumpybear69 at 2:21 PM on August 14, 2019 [1 favorite]


I didn't say it was new, license plates serving as a sufficiently strong identifier that they can be used to saddle you with nearly irremediable financial and legal consequences mean they that sure do constitute sensitive information, and there's precedent for real engineers being held liable for design decisions.
posted by invitapriore at 2:29 PM on August 14, 2019 [8 favorites]


This reminds me of some weirdness I encountered working with Wikipedia recent changes data, which ended up being caused by pandas "helpfully" recoding the title of the article about the concept of NaN. The only bug I've seen which documented itself.
posted by theodolite at 2:36 PM on August 14, 2019 [9 favorites]


computers were a mistake. also, all humans are noodlebrains.
posted by Reclusive Novelist Thomas Pynchon at 2:37 PM on August 14, 2019 [5 favorites]


Now he just needs a bumper sticker that says '; rm -fr /
posted by RobotVoodooPower at 2:46 PM on August 14, 2019 [6 favorites]


like basically if you're calling other humans noodlebrains you have no business operating a computer. also all humans are noodlebrains who call each other noodlebrains. as such, none of us have any business operating a computer.

quod erat demonstrandum, noodlebrains.
posted by Reclusive Novelist Thomas Pynchon at 2:46 PM on August 14, 2019 [9 favorites]


what kind of weirdo types rm -fr instead of rm -rf are you from space will you take me there with you
posted by Reclusive Novelist Thomas Pynchon at 2:48 PM on August 14, 2019 [66 favorites]


all humans are noodlebrains who call each other noodlebrains. as such, none of us have any business operating a computer.

GIGO, more like NINO, amirite?
posted by Greg_Ace at 2:52 PM on August 14, 2019 [4 favorites]


like basically if you're calling other humans noodlebrains you have no business operating a computer. also all humans are noodlebrains who call each other noodlebrains.

Can't fool me. It's noodlebrains all the way down.
posted by hanov3r at 2:55 PM on August 14, 2019 [4 favorites]


While I share the lack of sympathy for trying to get cute with the license plate, if the bit about how someone at the company was altering his ticket data to match his car make and model after he pointed out it couldn't be his because wrong car is true, then some people should be fired and possibly prosecuted.
posted by tavella at 3:57 PM on August 14, 2019 [7 favorites]


The only bug I've seen which documented itself.

Ooh! Self-documenting bugs: the next frontier in self-documenting code. You're on the cutting edge!

I've never encountered anyone with the last name Null, but I can say that Excel's handling of the surprisingly common surname True can be remarkably annoying.

Whether you think of code as human-to-human communication (doing things with words) or as human-to-machine communication (doing things with numbers), I wonder whether this is an actually soluble problem. At the risk of running afoul of whatever the Godwin's Law equivalent is for Gödel's Proof -- there's something awfully Russell/Whitehead about the idea of clean separation between executable code and nonexecutable strings. Is it ever really possible to systemically prevent words from leaking from one level of significance to another, or are these sorts of bugs preventable only on an ad-hoc basis?
posted by shenderson at 3:57 PM on August 14, 2019 [4 favorites]


> “WHERE ticket.plate = ‘NULL’” is not the same as “WHERE ticket.plate IS NULL”, so I’m not sure that this is a SQL bug. Is there some crappy ORML in PHP that interpolates this stupidly?

Years ago I worked on a project where a developer (who had left before I arrived) had written his own JSON/object parsers in Java because he liked passing NULL as a falsy value. He didn't like that the default parser stripped any field with a NULL value from the data object (which can make sense when you're using NULL to exclusively mean an empty value rather than a pseudo-Boolean) so he obviated it with a king rat of string matches and regexps which would occasionally confuse `NULL` and NULL so it was just as well we decided refactor the API to pass Boolean or binary values instead.
posted by at by at 4:07 PM on August 14, 2019 [3 favorites]


>programming defensively to account for the quirky behavior of myriad integrated systems, some of which are likely decades old, the behavior of which is likely not in alignment with 2019 best practices

Yeah, if you've ever seen how information tends to be transferred among such systems (in real life) it often boils down to something like an Excel file, CSV file, or similar plain text, with all table values converted to text format and printed out some way or another.

Then when you import that into the next system, it converts those text values for your integers, doubles, blobs, NULLs, or whatever, back into the format--again, somehow.

So, most of the time, that works OK. If you you have a few hundred thousand to tens of millions of entries, some of them are almost certainly honked up one way or another.

Oh yeah--and one of the most common tools for doing this kind of operation actually has this as an option. phpMyAdmin, export table page:
Replace NULL with: [ NULL ]
You can change this to something else, of course, but plain old "NULL" is the default value when exporting to CSV, Excel, MSWord, and other text formats.

If this is the procedure for export, the import system on the other end is almost certainly programmed to replace the text "NULL" with an actual null value in the DB.

Other combinations are possible, of course--each leading to differently entertaining bad consequences.
posted by flug at 4:10 PM on August 14, 2019 [5 favorites]


Can someone give an example of a language where it’s possible to confuse the null reference with the text string ‘NULL’? I haven’t run into this problem in my programming career? Or do we think it’s bad code that is deliberately doing this?
posted by freecellwizard at 4:12 PM on August 14, 2019


what kind of weirdo types rm -fr instead of rm -rf

Well, there might be a regular expression to filter "rm -rf /". You want to throw them off the scent.
posted by sjswitzer at 4:14 PM on August 14, 2019 [20 favorites]


> Can someone give an example of a language where it’s possible to confuse the null reference with the text string ‘NULL’?

See directly above your comment.

Also throw in that the systems we're talking about here--at least some of them--were likely designed and built in the 90s or 80s (or 70s or 60s--pick your decade).
posted by flug at 4:22 PM on August 14, 2019


NULL is handled badly in most databases. Oracle treats the empty string as NULL, which is inconvenient to say the least. SQLite has NULL issues too, though I forget what they are. I am not aware of a database that treats the string 'NULL' as NULL, but JavaScript does much worse things and frankly I would not be surprised. It could easily be a bug (or "feature") of an SQL driver in some language or platform. Or more likely, a developer was coding "defensively" (see Spy vs. Spy).

In old code bases there is an iron law that you fix a bug anywhere except where it's broken. If you fix the bug at the source you risk destabilizing who knows how much code. If you fix it symptomatically, you get to close the bug and sleep soundly. I mean, sure, this lays a trap for the next developer, but that's not your problem. I wish I were kidding.
posted by sjswitzer at 4:25 PM on August 14, 2019 [13 favorites]


A good friend of mine, who for the sake of argument we shall call Susan Bigshop, was on the early beta of a certain popular email system we shall call Foomail. She registered herself as MsBigshop@foomail.com and thought no more of it.

There is an actual extensive chain of retail outlets called Bigshop. It rolled out a new training course for its staff about its new online ordering system, which - yes! - the trainers were told to complete a registration and sample order under the name of MsBigshop@foomail.com.

I can't give more details of the fun that followed, but has taken my pal a very long time to clear the subsequent mess up.

Computers are fine. It's the people.
posted by Devonian at 4:27 PM on August 14, 2019 [6 favorites]


A *good* programmer plans for ALL outcomes and exit conditions

[sighs, adds meteorite-impact routine]
posted by clawsoon at 4:28 PM on August 14, 2019 [18 favorites]


Since data format conversion has been mentioned, Excel's automatic conversion of date- and floating-point-looking things to their presumed types has spread untold corruption into genome databases. Nobody really expects the debacle to be completely unwound and it would be surprising to me if it doesn't still happen regularly.
posted by sjswitzer at 4:30 PM on August 14, 2019 [19 favorites]


I've never encountered anyone with the last name Null, but I can say that Excel's handling of the surprisingly common surname True can be remarkably annoying.

The other day in Libreoffice I entered 1/16 (you know, 1/16th of an inch), which was converted to the date 2019-01-16. When I changed the cell formatting to text, it changed into the number 43481.
posted by clawsoon at 4:32 PM on August 14, 2019 [18 favorites]


[sighs, adds meteorite-impact routine]

Remember to have the subroutines check for both relativistic effects and relativistic affects!
posted by nickmark at 4:48 PM on August 14, 2019 [4 favorites]


... but the list of Falsehoods Programmers Believe About Names will haunt us forever.

My previous employer's password reset system required three security questions, one of which was your mother's maiden name. Corporate IT insisted that any answer must be at least five characters, breaking the system for hundreds of users. Their solution was to tell users to pad the entry with zeroes, leading to "Ngo0", "Doe0", "Aase0", "Hart0", etc. Ironically the result was slightly more secure than letting people use their mother's actual maiden name.
posted by nathan_teske at 4:52 PM on August 14, 2019 [14 favorites]


Excel's automatic conversion of date- and floating-point-looking things to their presumed types has spread untold corruption into genome databases

Actual, true, swear-to-God fact: there are hundreds, if not thousands, of people who had potentially fraudulently-entered default judgments against them who won a lawsuit to have those judgments dismissed, but the judgments cannot be dismissed because the #*$#)@(*) Excel spreadsheet in which the relevant information was maintained decided to autoconvert some numbers, and so nobody can identify them.
posted by praemunire at 4:58 PM on August 14, 2019 [16 favorites]


I hate these "security question" with the fire of a thousand suns. I mean, the last time I was confronted with one, I could not find a single question (I had to choose three) that would be a reliable memory trigger. It's also a terrible security backstop since it relies on biographical information that can usually be determined by a third party who wants to know bad enough.

And, the city where you went to high school usually gives up the middle two digits of your SSN. Since conventionally the last four are cleartext, you only have to check a thousand guesses. Good job everybody!
posted by sjswitzer at 5:03 PM on August 14, 2019 [9 favorites]


One nice thing a password manager can enable is turning security questions answers into gibberish that you look up in the password manager like any other password. "Yes, my mother's maiden name is: foot turn goose"
posted by foxfirefey at 5:06 PM on August 14, 2019 [14 favorites]


And, the city where you went to high school usually gives up the middle two digits of your SSN

If anything wouldn't it be more of a clue to the first 3? (SSN Numbering History)

That said, starting in 2011 SSNs are now randomized, so there is no connection to location/etc for anyone who got a SSN since then (of course using SSN as an identifier still has a ton of problems).
posted by thefoxgod at 5:16 PM on August 14, 2019 [3 favorites]


"Corporate IT insisted"

That doesn't always end badly... does it?
posted by swr at 5:17 PM on August 14, 2019 [2 favorites]


As was pointed out elsewhere, this is the more applicable XKCD strip.
posted by NoxAeternum at 4:21 PM on August 14 [5 favorites +] [!]


I've heard of similar things happening to people with license plates that are all zeros and/or O's.
posted by SansPoint at 4:22 PM on August 14 [+] [!]


I have observed previously on the blue that a pal of mine has evaded 90% of traffic tickets in his life because his first and last names contain both more capital letters than is typical and punctuation (think something like "D'Angelo MacKenzie").

I suggested that with a custom plate reading MNNMNMNM he could escape the last 10% as well.
posted by ricochet biscuit at 5:25 PM on August 14, 2019 [1 favorite]


SQLite has NULL issues too, though I forget what they are.

SQLite has a whole page about NULL handling. The standards docs were ambiguous, so they tested various databases and chose rules that matched the majority.
posted by RobotVoodooPower at 5:30 PM on August 14, 2019 [3 favorites]


Since data format conversion has been mentioned, Excel's automatic conversion of date- and floating-point-looking things to their presumed types has spread untold corruption into genome databases. Nobody really expects the debacle to be completely unwound and it would be surprising to me if it doesn't still happen regularly.
I am always surprised at the things people use Excel for that should just a flat file. Just yesterday, a developer gave me an Excel spreadsheet that contained definitions of a communications protocol between a couple of devices. I tried to convert it to a csv thing so I could convert it into code, but some fields had ONE double quote or single quote in them. Gaaaaa.

It’s like the people that use Microsoft Turd to write what should be a simple flat file, usually because they were able to steal some random version of Turd from work. Gaaaaa.
posted by Gilgamesh's Chauffeur at 5:31 PM on August 14, 2019 [2 favorites]


the 1970s called, they want their data risk back.
posted by Sand at 5:33 PM on August 14, 2019


I am always surprised at the things people use Excel for

I've received Excel files with an embedded screen shot image from customers.
posted by Greg_Ace at 5:38 PM on August 14, 2019 [19 favorites]


If anything wouldn't it be more of a clue to the first 3

Oh, my, that's worse then!
posted by sjswitzer at 5:39 PM on August 14, 2019


I've received Excel files with an embedded screen shot image from customers.

If the only tool you have is a spreadsheet, every problem looks like a cell.
posted by sjswitzer at 5:42 PM on August 14, 2019 [10 favorites]


king rat of string matches and regexps

great user name spotted
posted by trunk muffins at 5:48 PM on August 14, 2019 [17 favorites]


I can process you
I know I will
I'll pretend my code has patches
And I'll tell myself I can parse you
Because I'm the king rat of string matches
posted by benzenedream at 5:57 PM on August 14, 2019 [5 favorites]


> I wonder whether this is an actually soluble problem. At the risk of running afoul of whatever the Godwin's Law equivalent is for Gödel's Proof -- there's something awfully Russell/Whitehead about the idea of clean separation between executable code and nonexecutable strings

I actually put some thought into this a while back and you might run into this with something like self-mutating code (the essence of Gödel/Russel/Whitehead type paradoxes has to do with self-referential things, so you if you rule out self-reference you solve that particular issue pretty much instantly).

The issue you do have, though, is that you have to come up with notation and standards to differentiate between different levels of data--like the name "True" and the boolean concept "True" in your programming language, or similarly "NULL" and NULL--and then follow it through consistently, have consistent interoperability between systems, and all that.

Which, in real life, just isn't going to happen.

And, just just gets very confusing and hard to understand--leading to understandable errors.

Like \\\\\\"TRUE" is different from \\\\\\'TRUE' and \\\\\\`TRUE`and \\\\\\`"TRUE"` and also \\\\\"TRUE"

Not to mention something like these:
  • \\\\\\\\\\\"\'\`TRUE\`\'\"\\\\\\\\\\
  • \\\\\\"TRUE"
  • \\\\\\\\\\\\\"TRUE\"
  • "\\\\\\""TRUE"""
  • %5C%5C%5C%5C%5C%5C%26quot%3BTRUE%26quot%3B
Explanation for those not familiar with programming languages etc: Backslashes, quotations marks, single quotes, % characters, and tick marks are very commonly used to 'escape' different levels of text in various programming languages and systems. The last four are actual escaped versions of the text \\\\\\"TRUE" in four different, commonly used systems today.

The \\\\\\"TRUE" one I had to go into the HTML source code for this comment and escape the & character as & because I'm writing this in HTML, which interprets " as a double quote: "

So I went in and changed it to "TRUE" which then displays what I wanted.

Also the italicized portion of the last line, in order to make it display correctly, I had to write as:
"TRUE"
So, you can see where this is going.

Also I would point out that just in this little aside, I have resorted to two additional types of "escaping" to try to make the text a bit more comprehensible: Italics and blockquoting.

Even with that, it's still quite confusing.

And, you get into extra trouble when you are trying to embed examples of code that is supposed to run in a certain system, in the system itself. Or when you are (just for example), trying to save a snippet of PHP code that executes a bit of system shell code and is supposed to work on either Windows or Unix systems, and will be saved in a SQL database and read from that database by a PHP program which will format the result as HTML back to the SQL database, where it will be later read and printed as part of an HTML page.

So you tend to get into several levels of slashes and back slashes, and ticks and single and double quotes and all the rest that is quite mind-boggling.
So you can do it, and you can do it unambiguously, and computers can and do handle it fine all the time--especially if you're keeping everything nice and tidy within a single environment.

But nearly every system is a little different in the way it handles these things, standards have changed some over time, and such things quickly get very, very difficult for humans to parse easily.

So the potential for confusion and mischief is nearly infinite.
posted by flug at 6:07 PM on August 14, 2019 [14 favorites]


my new license plate will be 1e309
posted by benzenedream at 6:22 PM on August 14, 2019 [8 favorites]


If the only tool you have is a spreadsheet, every problem looks like a cell.

I used to support instructional AutoCAD. Many of the instructors were architects and more than a single one of them implemented their marks spreadsheet in AutoCAD. Like draw the grid; put a text block in each grid space; use that to record the marks for a class.
posted by Mitheral at 6:22 PM on August 14, 2019 [22 favorites]


there's something awfully Russell/Whitehead about the idea of clean separation between executable code and nonexecutable strings

Yes, quite. There's a rich history around this question, generally referred to as Quines. It was the topic of Ken Thompson's Turing Award lecture.

It's deeply related to Cantor's diagonalization, the universal Turing machine, and to Godel's Theorem. And, as you say, to Russell's paradox.
posted by sjswitzer at 6:26 PM on August 14, 2019 [5 favorites]


So the potential for confusion and mischief is nearly infinite.

<true>
posted by Greg_Ace at 6:26 PM on August 14, 2019 [2 favorites]


Can someone give an example of a language where it’s possible to confuse the null reference with the text string ‘NULL’?

Between languages!

SQL has `NULL`, a state indicating a row has no value for a certain column.

C has `NULL` which is a pointer to memory address 0, JavaScript has `null`, Python has `None`, Go has `nil`. Bash has an 'unset' state (less-used) and the empty string. An `int` in C can't be NULL while a SQL integer column can. These emptinesses are incommensurable.
posted by save alive nothing that breatheth at 6:34 PM on August 14, 2019 [8 favorites]


Metafilter: The emptinesses are incommensurable
posted by Greg_Ace at 6:44 PM on August 14, 2019 [10 favorites]


> These emptinesses are incommensurable.

The ancients thought zero was a dangerous and even self-contradictory idea. Something can't represent nothing, they said. Because off that natural wariness, it took somewhere between centuries and millennia for the number zero to really catch on.

You can see why--they were right!
posted by flug at 6:47 PM on August 14, 2019 [8 favorites]


C also has "(null)" which is what happens when you give a NULL cocaine
posted by RobotVoodooPower at 7:03 PM on August 14, 2019 [2 favorites]


I have a co-worker whose surname is Null. Cold Fusion is not their friend, and they have many name tags which read “Nulll”.
posted by wintermind at 7:08 PM on August 14, 2019 [1 favorite]


Is it ever really possible to systemically prevent words from leaking from one level of significance to another, or are these sorts of bugs preventable only on an ad-hoc basis?

At a higher level than assembly* and in a single language's environment it absolutely is, so long as you have a sufficiently strong type system that prevents unintentional interpretations of strings of characters as other kinds of values**, and that you don't ever evaluate string inputs as code. This doesn't mean that you can't implement ways of taking strings and outputting values of other types (say, a function that parses strings that represent integers), but it does mean, per the invariants enforced by the language in question, that no input to your program can ever be interpreted as code rather than mere data.

* In most CPU architectures, there's no a priori distinction between code and data, although even in architectures that do distinguish the two, as in the Harvard architecture, there's still the possibility of code injection.
** The notion of NULL nominally complicates this, since in most languages that have it it's capable of inhabiting either every compound type or every indirect reference to a value of a type (which is part of why it's a terrible idea), but there's still no reason in practice to permit a conversion from the string "null" to the value NULL.

posted by invitapriore at 7:26 PM on August 14, 2019 [2 favorites]


no reason in practice to permit a conversion from the string "null" to the value NULL.

Except in the case described above, where that’s what you absolutely need to do in order to take a CSV text file and import it into a given system in the proper way. Assuming you don’t want to do it by hand on a slate or something.

Yes there are more and less fancy ways to escape things and check for problems but at some level you need to be able to do that, in the wild.
posted by SaltySalticid at 7:49 PM on August 14, 2019


Right, of course legacy systems have these problems, and in practice they must be dealt with. My point is that there's no excuse to perpetuate the issue in new systems.
posted by invitapriore at 8:04 PM on August 14, 2019


The other day in Libreoffice I entered 1/16 (you know, 1/16th of an inch), which was converted to the date 2019-01-16. When I changed the cell formatting to text, it changed into the number 43481.

iirc, Excel represents dates and times as integers, internally, and then uses a decimal part for the time, as needed.
Today, it is 43,689 days since Jan 1, 1900; so, it looks like Libreoffice uses the same method. It had already converted to a date, so, when you asked for text formatting, that is what you got!
posted by thelonius at 8:08 PM on August 14, 2019 [2 favorites]


Alright, we all have very good and funny points about how dumb these systems are that say NULL = 'NULL'.

But I feel like we're missing the real bug here. Per the WIRED article, this is happening at all because officers write tickets and fail to record the license plate. And then some system attempts to collect on those tickets? How in god's name is that ever supposed to work? Minus this dude signing up to receive them all, previously this was all just falling into a black hole??? Like, PEBCAK or whatever, I get it, but for real how does data entry allow for a ticket with no license plate to be entered? I feel like there should be some feedback that prompts for info when an officer attempts to input a ticket with no way to identify the offender.
posted by jermsplan at 8:10 PM on August 14, 2019 [13 favorites]


but there's still no reason in practice to permit a conversion from the string "null" to the value NULL.

I will bet money that there are many databases where, in a field defined to not allow null values, people have adopted the practice of storing the string NULL to signify them. Those folks have made a reason to convert!
posted by thelonius at 8:11 PM on August 14, 2019 [3 favorites]


My new show, "Shark Tank"*, will feature entrepreneurs and public officials presenting their ideas on how how private enterprise can be used to provide public services. After carefully listening to their ideas, the panel of judges laughs uproariously, and then the contestants are thrown into an actual shark tank after being stabbed in the gonads.

* Trust me, it's better than the weak sauce which is the current "Shark Tank"
posted by maxwelton at 8:25 PM on August 14, 2019 [10 favorites]


I have used
the NULLs
and put them on
my automobile

and which
you were probably
saving
for missing values

Forgive me
they were tempting
so simple
and so funny
posted by Gorgik at 8:32 PM on August 14, 2019 [8 favorites]


I came here to say how yeah I can totally see how ‘NULL’ in a string could totally confuse different db’s and apps and languages in especially in the case of weird fragile ETL stuff but of course 17 people beat me to it

Mefi is cool
(For some values of cool)
posted by capnsue at 8:40 PM on August 14, 2019


Jermsplan dang you’re right
posted by capnsue at 8:41 PM on August 14, 2019


...for real how does data entry allow for a ticket with no license plate to be entered?

So drive without a plate and then never get ticketed?
posted by ODiV at 8:57 PM on August 14, 2019 [3 favorites]


> you might run into this with something like self-mutating code (the essence of Gödel/Russell/Whitehead type paradoxes has to do with self-referential things, so you if you rule out self-reference you solve that particular issue pretty much instantly).

Despite writing an approx. 25-page comment, I didn't really complete this thought.

The completion is:

Self-mutating programs and the like might have this self-reference issue.

But what we are talking about here is something quite a bit more simple: Basically whether you can unambiguously mark up or "escape" text in such a way as to denote the difference between "NULL" as a string and NULL as a particular SQL value, between "TRUE" as a string and TRUE as a boolean value, between " as the delimiter of literal text and " as a symbol in that text, and so on.

The answer is: It can be done, it can be done unambiguously, it can be done without encountering any paradoxes. But in real life it tends to lead to a bloody mess because there are so many different possible ways to do it.
posted by flug at 9:06 PM on August 14, 2019


implemented their marks spreadsheet in AutoCAD.

I'm going to retell this story tomorrow just to see the looks on my coworkers faces! Although they did miss the opportunity to code up their gradebooks in AutoLISP macros which would have impressed me in a more positive sense.

These emptinesses are incommensurable.

For example, while Go has nil and SQL has NULL, if you load data from an SQL database into a Go program and there's NULLs there, you might expect you'll get nils but you'd be wrong: you get things like sql.NullString. Because yeah it's totally possible to design up a perfectly wonderful typesafe system that will do the best most correct things when confronted by whatever. Then you need to connect it to the rest of the world's computing infrastructure somewhere at least, and then since we're quoting xkcd we end up with this problem.

My money, though, is on the problem being at the data entry level: the form people fill out to issue tickets has no checkbox for "plate not present" or "plate not visible" and they expect the person to communicate that in-band by typing in something in the field for license plates. Probably modeled after the same form used back in pen-and-carbon days when humans were in the loop the whole way and could be trusted to recognize "N/A", "Not Found", "NOPLATE", "Nil", "Nothing", or "⊥" (nerd joke!) or whatever the person's choice was for that. But nowadays the ticketing system faithfully records whatever they've typed as a string, and everything past that point is completely correct in handling its SQL queries and NULL-checking and everything without much sign of the lurking danger until some mail merges start resolving, and then...
posted by traveler_ at 9:08 PM on August 14, 2019 [3 favorites]


>But I feel like we're missing the real bug here. Per the WIRED article, this is happening at all because officers write tickets and fail to record the license plate.

First off, we're talking about $12,000 worth of fines for the entire state of California over a several year period.

So really, not a whole lot of tickets are being entered with no license plate number.

Second, it's very easy to imagine different scenarios that would cause this to happen occasionally:
  • Some cars don't have a license plate for various reasons, the officer still takes down make, model, color, etc of the parking offender with the slight hope of catching the owner via those characteristics, or at least documenting a many-fold repeat offender for possible further investigation
  • Officer gets distracted while writing the ticket and just accidentally omits the license number, but they have some system where officers are responsible for every numbered ticket in their book, so it gets entered into the system regardless
  • License plate number is hand-written on the ticket but somehow illegible or the like. Or if using some electronic entry system in the field, it is botched or skipped somehow.
  • Data entry error of some sort. Something like 5% of data fields entered have an error, so it's probably surprising there are ONLY $12,000 worth of this type of ticket, rather than 10X or 100X as much
  • Data corruption or data transfer errors
The real error here would be to assume that data entered via real-world systems (from hand-written or hand-typed ticket books out in the field, no less--from police departments from hundreds of different jurisdictions with at least dozens of different entry systems) is going to be 100% clean and pristine.
posted by flug at 9:16 PM on August 14, 2019 [5 favorites]


So drive without a plate and then never get ticketed?

Before this year, I would have said "Yes, welcome to California" where rich folks would drive on "temporary tags" for years, because the fine for getting caught without a plate is way less than the tolls and traffic cameras they avoid by not having a license plate.

But the legislature passed a dealers plate law last year so our long state nightmare is over.
posted by muddgirl at 9:51 PM on August 14, 2019 [9 favorites]


Yes, these are slightly complicated problems, but I think people overblow how hard this actually is to do. The reality is that everybody makes some mistakes, but also that a lot of developers phone in their jobs and don't even make the attempt. It's like how people point out how bad JavaScript is about coercion. It is, but there are perfectly reasonable ways to work around that that I've been using for years now. If you're a professional, maybe you don't know the whole Falsehoods list, but you know that names are somewhat complicated. You know that importing spreadsheets is complicated. If you haven't bothered to look at that system and try to find a string you can use that, for example, would not actually pass the license plate validation system, you're just being lazy. It's not that it's simple, but this was not somehow massively harder than everything I do on a daily basis. This wasn't really Falsehoods Programmers Believe About Names level, here, where it turns out you can't even assume people actually have names.
posted by Sequence at 10:40 PM on August 14, 2019 [3 favorites]


> Probably modeled after the same form used back in pen-and-carbon days when humans were in the loop the whole way and could be trusted to recognize "N/A", "Not Found", "NOPLATE", "Nil", "Nothing", or "⊥" (nerd joke!) or whatever the person's choice was for that.
… and possibly they're still using the same software as 40 years ago, because never fix things things that are not completely broken.
posted by farlukar at 2:21 AM on August 15, 2019


what kind of weirdo types rm -fr instead of rm -rf

Well, there might be a regular expression to filter "rm -rf /". You want to throw them off the scent.


Please, this is the DMV we're talking about. If that's your attack vector, you're going to want deltree /y c:
posted by Mayor West at 5:10 AM on August 15, 2019 [4 favorites]


Falsehoods Programmers Believe About Names

It's more like we (not YOU, I know) don't care about most of those cases, than that we've thought about it, but have incorrect beliefs.
posted by thelonius at 5:13 AM on August 15, 2019 [1 favorite]


Also I will never forgive Java for how it autoboxes null values.

String a = "";
String b = null;

return (a + b);

returns "null". The string n-u-l-l. There is literally zero reason that this would ever be the desired behavior. Comparison operators fail on null values; the only sensible thing to do would be to throw a null-pointer exception. You could maaaaaybe talk me into autoboxing it into an empty string, but what the hell, Java?
posted by Mayor West at 5:15 AM on August 15, 2019 [2 favorites]


I think that behavior makes a bit more sense if you remember that + isn't a thing that exists in Java, it is a syntactic fiction over a method call on its left hand side. String thinks null should be "null". I assume one would get the expected npe if you flip the arg order.

It's stupid and arbitrary, but the whole idea of OO is to devolve behavioral decisions down to special cases and arbitrary "intuition" in the context of the class owning the method.

Regarding the conversion errors talked about here, I think it's helpful to remember that in an institutional setting, the thing you provide input to and the thing acting on the input are usually two different programs implemented in two different languages. They probably can't even run on the same OS. In a mainstream language, none of the things your compiler does to ensure data is used consistently exist past the application boundary.
posted by idiopath at 5:44 AM on August 15, 2019 [1 favorite]


> Right, of course legacy systems have these problems, and in practice they must be dealt with. My point is that there's no excuse to perpetuate the issue in new systems.

New systems will inherit legacy system data, which often means having to hack in the same hacks that the old system hacked to cope with the same data hacks that the previous generations of hacks had hacked to hack around hacky structural and input hackwork.
posted by at by at 6:01 AM on August 15, 2019 [2 favorites]


String a = "";
String b = null;

return (a + b);

returns "null". The string n-u-l-l.


Wow, it even does that if String a has a value other than ""

String a = "breakfast of infamy";
String b = null;
return (a + b);

...and you get:
"breakfast of infamynull"
posted by thelonius at 6:23 AM on August 15, 2019 [1 favorite]


> New systems will inherit legacy system data, which often means having to hack in the same hacks that the old system hacked to cope with the same data hacks that the previous generations of hacks had hacked to hack around hacky structural and input hackwork.

if i have seen further it is only by standing on the shoulders of noodlebrains.
posted by Reclusive Novelist Thomas Pynchon at 6:25 AM on August 15, 2019 [7 favorites]


I'm going to start demanding royalties, Pynchon.
posted by grumpybear69 at 6:33 AM on August 15, 2019 [1 favorite]


> I'm going to start demanding royalties, Pynchon.
posted by grumpybear69 at 6:33 AM on August 15 [1 favorite −] Favorite added! [!]


if my current user page blurb weren't so good, that would be my new user page blurb.
posted by Reclusive Novelist Thomas Pynchon at 7:06 AM on August 15, 2019 [1 favorite]


Yes, my mother's maiden name is: foot turn goose

Of the Connecticut foot turn geese?
posted by cortex at 7:54 AM on August 15, 2019 [10 favorites]


No, the proudfoots turn gooses.
posted by Greg_Ace at 9:02 AM on August 15, 2019


Reminds me that I used to work with a guy who had the last name NAMEROW. I always thought someone in HR made a sorting error in Excel.
posted by slogger at 9:04 AM on August 15, 2019 [3 favorites]


Reminds me that I used to work with a guy who had the last name NAMEROW. I always thought someone in HR made a sorting error in Excel.

Makes me think of ye olden days when say Matt who was a baker became "Matt Baker", so 100 years into the future we will have Matt Middlemanager and Molly MsWord.
posted by The_Vegetables at 9:16 AM on August 15, 2019 [4 favorites]


I think this is present in bits and pieces above, but I'll bring it together concisely. We don't need to imagine a computer error at all. If the data entry system prohibits an empty field, the officer or clerk entering the data for a ticket with no license information could easily grumble and type in NULL. Certainly often enough to generate $12,000 worth of tickets.

How could the computer have prevented this given that, as demonstrated, NULL was a perfectly valid license plate ID?
posted by sjswitzer at 9:55 AM on August 15, 2019 [2 favorites]


I'm going to retell this story tomorrow just to see the looks on my coworkers faces! Although they did miss the opportunity to code up their gradebooks in AutoLISP macros which would have impressed me in a more positive sense.


Entirely possible that was done; likely actually considering summing each line for a final grade would be annoying. Some of these guys were good at AutoCAD and if only one of them did it they'd pass the template around. I didn't dive into the specifics, just sort of looked shocked and walked away.
posted by Mitheral at 10:24 AM on August 15, 2019 [1 favorite]


If the data entry system prohibits an empty field, the officer or clerk entering the data for a ticket with no license information could easily grumble and type in NULL. Certainly often enough to generate $12,000 worth of tickets.

It doesn't take much thinking to imagine that cars might not have license plates. There are stories of golf carts/lawn mowers/powerwheels/motorized coolers getting moving violation tickets, which do not require license plates. Plus to remove a plate requires 30 seconds and the ability to use a screwdriver. Finally a new car is not immediately given plates- above it was mentioned that the law was recently changed, but before that, in CA a guess of 10-15% of cars driving on paper plates would not be far off.

So you would certainly design the system where the officer/data entry clerk doesn't have to make up some string value to put in there if it is missing. That would require cumulatively thousands of hours of yearly training among every police substation to standardize the no plate/null value.

Lots of people have brought up legitimate reasons why this could have happened, but imagining these cases and programming around them is what programmers are paid (generally pretty well) to do.
posted by The_Vegetables at 10:39 AM on August 15, 2019 [2 favorites]


Bicycles are a classic case of an motor vehicle like object capable of getting tickets1 that doesn't have a licence plate number.

1A former roommate once received tickets for speeding and DUI while on a bike. Kind of impressive when you think about it. They impounded his bike and then the impound lost his bike. I suspect because they didn't have a plate number to track it with.
posted by Mitheral at 10:49 AM on August 15, 2019 [5 favorites]


Fair enough, but given that $12000 isn't a terribly big number for a state that size, an occasional data entry error (typing NULL instead of leaving it blank or whatever) seems a somewhat more likely cause to me than a programming error, which I would expect to generate more bad data than that.

Anyway, it's been a fascinating discussion of data conversion issues. Standardizing data interchange across a range of interconnected systems or modules designed at different times can be a huge and daunting undertaking. For instance, consider integrating systems that treat honorifics differently. I have been involved in at least three such large-scale efforts. But on the small scale, the problem comes up daily in virtually every significant API: what do you mean the HTTP invoke method doesn't accept "PATCH?"
posted by sjswitzer at 10:54 AM on August 15, 2019


I feel like there should be some feedback that prompts for info when an officer attempts to input a ticket with no way to identify the offender.

I have heard people claim one of the perks of buying a brand-new car, is that you're unticketable until the license plates arrive--you can park it anywhere! No meter fees!

I don't know if it's impossible to issue tickets to driverless cars without plates (is the VIN available? even if it is, it won't fit in the "license plate" spot in the form), but it's got to be a lot harder to follow up on than a standard ticket.
posted by ErisLordFreedom at 11:23 AM on August 15, 2019


First off, we're talking about $12,000 worth of fines for the entire state of California over a several year period.

So really, not a whole lot of tickets are being entered with no license plate number.
I suspect that the constitutional maximum fine for a California car without a license plate is some fraction of one cent (much like the "face value" of a grocery store coupon). So that $12,000 is actually way over a million tickets.
posted by Gilgamesh's Chauffeur at 1:33 PM on August 15, 2019


But the legislature passed a dealers plate law last year so our long state nightmare is over.

I just purchased a car out of state while on a road trip and my beloved Prius bricked hard. There were delays in getting the paperwork and, yes, some slovenliness on my part, but I finally got it properly registered and plated two weeks after the temporary transport permit expired. I didn't drive it often in those two weeks but when I did I assumed I was skating on thin ice. Perhaps thinner than I knew! (Also, no evaded tolls, just for the record.)
posted by sjswitzer at 2:28 PM on August 15, 2019


rich folks would drive on "temporary tags" for years

California didn't even require temporary paper plates for a 6 month grace period, AKA the Steve Jobs loophole.
posted by soy bean at 2:50 PM on August 15, 2019 [3 favorites]


Yeah we bought two cars in California last year. The" temporary" tags would go in your front windshield, it's like a tiny piece of paper, not readable unless you get pulled over. Now dealers have to send you home either with a permanent license plate or an actual paper plate that is camera-readable.
posted by muddgirl at 4:50 PM on August 15, 2019


I love how all these articles describe "paper dealer plates" like they are an actual thing, and not just advertisements for the dealer you bought the car from.
posted by muddgirl at 4:51 PM on August 15, 2019


Local composer/performer Pamela Z has a funny piece where she reads some junk mail she received aloud:

"Dear Lastname Invalid"...
posted by latkes at 6:51 PM on August 15, 2019 [3 favorites]


« Older Hear the whistle blow   |   A Sea Amidst a Sea of Sand Newer »


This thread has been archived and is closed to new comments