top | item 31277998

Including “And. And. And. And. And.” in a Google doc causes it to crash

1473 points| patneedham | 3 years ago |support.google.com

411 comments

order

Some comments were deferred for faster rendering.

kklisura|3 years ago

``` TypeError: Cannot read properties of null (reading 'C') at Ccf (https://docs.google.com/static/document/client/js/157553674-...) at Bcf (https://docs.google.com/static/document/client/js/157553674-...) ```

Has something to do with grammar. The document does not fail when `Show grammar suggestion` is turned off.

croddin|3 years ago

Also, Therefore, And, Anyway, But, Who, Why, Besides, However.

Each in caps 5 times with the same word with a period and space after each word and newline at the end is what I have found so far.

Can anyone find others?

Edit: added words that work found in other comments, and found more.

deltarholamda|3 years ago

I see Google has finally implemented the Zombie Strunk & White AI like I requested years ago.

I did not expect them to weaponize it, but Skynet does as Skynet does.

Alex3917|3 years ago

Probably just getting triggering excessive backtracking on some regex.

lqet|3 years ago

Yup, it is also partially underlined in blue and a popup suggests to replace "And. And." with "And And" just before it crashes.

greggsy|3 years ago

Presumably people will start running having all sorts of fun fuzzing Google Docs now that they know that it’s not an infallible, opaque product…

Any web app pentesters here willing throw in their 2c? Could this offer insights into the way data is parsed in the backend, or might result in something more interesting than a crash?

jonnycomputer|3 years ago

Ah. So not something with the text data model.

a-dub|3 years ago

does it talk to a grammar check api endpoint or is it done locally?

would be funny if it were a remotely exploitable bug in an api endpoint.

tus666|3 years ago

Makes sense. I was thinking something to do with document compression but that sounds more likely.

the_snooze|3 years ago

Parsing arbitrary user-provided input? What could possibly go wrong?

unknown|3 years ago

[deleted]

AccountAccount1|3 years ago

I find it very poetic that this crash was triggered by a poem, here's the poem:

> Duration and the body: I thought about something I had read a while ago which said that a body, the body, is defined by duration. That a body in the present is inseparable from its previous state, that a body is linked in a continuous strand… and so on and so on… I thought about my body. It’s past. It’s present… Which made me think about the word and. And. And. And. And. And. Then.

> Now. Now. Now. Now. Now, I felt in the present like I was living always alongside a previous body. This is why I had expected to find myself in the apartment when I returned home from California.

https://durationandthebodyelizacallahan.cargo.site/

quakeguy|3 years ago

Your username screams for an equal exploit tbh.

AlexMuir|3 years ago

Took me right back one of many detentions I served at school, when Mr B Swales set us the challenge of finding a grammatically correct English sentence with five ands in a row.

The answer was as follows:

The landlord of the "Dog and Partridge" pub commissioned a signwriter to letter a new board outside. On looking at the work, the landlord declared that he liked the colour but would prefer more spacing between Dog and and, and and and Partridge.

justinpombrio|3 years ago

Here's 21 in a row, by Martin Gardner:

Wouldn’t the sentence ‘I want to put a hyphen between the words Fish and And and And and Chips in my Fish-And-Chips sign’ have been clearer if quotation marks had been placed before Fish, and between Fish and and, and and and And, and And and and, and and and And, and And and and, and and and Chips, as well as after Chips?

chatmasta|3 years ago

It seems like cheating to omit the double quotes around the literal instances of “and” while still including them around “Dog and Partridge.”

Moru|3 years ago

Swedish sort of joke-sentence you get to learn in school:

"Far, får får får?"

"Nej, får får inte får, får får lamm."

English would be:

"Father, does sheep get sheep?"

"No, sheep does not get sheep, sheep gets lambs."

No, google translate does not make it unscathed through that sentence :-)

IIAOPSW|3 years ago

'''Between (("Dog" and "and") and ("and" and "partridge"))''' for those of you trying to parse along at home.

paconbork|3 years ago

It's easy enough to use a single "and" in a sentence, but "and and" and "and and and" and so on are more difficult

Affric|3 years ago

Curiously, if someone wanted to put that on a sign suddenly you can take the story to as many "and"s as one might want...

So, the the trick is using it as a conjunction and a noun.

atxbcp|3 years ago

A russian equivalent based on the fact that foreign words aren't declined: Человек человеку волк, а зомби зомби зомби

coreyp_1|3 years ago

I heard it with "Fish and Chips".

elliekelly|3 years ago

I would love to know what other tasks Mr B Swales had in his detention assignment rotation!

nicooo|3 years ago

My homework was to write a sentence with 5 ands in a row, so I wrote "and and and and and."

onionisafruit|3 years ago

Why did that lead to detention?

patneedham|3 years ago

Discovered by Eliza Callahan triggered by a poem in the middle of her novel. (Friend of a coworker) That poem can be found here: https://durationandthebodyelizacallahan.cargo.site/ - if viewing on mobile you have to Request Desktop Site for some reason, at least on Android it initially shows up as a Lorem Ipsum page

roughly|3 years ago

As arguments for the thesis that the tech world needs to embrace the humanities go, an author discovering a bug in a google product by writing a poem is pretty good, if maybe a bit too on the nose.

_rf|3 years ago

I know you didn't write that poem, but I'm 99% certain the apostrophes in "I thought about my body. It's past. It's present." have no business being there :)

pvillano|3 years ago

it appears to be bugs all the way down

raldi|3 years ago

On iPhone Chrome it doesn’t show up either way.

oblosys|3 years ago

Here's a bug I discovered in MS Word in 2004, which has survived the past 18 years of updates and is even present in the web version: https://1drv.ms/w/s!AgYiBqBjIZZpfkcvO9jnOel9T2o?e=tFA4wp If you join the two lines using a backspace at the start of the second line, the second line turns into gibberish.

Jap2-0|3 years ago

Rewritten for clarity (and because I now actually know what's happening):

If you look at the XML (change .docx to .zip) in styles.xml you see the declaration of the style "BodyText3":

  <w:style w:type="paragraph" w:styleId="BodyText3"><w:name w:val="Body Text 3"/><w:basedOn w:val="Normal"/><w:semiHidden/><w:rPr><w:rFonts w:ascii="Wingdings" w:hAnsi="Wingdings"/><w:i/><w:iCs/><w:strike/><w:color w:val="FF0000"/><w:sz w:val="52"/></w:rPr></w:style>
The first line ("paragraph") has its style set to "BodyText3", but also has formatting on that section of text itself, overriding it. Once the lines are joined into one paragraph, the paragraph formatting appears in the second part because that text does not have a style to override it.

kingcharles|3 years ago

How did you create the document? When I hit backspace it does "turn into gibberish", but because it seems to inherit the type choices from the ether between the two lines to put it into Wingdings in red with italic and strikethrough. Did you create that type setting?

blueberrychpstx|3 years ago

When I come across posts like these, I just wonder, "How in the world did the user discover this in the first place?!"

Let's place bets:

A) The user just let autocomplete "take it away" (not sure about this one since they were able to access the console)

B) Pen Testing?

C) Error copy and pasting?

D) Actual dialog in a sci-fi post-apocalyptic love story where a robot discovers the Turing test and attempts to set itself into an infinite loop.

dkarl|3 years ago

I've heard people say it, speaking like this: "This would be a great solution to the problem, except that it would break the admin dashboard. And billing. And SSO. And partner test environments. And. And. And. And. And. This would break so many things I'm sure I could only name half of them if I tried."

technothrasher|3 years ago

Years ago in school, maybe about 1992 or so, I managed to make xdm (X Display Manager) crash and dump me a root window by simply holding down a key until the buffer ran out. I remember wondering how anybody didn't discover this before me. Similar behavior with the university phone system (repeatedly pressing '0') eventually dropped me an outside line that I didn't have to pay for (yes, for you young folks, we used to have to pay for long distance phone calls, on phones that didn't fit in our pockets).

avgcorrection|3 years ago

This is just a transcript of a stutter. Too much for modern technology to handle. :)

orblivion|3 years ago

C seems very likely to me. I often compulsively copy and paste things. You might not call it an error as such.

a-dub|3 years ago

E) fidgeting/futzing with stuff mindlessly while in conversation/doing something else

personally, i've happened across some pretty serious security bugs this way.

t_mann|3 years ago

Some more options: Just a demonstration of how Ctrl-C, Ctrl-V works. Literal transcript of a stammered conversation. Poetry / word-based art.

fnord123|3 years ago

E) Children playing on the tablet/computer.

glitchc|3 years ago

Option D is rather romantic. Poor robot fell in love with an NFA. He’ll never hear the end of it.

OhSoHumble|3 years ago

Writing a novel and a character within the novel has a stutter or is stammering.

quickthrower2|3 years ago

The same way a lottery winner discovers the correct numbers

Patrol8394|3 years ago

Once a customer was able to destroy an old ES cluster because they copy pasted some text from a PDF into a search box ... that text got sent directly to the ES cluster without much escaping ... there were lots of "*" in there.

The query complexity exploded, ES ran out of memory, and the index got corrupted and I don't remember why, it could not recover.

We had to re-index all the data. Lots of fun.

Lesson learned: prepare for the impossible, keep your infrastructure up to date, escape queries :)

ffhhj|3 years ago

Maybe escaping the character wouldn't help if every * is telling the server to process a long loop, but some max range or time to perform the task. I can't tell which company, but I managed to do exactly that you described a few months ago, with a valid query, and it's one of those companies you can guess if I tell you the first letter of its name.

rawoke083600|3 years ago

Yup seen that in a few online "stores" or companies where they use SOLR or ES. Putting in '' will make boxes explode* (ok not really).

What is twice is bad as that the worst of these, fail (at least to my eye) on two fronts.

1) Allowing SINGLE character searches. I.e No min query-length.

2) Not escaping querying - lucene(solr/es) syntax.

You can sometimes see the front-facing "html/js/api" is just a thin layer over ES/SOLR.(Which is not bad by itself) it's when you don't know the limitations or what sort of queries are x100 harder to do than orders.

thekiptxt|3 years ago

> Google Docs uses a "Markov Chain" to predict the next word for autocompletion purposes. In this case, of course, since we've already written "And" 5 times, the only logical next word would be "And", as showed in Djikstra's 1989 paper on the subject. Therefore, the Markov Chain never terminates and hence the memory chain overflows with infinite ands.

Does anyone know why this bug doesn’t repro for some words other than And if this is the case?

ghayes|3 years ago

That statement follows with:

> Obviously, this is partly intentional- Gregory Markov modelled his famous Chain after his younger brother, who would try to finish all of Gregory's sentences for him. The one way Markov could fool him would be to repeat the same word multiple times, and then say "Jinx", also I made all of this up, good luck Google Docs team

timando|3 years ago

Probably because that commenter just made it up.

sailingparrot|3 years ago

That comment is a joke. SmartCompose does not use a Markov Chain, it is either still an LSTM or got upgraded to a small transformer based model.

Sohcahtoa82|3 years ago

I'm not sure that comment is true based on the second paragraph of it:

> Obviously, this is partly intentional- Gregory Markov modelled his famous Chain after his younger brother, who would try to finish all of Gregory's sentences for him. The one way Markov could fool him would be to repeat the same word multiple times, and then say "Jinx", also I made all of this up, good luck Google Docs team

noduerme|3 years ago

That was one of the funniest tech comments I've read in awhile.

akersten|3 years ago

How is it not code review first comment to limit that lookup to like, 10 steps at most? Baffling

ayashko|3 years ago

Reminds me of an old joke;

– I bet you a beer you can't make a logical, grammatical sentence with five ands in a row

– I used to be a sign writer in a previous life and one of the jobs I had was to repaint the sign hanging over the door to this very pub. Except the publican was adamant that he wanted more space between the words. Where exactly I asked? In between the Pig and and, and and and Whistle he replied.

aliljet|3 years ago

And here's a link to a document where you can see the bug in action. https://docs.google.com/document/d/1KKZHZpKRFRBddEvjFc-au2LM...

MiddleEndian|3 years ago

Google Docs crashes in Firefox on Windows 10 with your link.

When I re-create the document from scratch, it does not crash.

When I copy the link to my non-crashing document and load it in a new tab, the crash then occurs when I edit the document in the new tab but not when I edit it in the original tab.

sillysaurusx|3 years ago

It's interesting seeing how many people interact with that link. +40 users in a matter of minutes, and some instant spam suggestions too. Kind of funny.

Thank you for the repro case!

aliljet|3 years ago

And changing this link to a view-only authorization. It appears the bug is fixed.

sillysaurusx|3 years ago

Sort of related, last night I managed to make Clang crash by feeding it a certain C++ program: https://i.imgur.com/r5MC2aK.png

It was very surprising that there was a way to get Clang to segfault. Should I report it somewhere?

The code is basically doing a recursive template expansion with some C++20 concept constraints. So it's not quite as simple as "And. And...", but it's similar in that certain input text causes a crash. I just have no idea whether to report it, or where.

tylerhou|3 years ago

Clang segfaulting is somewhat common. It usually doesn't happen, but sometimes when I write some cursed template metaprogramming code it crashes and I'm not surprised. In your case, especially because you are using C++20 concepts, that is a newer feature and you probably hit some less-tested codepath.

dzaima|3 years ago

Note that it might be worth trying the latest clang version first. The latest proper version is 14.0.0 from Mar 25, which is only a month old compared to the 7 months of 13.0.0, but if it's something that's condensable to a single file, you could test it on https://godbolt.org/z/hv41441jK, which has daily builds.

magneticnorth|3 years ago

Reproduced on Brave browser on Mac OSX.

Hypothesis from chatting about this with people nearby - somehow this string makes the grammar engine search space too large (that's the AI that predicts your next words) and it's running out of memory.

truly|3 years ago

It seems to be fixed now. It would be fascinating to read an analysis of what exactly leads to the bug.

queuebert|3 years ago

I tried this on my typewriter, and nothing happened.

peterburkimsher|3 years ago

I tried this on my typewriter, And. And. And. And. And. <nothing></nothing>

Probably because it's out of paper.

Related: how is paper fed into an Apple Magic Keyboard - Hebrew?

Edit: Tried to reproduced with Arabic keyboard, plugged in now. Accidentally inverted right-to-left in brain.

dnA. dnA. dnA. dnA. dnA.

jrd79|3 years ago

That is an amazing bug.

vldx|3 years ago

I’m very curious what may be the root cause of this.

jonnycomputer|3 years ago

Favorite comment on that page: "Google is a small indie company btw"

So, more seriously, what might cause this (mis)behavior?

Sohcahtoa82|3 years ago

Typing "And. And. And. And. And." did not reproduce the bug, but copy/paste the "And [...]" from the title of this post did.

EDIT: Ah, I had to reload the page, thank you child comments.

lopatin|3 years ago

Typing worked for me. You have to refresh.

mshockwave|3 years ago

on my side it didn't trigger the crash right away but if you refresh the page, a popup with "Something went wrong" will show up

valenaut|3 years ago

Reproduced in Safari on macOS Monterey.

"And. And. And. And." caused no problems.

"And. And. And. And. And. And." also crashes (5 "And."s is a substring, so makes sense).

I cannot imagine how this bug is occurring.

pmichaud|3 years ago

My wild-ass guess is a grammar check bug. Since it words on both “and” and “but,” I’m thinking it’s some check related to conjunctions.

Normal_gaussian|3 years ago

Perfect prank document to send to the team. I'm just hoping it holds up until the morning so everyone can join the fun and not just those of us with bad work time habits.

mikotodomo|3 years ago

OMG I showed this to my friends and now someone in my class keeps adding it to our documents.

seangrogg|3 years ago

“And.” I wrote. “And. And. And. And.”

That was the part that led to the apocalypse.

This was not a coincidence, because nothing is ever a coincidence.

croddin|3 years ago

"Also. Also. Also. Also. Also.\n" also breaks it.

metalliqaz|3 years ago

The following also triggers the bug:

Also. Also. Also. Also. Also.

raffraffraff|3 years ago

Only tangentially related, and not at all serious, but this reminded me of the Irish film "The Committments" (1991) in which a working class Dublin guy puts together a soul band. He's introduced to two promising musicians who are already in a band...

Jimmy: What do you call yourselves?

Derek: "And And And."

Jimmy: "And And fuckin' And?"

Derek : Well, Ray's thinking of putting an exclamation mark after the second "and." Says it'd look deadly on the posters.

Jimm: Psshh...

Outspan: You don't like it? You think it should go at the end?

Jimmy: I think it should go up his arse.

Outspan: Well, we're not married to it.

throw7|3 years ago

I've had emails crash gmail on my phone still to this day. Typically it's stuff like output logs. My guess is something to do with the repetitive lines, but who knows.

herpderperator|3 years ago

Google has responded:

> Dear Google Docs users, we are aware of the issue and working on a fix right now. Thank for surfacing this issue and sharing it with us. We will keep you posted!

> Deving

> Google Employee

petters|3 years ago

I had an exam in image analysis once. There was a photo of a text "Sea and land".

The task was to "determine the cross ratio between sea and and and and and land".

calebegg|3 years ago

Something I recently found out about is you can go to https://docs.new to create a new Google doc.

ronald_raygun|3 years ago

I can't get the bug to reproduce. But maybe someone else could try

Wouldn't the sentence 'I want to put a hyphen between the words Fish and And and And and Chips in my Fish-And-Chips sign' have been clearer if quotation marks had been placed before Fish, and between Fish and and, and and and And, and And and and, and and and And, and And and and, and and and Chips, as well as after Chips?

mike_d|3 years ago

"And." x 5+, case sensitive, new line at the end. Hit refresh in your browser and it will throw an error.

vesinisa|3 years ago

I remember discovering that pasting a specific emoji to Google Slides causes the slide to become "poison". You could not view or edit it, the web UI would crash if you clicked on the slide. I discovered this by accident, but did not think much of it as I was able to work around by deleting the slide from the document overview.

westonjackson|3 years ago

Disable spelling and grammar checks in a separate doc and return to the broken doc is a possible workaround

bitwize|3 years ago

I wonder if "James where John had had had had had had had had had had had a better effect on his teacher" does someone's grammar checker up in knots. Or any of the old standbys, like "Police police police police police police".

queuebert|3 years ago

Or "Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo".

rikeanimer|3 years ago

omg I tried to post a reply on that support page and it errored out saying "you need to be signed in ..." while I could literally see my sign in logo top right corner of the page.

fking google.

there are good [as well as technical humurous] comments on the page.

croddin|3 years ago

"Anyway. Anyway. Anyway, Anyway. Anyway.\n" will break it too. Anyway...

LordDragonfang|3 years ago

If I had to guess, I suspect this is due to some very weird edge case with their recently implemented grammar checker.

Doesn't appear to be an issue for the android app, but that might be a cache thing.

blatherard|3 years ago

It's been fixed.

> May 6, 2022 Update: We have fixed an issue in Docs related to repetitive use of the word ‘and.’ This fix should soon be in place for all customers.

glouwbug|3 years ago

Maybe we can push to the front page all the issues with gmail so they can fix that too

JoeAltmaier|3 years ago

Who. Who. Who. Who. Who.

However. However. However. However. However.

Why. Why. Why. Why. Why.

js8|3 years ago

Google engineers should ask "Why." five times to get to the root cause.

analog31|3 years ago

An odd coincidence, I recall that pressing an operator button on an older HP calculator would also cause an error, because the stack was 4 levels deep.

rossdavidh|3 years ago

Looks like HN is able to handle it just fine, though. :)

strictfp|3 years ago

And?

wardedVibe|3 years ago

worth a shot, I tried it, and it worked fine. Then again, I couldn't reproduce the original

X6S1x6Okd1st|3 years ago

Replicated on my end on OSX & firefox

oliwary|3 years ago

Replicated on Windows 10 and Chrome too!

pinewurst|3 years ago

OSX and Safari replicated

selimthegrim|3 years ago

Heaven brings forth innumerable things to nurture man. Man has nothing good with which to recompense Heaven.

pipeline_peak|3 years ago

I couldn't reproduce the bug. Just five and's with periods and spaces in the body of a document?

tmalsburg2|3 years ago

Can't replicate this bug in current Firefox on Ubuntu 21.10. They've probably fixed it.

iagocds|3 years ago

The Android App does not crash, but if i try to open the file at the web version it crashes

graderjs|3 years ago

What if you put it in a spreadsheet cell, calendar description, drawing text or email?

srinathkrishna|3 years ago

What's pretty annoying is that users are providing free QA for Google!

edgyquant|3 years ago

This doesn’t work on the iOS app, I’ve pasted it and typed it manually

endisneigh|3 years ago

I wonder if this is crashing due to some auto completion shenanigans

kabes|3 years ago

Is this fixed? Can't seem to reproduce this (chrome on ubuntu)

Nitramp|3 years ago

I think the engine is just offended by your terrible writing style.

likortera|3 years ago

Wonder if this was discovered because of a Mars Attack ET using it.

ineedasername|3 years ago

Buffalo. Buffalo. Buffalo. Buffalo. Buffalo. doesn't crash it

ricardobayes|3 years ago

I'm glad I was here when this historical event happened.

fortran77|3 years ago

It crashes for me in Chrome on windows 11, but not Edge.

yashg|3 years ago

Nothing is happening. Tried in both Firefox and Chrome.

bufferoverflow|3 years ago

I'm surprised Google didn't fuzz Google Docs.

goody71|3 years ago

Will Pat Needham get any Google Bux for finding this?

mintplant|3 years ago

Relatedly, I have a string of text that, when pasted into Windows 11's Notepad, consistently causes it to crash. I don't know who to report this to.

nograpes|3 years ago

Okay, I'll bite. What is the string?

rdudek|3 years ago

Don't keep us hanging like this, what's the string?

mc4ndr3|3 years ago

Grammar check problems strike again.

mxuribe|3 years ago

Wow, this is pretty silly, odd! :-)

draxil|3 years ago

Sounds like a feature, not a bug.

eek2121|3 years ago

Guess they already fixed it.

iamyatin|3 years ago

6th May, with the "And. And. .." crash found on Google Docs Skynet rose to the surface.

shreyansh26|3 years ago

Reproduced on Edge on Windows 11 as well. What a bug! Really need to know the root cause of this.

tnli|3 years ago

Little Andy we call him.

dropit_sphere|3 years ago

lolwhat, replicated w/Linux and Chrome just now.

captaincaveman|3 years ago

has anyone tried "Or. Or. Or. Or. Or."?

8bitben|3 years ago

Actually yes. Didn't crash it!

soperj|3 years ago

or "&&. &&. &&. &&. &&."?

okaydeveloper|3 years ago

The engineer at Google will be sweating now. The secret is out.

piemadd|3 years ago

sounds like a markov chain going berserk

skerit|3 years ago

That was fun!

twism|3 years ago

Repro'd

wardedVibe|3 years ago

didn't happen in firefox on Ubuntu

zciwor|3 years ago

Will 100% be pasting this into a coworker's Google Doc with a white font color.

_wldu|3 years ago

That's probably a cyber crime in most US states.

Edit: You guys have no sense of humor.

ffhhj|3 years ago

Send it in your resume to annoy recruiters.

elektrons|3 years ago

I’m curious what this will do to a google form.

glitchc|3 years ago

Sounds like a totally collaborative/supportive workspace.

mtgx|3 years ago

[deleted]

bspear|3 years ago

How random. Can't wait to try this

fareesh|3 years ago

Did this bug emerge after their Orwell word policing update?

sam1r|3 years ago

I’m willing to bet it’s related to this. Google docs is trying to guess something for autocomplete, similar to their gmail feature to complete your sentences.

Which means, on a privacy standpoint, whatever you’re writing and guessing, they are absolutely processing something.

We the user are the product, apparently. This is mildly creepy to me because, I do vent on google docs sometimes. And assume only I can read it..

simonh|3 years ago

It’s literally called a word processors, so I suppose it processes the words. I don’t have a problem with that, as long as my data is only used for purposes I have approved and to provide features I use.