text:
Will it halt? (Robbers)
This is the robbers' thread. The cops' thread is here.
Your challenge is to crack a cop's submission by finding an input that makes it halt. You don't have to find out why, or all inputs that make it halt if there's more than one, or the input the cop intended, just one input will do.
Once you have cracked a submission, post a link to it in a comment or edit to the cop's post. You can also flag your submission for a mod to edit it in the cop's post. Also, post the input used and a link to the cop's post in an answer in this thread. The robber that cracks the most submissions wins.
Multiple people can post cracks to the same cop submission, as long as they are different.
(If SE converted your duplicate answer to a comment, you may want to vote on this feature request)

Looking for uncracked submissions?

fetch("https://api.stackexchange.com/2.2/questions/135363/answers?order=desc&sort=activity&site=codegolf&filter=!.Fjs-H6J36vlFcdkRGfButLhYEngU&key=kAc8QIHB*IqJDUFcjEF1KA((&pagesize=100").then(x=>x.json()).then(data=>{var res = data.items.filter(i=>!i.body_markdown.toLowerCase().includes("cracked")).map(x=>{const matched = /^ ?##? ?(?:(?:(?:\[|)([^\]]+)(?:\]|<\/a>)(?:[\(\[][a-z0-9/:\.]+[\]\)])?)|([^, ]+)).*[^\d](\d+) ?\[?(?:(?:byte|block|codel)s?)(?:\](?:\(.+\))?)? ?(?:\(?(?!no[nt][ -]competing)\)?)?/gim.exec(x.body_markdown);if(!matched){return;}return {link: x.link, lang: matched[1] || matched[2], owner: x.owner}}).filter(Boolean).forEach(ans=>{var tr = document.createElement("tr");var add = (lang, link)=>{var td = document.createElement("td");var a = document.createElement("a");a.innerText = lang;a.href = link;td.appendChild(a);tr.appendChild(td);};add(ans.lang, ans.link);add(ans.owner.display_name, ans.owner.link);document.querySelector("tbody").appendChild(tr);});});

Uncracked Submissions

Language	Author

Does different mean different inputs (say, all inputs ending with 2 crack the cop's post - can you different people post different numbers ending in 2?) or different families of inputs, or different types of inputs?

Multiple people can post cracks to the same cop submission... Please define different.

@NoOneIsHere https://codegolf.meta.stackexchange.com/q/13437/58826

Malbolge, Doorknob
Try it online (Thanks Dennis!)
Input for Windows: F_⌠1234567890
Input on Linux based system using ISO-8559-1: F_ô1234567890
The heart of how the Malbolge program worked is that it depended on a behavior of the Malbolge interpreter which causes an infinite loop if it encounters any instruction which is not between 33 and 126. The program was constructed such that your input would allow you to modify a single instruction.
I modified the interpreter to dump the program memory state at the beginning of execution and to also produce 'normalized' source code which takes the form of a list of op codes that will be run during the execution of the program. With that information you could (slowly) determine that even though the program took
 13 inputs only the 1st and 3rd inputs actually mattered.
Looking through the normalized code and memory dump (and a touch of debugger help) I devised the following:

a = op(input 1, 29524)
b = op(input 3, a)
c = op(486, b)
d = op(c, 37)
e = d/4 + d%3 * 3^9
e must be between 33 and 126

Where op is the so called tritwise "op" that is described in the specification. Using this information you can write a simple program which iterates over the possible inputs (0 to 255) and finds all solutions which meet the above criteria. I had found 2219 possible solutions, some of which will probably not be working solutions (you can't input the required characters). Specifically the above inputs are based on the solution:
(Input 1 = 70, Input 3 = 244)

I don't have the rep to comment cracked on the cops post. Could someone do that for me?

Welcome to PPCG! Good job! I think with this crack, you'll soon have enough rep :)

I commented across. And yes, excellent work; I was half expecting Malbolge to last the week!

I might need to remove this answer. I just tried using GCC and it looks like it isn't working. It looks like the memory address is different on my system. I will investigate it more tomorrow.

Nevermind, it looks like it was an encoding issue. I will add more details when I come back to explain my reasoning.

Nice work! TIO uses UTF-8, but by wrapping it in Bash, your crack can still be verified. https://tio.run/##S0oszvifnFiiYKeQkZhTopebmKNgY6Ogrqf@X8NWrchKOd@2Lsckq8o83bSspCSpqKAgLi8nJyorIyOMKy0lJSgpwd/aSkPdKzJCOSysLiu4OjDHLsvX29vS0z2Zyy3RJT4iNiY6KjIiPKzYz8zHxCsmOjvSNSPMKTU4OSmRSzXeNza2zjPS3di1ssLUxNhIG2iBbp52jmaWeoaqk8F/PS6uzOT8vDIF3RKFzOJ8XQsLU0tdQ4UaBf38ghJ9oGOT8nPSU@EMuB/@u8Uf3mJoZGxiamZuYWkAAA You don't seem to need anything but F_ô by the way.

I am impressed. Well done. :) Will edit an explanation of the original thought process behind the design into my submission eventually.

Now I can sleep again

Hey! Would you consider putting your modified Malbolge interpreter on Github?

Sure, here you go https://github.com/KBRON111/Modified-Malbolge-Interpreter

JavaScript (in Browser)
document.all

This is falsy, surprisingly
Edit: why is document.all falsy?

I'm speechless.

Aahh... javascript, where everything is weird

Yes! That's the only correct answer here!

JS (ES6), Juan Tonina
+0,-0

Took a bit of looking in Object.is to find. Basically, +0 === -0 since === checks them as numbers, and 0 is finite, but Object.is sees +0 and -0 as different objects. Very smart cop :)
Try it online!

Ninja got it while I was logging in. Shoot.

Damn, solved faster than the time I spent thinking about the code :D

Python, Siphor
class A:
    i = True
    def __eq__(self, a):
        self.i = not self.i
        return self.i

a = A()
f(a)

We just redefine equality to behave exactly as required to get the program to terminate.

Although I suppose I could have just defined __eq__ to raise...

I was about to submit with just returning 0 :p

@JonathanAllan How does that work?

Pretty sure just class A:__eq__=lambda s,o:0 and f(A()) does the job.

Ah yeah need the negation >_<

FYI it's not Eric's submission it's Siphor's.

@JonathanAllan Oops...edited.  I think I was reading from the answer below or above it or something...

Braingolf
-1

Any number less than 0 works.
Try it Online!

PHP, Sisyphus
(-0[0)> deal with it=1

The parse_str function changes the spaces and other characters to underscores. If you put a [ used for Array delimiter without closing, it changes it to an underscore but has the effect of not translating the following spaces (I don't know why).
Try it online!

WTF?! That is insane...

JavaScript (Node.js), Adnan
[] and [] seem to work. I tried a bunch of them including null, undefined, NaN...
[] >= [] && [] <= [] && [] != [] evaluates to true.
Moral of the story: JavaScript is weird.
Try it online!

Yep, arrays are just objects.

And objects are cast to strings for these types of comparisons.

JavaScript (ES7), Arnauld
Standard
"8e7" is solution

var crack_me = (x=0)=>{for(;~x/x.length**3!=-2962963;);}

var key = "8e7"

crack_me(key)
console.log("stopped :)")

Hack
No need to calculate this number, we can redefine length property
This sets ~x/x.length**3!=-2962963 to false

var crack_me = (x=0)=>{for(;~x/x.length**3!=-2962963;);}

var key = {toString:()=>"2962962",length:"1"}

crack_me(key)
console.log("stopped :)")

Operators priority
~ bitwise not is first
** exponentiation second
/ division third

Bash, Veedrac
LD_TRACE_LOADED_OBJECTS

Try it online!
From the ld.so(8) manpage:

LD_TRACE_LOADED_OBJECTS
If set (to any value), causes the program to list its dynamic
  dependencies, as if run by ldd(1), instead of running
  normally.

I thought this would last longer! Excellent work.

@Veedrac: I guess since you specified bash, it's unlikely that you'd find a statically-linked (e.g. busybox?) /bin/yes, but that is possible, in which case this env var would be ignored.

Mathematica, JungHwan Min
Unevaluated@Throw@"hammertime"

No clue whether this is the intended solution, but it passes in an expression that doesn't get evaluated until it's referenced as # inside the function, which will cause it turn return from the function immediately without doing any further evaluation. You can see that the function is actually called (instead of just throwing the exception before even invoking the function) by changing the function to:
#0[Print@"stop";#;$IterationLimit=∞]&

Which will indeed print the stop before throwing the error.

Bingo! (I was actually going for Unevaluated[Abort[]], but same thing.)

R, Jarko Dubbeldam
function(x)if(is.list(x))return(1)

First time contributing anything, so do call out any mistakes I've made in format.
Pretty sure this is valid. Just a rewrapping of is.list(), right?

Incidentally, I don't have the rep to comment on the original so a hand would be appreciated if it's valid.

Commented for you.

Not the intended solution, but works. Good job.

Retina, PunPun1000
11111

Try it online!
Any input with n 1s where the sum of the divisors of n+1 is equal to n+1 should work.

Nice to see someone get the intended solution

Node.js, Adnan
{} and {} or any 2 objects are the two inputs. I don't even understand how this works.
Here's JS's amazing object compare logics:

console.log({} == {});
console.log({} === {});
console.log({} > {});
console.log({} < {});
console.log(!!{});

console.log({} >= {});
console.log({} <= {});

Yup, that was the intended solution :)

Bash, Sisyphus
kill 0

Fortunately, kill is a shell builtin.
Try it online!

Javascript, programmer5000
Max string length
Uses a string with a length one less than what your engine supports. When adding "h" to this string, an error is thrown. Try it online!
function getAlmostMaxLenStr() {
  var prevBases = [];
  var base = "a";
  try {
    while(true) {
      prevBases.push(base);
      base += base;
    }
  } catch(e) {}
  for (var i = prevBases.length-1; i>=0; --i) {
    try {
      base += prevBases[i];
    } catch (e) {}
  }
  return base;
}
f(getAlmostMaxLenStr());

Cross-origin block
Heavily inspired by the answer from @jadkik94, but works everywhere. Creates a cross-origin iframe, then passes the .contentWindow of said iframe. This fails when the function tries to use the value due to cross-origin safety.

let f=x=>{
  try {
    console.log(x+"h"); // we don't want to lock up your browser, do we ;)
  } catch (e) { console.log("Halted!\n",e); }
}
let iframe=document.createElement("iframe");
const url = location.host.indexOf("google") === -1 ? "https://google.com" : "https://stackexchange.com";
iframe.src=url;
iframe.onload=a=>f(iframe.contentWindow);
document.body.appendChild(iframe);

Primitive value
Variant of the .toString() answers - this just uses toPrimitive instead. It returns an object as the primitive value, which Javascript doesn't know how to handle (so it throws an error). Try it online!
f({
  [Symbol.toPrimitive](){return {}}
});

Nice job, but still not intended solution! Very clever!

Ruby
exit

without newline. 3.send('exit') surely isn't equal to 5, but it executes Kernel#exit:

Initiates the termination of the Ruby script by raising the SystemExit
  exception

It's possible to call exit on 3 because:

The Kernel module is included by class Object, so its methods are
  available in every Ruby object [as private methods].

abort also works:

Terminate execution immediately, effectively by calling
  Kernel.exit(false). If msg is given, it is written to STDERR prior to
  terminating.

JavaScript (Node.js), programmer5000
Already cracked, but mine is slightly different :) Don't have enough rep to comment over in the cops. Also feel free to edit to fix formatting, my first post here.
Mainly I set __proto__ equal to a function that throws. Taken from looking at the Mozilla page for proto. (Sorry, low rep, can't post a link.)
x = {}
let No = function () { throw 'halted' }
x.__proto__ = new No()

f = x=>{while(x.__proto__);}

Try it online!
EDIT: Got some rep, so here's the link: Mozilla __proto__

I commented on the cop for you.

Thanks! Also thanks all for the ups, guess I can comment now!

Welcome to PPCG :D

Python 2, Foon
__import__("os")._exit(0)

What it says on the tin, basically.
Try it online.

Interestingly enough, on TIO this times out for me; under Windows (specifically with winpty python inputbad.py and pasting in the line), it does exit as desired... and yeah, not surprisingly my schtict was exploiting the "input under Python 2 does eval under the hood" bit

@Foon Hmm, it's working fine on TIO for me. See link in answer.

Weird... I must have hit play and then typed input on my TIO link and not realized it

I'm pretty sure this cracks every python submission..

@enderland Only if they evaluate your input, which most of them don't.

Bash 4.2, Dennis
PATH=1

Clearly not the intended solution, because it works on newer bash as well.
Try it online.

JavaScript, programmer5000
window[0]

Works on the Code Golf StackExchange page on Firefox (i.e. while(window[0] + "h"); throws a Error: Permission denied to access property Symbol.toPrimitive error in the console and exits)

window apparently doesn't implement the [Symbol.toPrimitive] function (which is used when converting an object to a string) - nice find!

@Birjolaxew it's not window; see !!(window + "h") === true. Not sure what it is. Found it by looking at all the window attributes. I was sure one would fail because of a security exception or cross domain stuff.

BASIC, Stilez
https://www.youtube.com/watch?v=9NcPvmk4vfo

This input halts the program. Weird choice, but it works.

Ah nooooo! And its the 8 b8t version!! :)

Python 3 (CPython), Veedrac
a=('',(type,),{})
X=type(*a)(*a)
X.__class__=X

Try it online!

Octave, Stewie Griffin
Input:
exit
Reasoning:
input evalutes whatever is input. exit exits the program.
Try it online!

Javascript (NOT node.js), programmer5000
This can't be added because it creates an object that has no toString because a new Set does not inherent prototypes from from Object.
input:
new Set()

Try it online!

This was probably the intended solution, I'll keep that in the bag of my head from now on :P

Sorry this doesn't seem to work for me? Try it online!

@HaumedRahmani added a try online button. I used spider monkey, not babel.

Not the intended solution, but nice job!

JavaScript (Babel Node), Conor O'Brien
(Repost, accidentally put in cops.) Not sure what was intended but positive decimals that aren't enormous all seem to work.
Also I guess I still can't comment in Cops.
f(0.1)
console.log('done')

Try it online!

Forgot about that as well, good one.

Python 3, Siphor
This was fun.  We need to make the type(x) != str check pass, so we need to control the return value of type().  We have to override the __class__ attribute and replace it with a custom object, that extends type, which has the __ne__ method replaced by one that always returns false.  This makes it pass the type check, but the search will fail because o is not a str.
class m(type):
    def __ne__(a,b):
        return False
class c:pass
o=c()
o.__class__=m("",(c,),{})
f(o)

Welcome to the site! :)

C#, TheLethalCoder
System.Nullable`1[[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]

Or any other nullable class.

R, Jarko Dubbeldam
Just an invalid regex.
"["

Try it online.

Python, Siphor
f('t=False')

Crashes due to an UnboundLocalError.
I think this is hapening because my t=False overrides the higher-scoped t with the local t, but it's not set at the time of the loop, causing the crash.
TIO

This seems so easy, good job.

Commodore 64 Basic, Mark
If I understood this correctly (and it's entirely plausible I have not), you just need to overflow the floating point variable.
9999999999999999999999999999999999999999999999999999999999999999.9

You can use scientific notation for a shorter crack.  A simple 1E50 will do just as well, and is easier to type.

Bash 4.2, Dennis
-9223372036854775808/-1

Why though, Dennis? y u do dis?

Well done. I had 2**63%-1, which results in the same operation.

I assume this is a parsing or evaluation bug of some sort? What exactly causes it to fail?

@RobertFraser It overflows! They're stored in small registers and the division generates a SIGFPE.

It's somewhat ironic that (on most platforms, including x86) unless you on purpose unmask FP exceptions, the only thing that will normally raise SIGFPE is an integer division exception.  (by zero, or overflow).  But POSIX requires integer division to raise SIGFPE if it raises any signal at all: https://stackoverflow.com/questions/37262572/on-which-platforms-does-integer-divide-by-zero-trigger-a-floating-point-exceptio

C#, TheLethalCoder
new char[0]

string.Empty ("") is always interned. Therefore, an empty array or null will work.

Husk, Leo
Pass 4 arguments! It only works with 0-3. You can't do it with less because the arguments aren't actually used.
Try it online.

brainfuck, Jerry
B0000

Try it online!
Edit: This is the list of all 5-character input that makes the program halts, in range [a..z]: (Warning: large text file)
And this is all input in WordData[] of Mathematica 10:
{"aesop", "agape", "annon", "cloak", "daunt", "fagus", "filch", \
"gomel", "hijab", "jakes", "jerry", "rebut", "rover", "ruddy", \
"sewed", "trine", "villa"}

Perhaps jerry is the expected input.
Explanation:
First, we can see that there are 5 , signs in the program, therefore 5 characters are required. Call their character code {i0, i1, i2, i3, i4} respectively.
And, to "decrypt" the code:
>>,>,>,>,>,                     m0 = i0; m1 = i1; m2 = i2; m3 = i3; m4 = i4;
[-----------<-<+<--<--->>>>]    m3 -= m4 / 11; m2 += m4 / 11; m1 -= 2*m4 / 11; m0 -= 3*m4 / 11; m4 = 0;
<++<<+<++                       m3 += 2; m1 ++; m0 += 2;
[----->+<]                      m1 += m0 / 5; m0 = 0;
>
[----------------->+++++++<]    m2 += 7*m1 / 17; m1 = 0;
>
[----->>+<<]                    m4 += m2 / 5; m2 = 0;
>>
[-<->]                          m3 -= m4; m4 = 0;
<
[--->++++++<]                   m4 += 6*m3 / 3; m3 = 0;
>
[--->+<]                        m5 += m4 / 3; m4 = 0;
+>-                             m4 ++; m5 --;
[-----------------<+>]          m4 += m5 / 17; m5 = 0;
<
[-->-<]                         m5 -= m4 / 2; m4 = 0;
>+                              ++m5;
[+-]                            while (m5 != 0);

Where initially the tape has the form
... m-2 m-1 m0 m1 m2 m3 m4 m5 ...
     ^ (data pointer at initial position = m-2)

So, input
m5 = 0;
m0 = i0; m1 = i1; m2 = i2; m3 = i3; m4 = i4;
m3 -= m4/11; m2 += m4/11; m1 -= 2*m4/11; m0 -= 3*m4/11; m4 = 0;
m3 += 2; m1++; m0 += 2;
m1 += m0/5; m0 = 0;
m2 += 7*m1/17; m1 = 0;
m4 += m2/5; m2 = 0;
m3 -= m4; m4 = 0;
m4 += 6*m3/3; m3 = 0;
m5 += m4/3; m4 = 0;
m4++; m5--;
m4 += m5/17; m5 = 0;
m5 -= m4/2; m4 = 0;
++m5;

(note: over modulo 256, all divisions will halt, except the m5 -= m4/2 is because of at that point m4 is even)
into Mathematica gives
m5 = (117414 + 77 i0 + 385 i1 + 935 i2 - 4675 i3 + 419 i4)/238425

m5 == 0 can be transformed to (mod 256)
i4 := Mod[222 + 177 i0 + 117 i1 + 211 i2 + 225 i3, 256]

Loop i0, i1, i2, i3 through all combination of a..z gives 46413 results, of which 17 of them are English words.

Swift 3, Alexander
extension Bool {
    prefix static func !(val: Bool) -> Bool {
        return false
    }
}

Add above the loop.

Wow, defining the operation in an extension on Bool doesn't cause an ambiguity error, but defining it as a free function does. Odd. This wasn't what I had in mind, but well done, though!

JS (Node.js)
NaN

In JS, NaN !== NaN

JavaScript (ES6), programmer5000
"\0"

Try it online!

The condition was !x||x>="\n". Any single char in an ASCII table with a code less than \n will work.

Yes, I thought this was it, wasn't sure...

JS (ES6)
"   "

Any character with a code less than 10 should work; I've used a tab character above, which SE converts to spaces.

Ninja'd

Sorry :( plus I think you'd need quotes around it for it to be a string

@programmer5000, so I see :(

No problem, @StepHen; nature of the game. I took the quotes to be implicit, but I'll edit them in.

@Shaggy I dunno what the ruling is, but f(<tab>) is valid syntax (empty input) and we'd have to differentiate between f(1) and f("1") anyway

Retina
A newline followed by a 1 works. I found it right away.

1
Try it online

Ninja'd by a minute

@Cowsquack The question says multiple cracks for the same cop post are allowed.

I knew I should have removed newlines from the input as a first step

MATL, Luis Mendo (not the intended solution)
The empty input stops the program and thorws the following error:

input: reading user-input failed!

Try it online!

cQuents, Step Hen
Anything followed by a space and a positive integer. The space separates inputs, and the extra input becomes the number of the term to output.
Try it online!

I was just about to post a 1! You ninja'd me :/

@Mr.Xcoder I typed this on mobile, hoping that nobody would ninja me :P

MATL, Luis Mendo
0/0

MATL evaluates 0/0 as NaN.  Since NaN != NaN it does not loop
Try it online!

C (gcc), dj0wns
The intended solution is probably:
%n

This treats char *a as a writable unsigned int, but since it is assigned to a constant string, this invokes undefined behaviour which on TIO gives me:

/srv/wrappers/c-gcc: line 5: 18569 Segmentation fault      (core dumped) ./.bin.tio "$@" < .input.tio

Wow shows how much I suck at having a problem with one solution. Still not it! Nice job though. That was a really cool get, I didn't know about this at all

Node.js, Евгений Новиков
input:
{__proto__:null}

Try it online!
The input gets applied to an object. My input is an object with the same name as  the native functions (__proto__) which will get applied to the object in the while condition and will override the native functions (such as toString and valueOf), causing an error when the program tries to cast the object to true/false for the while loop (because the necessary functions are missing and broken).

JavaScript (Node.js), tsh
The answer is '0'.

f=x=>{try{for(;!x||x!=0||x instanceof Object;);}catch(e){for(;;);}}

f('0')

Try it online!

Javascript (Node.js), programmer5000
Object.prototype

Object.prototype is the root prototype for all other objects, but it can't obviously have a prototype itself, because that would create a loop. Edit: I think this also works:
Object.create(null)

C, Steadybox
1597463007 1065353216

Try it online.
This one was clever.

JavaScript (Node.js), Haumed Rahmani
JavaScript uses floats for everything, so...
f(100000000000000000)

Try it online!

Java 8, Socratic Phoenix
-32760

Try it online.
The hardest part was recognising that taking >1s didn't mean it was stuck in a loop :P.
This is just due to the constant cache; the equality check is actually for identity.

JavaScript, Step Hen
" "

Try it online!

Python 3, Veedrac
>>> import sys
>>> class A(type): pass
...
>>> for _ in range(sys.getrecursionlimit()+1):
...   class A(type, metaclass=A): pass
...
>>> T(A)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 2, in T
  File "<stdin>", line 2, in T
  File "<stdin>", line 2, in T
  [Previous line repeated 995 more times]
RecursionError: maximum recursion depth exceeded while calling a Python object

Brute force, I like it!

JavaScript, w0lf
This is the same hack as many others, really. There's probably a smarter solution, but this works.
{toString:1}

This just throws an error when calling toString.
JavaScript, w0lf v2
Same deal, no exception.
function(){ let x=0; return {toString: () => x++} }()

I'm pretty sure that's not the normal way to make anonymous objects with locals, but I figure someone will correct me in the comments.

Octave, Stewie Griffin
Any undefined input such as a will work: Try it online!
Defined values would not work, because | in a while environment is short-circuiting, so when it sees 1, it will already become true, no matter what the value of x is. So, the only way to make it halt is to make x=input('') halt, i.e. by giving it undefined inputs.

+1 for teaching me that | short-circuits in while environments

Javascript (NOT node.js)
Feel like this is cheating based on the last answer...
{toString:_=>{throw''}}

IMO this is perfectly fine :)

C (gcc), dj0wns
%s%s

Try It Online!
The offending command essentially evaluates to this and throws a seg fault when it tries to read a second string from beyond d, since there is no 5th argument to the function.
char b[256];
char*d = "abcd";
snprintf(b,4,"%s%s",d)

Not my intended solution but I guess it works on Tio, doesn't work on my local machine though.

I hope someone can find the intended solution then, this particular question allows for multiple cracks

Well done mate!

C is perfectly happy letting you write to random places what?  In C implementations on modern OSes, all pages mapped in your virtual address space will be read-only or read/write.  I think some hardware does allow making pages write-only, but this is definitely not something you should expect.  C as an abstract standard of course just says that writing outside of any object is Undefined Behaviour, so it's all implementation-specific behaviour here.  A real-mode DOS C implementation might not fault at all here.

Also note that you're not trying to "read a second string from d."  You're actually trying to read from one argument beyond d, so the pointer comes from whatever garbage was in that arg slot.  d has nothing to do with the faulting address.  I can't tell if you know this but explained it badly, or if you think that d could have had two back-to-back strings or something.

@PeterCordes I reworded it to better fit my intention. The reason I said C was fine letting you write to any location was the fact that the fgets was letting me read 12 ('\f') characters into a character array of length 8 ('\b') without segfaulting. I thought that might be the original solution until it didn't work on the TIO the asker linked.

A few bytes beyond the end of an array is not "a random place"!  It's rare for that to segfault.  Sometimes (in real programs that have multiple variables) it steps on something else, but sometimes it just hits padding.  Or sometimes it corrupts a return address on the stack...

@PeterCordes  I've removed the unnecessary wording from my answer

C (gcc), Justin
With input %s, the program crashes.
#include<stdio.h>
int main(){char c[9];while(1){scanf("%8s",c);printf(c);}}

Try it online!

RProgN 2, ATaco
Cracked, with input #. I have no idea why, I think C evals, and # is a comment.
` .iS‘"{".C

Try it online!

O_o Unintended solution. # isn't a comment, but it pushed the "{" function literally when it eval'd, rather than executing it. +1.

@ATaco Oh cool lol

Javascript, Conor O'Brien
NaN

Yes, typeof NaN returns "number".

Darn. I forgot about that.

"Not a number" is a "number"? So it's basically in some kind of quantum state where it might or might not be a number depending on how you observe it.

Python 3, Veedrac
One value for which the program stops (with a ZeroDivisionError) is:
324835776096020208287573140963456

Try it online!
Edit: I'm not completely sure this is the smallest such value, but I will continue to check.
Edit2: OK, I've been looking for smaller solutions and haven't been able to find any. I cannot demonstrate that this is the smallest such value, but I'm pretty confident that it is.

Explanation
The algorithm does the following (considering the binary representations of the numbers):

p, n, and c are initialized to 0 (no bits set)
at each step, it consumes the 12 rightmost bits from x (the input)
out of these 12 bits, the 3 leftmost are discarded (&511) and only the remaining 9 bits are used. The value represented by these 9 bits is assigned to b.
out of the 9 bits, at most one must be set (b must be 0, or a power of 2), otherwise b&(b-1) will make the inner while loop forever.
the bit that is currently set in b will be set in p, n, and c
p is shifted 1 bit to the right (p>>=1)
n is shifted 1 bit to the left (n*=2)
in the next iteration, the bit set in b must be set in neither p, n, nor c (otherwise the (p|c|n)&b condition will make the inner while loop forever)

The objective is at the end to have all 9 bits in c set (it will be equal to 511 and therefore the last line will fail with the ZeroDivisionError), otherwise the last while will loop forever.
So, I was looking for a minimal way to make x out of 12-bit chunks, such that:

every chunk will have one of the rightmost 9 bits set
no chunk will "collide" diagonally with any of the former ones

The code I used to generate x with the smallest value I found is this:
chunks = [
        0b000000000001,
        0b000000000100,
        0b000000010000,
        0b000001000000,
        0b000100000000,
        0b000000000000,
        0b000000000010,
        0b000000001000,
        0b000000100000,
        0b000010000000,
]

x = 0
for c in (chunks):
    x += c
    x <<= 12
x >>= 12

print(x)

JavaScript (Node.js) by Alex Varga
Updated with what I'd intended to post, thanks to Patrick Roberts' comment!
{valueOf:_=>process.exit(0)}

Try it online!

Technically that terminates the program before even entering the function, as the process.exit() is invoked inside the call rather than the body. However, changing to {valueOf(){process.exit()}} would be sufficient.

@PatrickRoberts yeah, that's what I'd intended to post... Not sure how I posted the wrong one. I validated it entered the loop on my system, but clearly missed that.. otherwise, I guess I could have just added process.exit(0) on its own, which kinda misses the point of the challenge really. Thanks for the nod!

Also, the username typically links to their cop answer, not their account page, while you're editing.

JavaScript, programmer5000
Symbol.split

Try it online!

Also works with any other Symbol (e.g. Symbol()) - Symbols are spec'd to fail string conversions.
Very similar to Grant Davis' answer though.

Pyth, isaacg
Seems to halt every time. Input:
.q

Try it here!

Two seconds faster, lol.

Pyth, isaacg
.q

This quits the program.
Try it online.

R, Jarko Dubbeldam
"unlist"
Though it's just one more function that could be added to the exceptions - I doubt it's the intended solution.

Two more cracks: 'is.vector' and 'return'. These both work on the modified (list(0)) version.

you're right, not intended, but good solution! Instead of turning a fix into a new post, do you mind if I change list(1) to list(0)? :D

Sounds good to me :)

@JarkoDubbeldam See edits for two more cracks that work on the list(0) version. 'return' seems like it might even be the intended solution.

Getting closer, but not the intended solution.

A few more cracks for the new version: "NROW", "NCOL", and "lengths"

lengths is a thing... TIL

It's new - introduced in R 3.2.0. Really nice when you need it.

JavaScript, iovoid
this.constructor.constructor("return process")().exit()

Try it online!

Pyth, isaacg
exec(input())
__import__("os")._exit(1)

I call this "privilege escalation" :P.

C++,  ecatmur
struct C { int m; };
int C::* t = &C::m;

Try it online!
For some reasons, default initialization of pointer-to-member make that -1, which become true when cast to bool.

JavaScript (Node.js >= 6.0), Patrick Roberts
{__proto__:Function,toString:_=>process.kill(0)}

This probably isn't the intended answer, but it does work. It kills the process without giving either the exit handler or the exception handler a chance to run. Sending to PID 0 is shorter than to process.pid and sends the signal to all processes in the current process group.

Ah, unfortunate... Interesting object literal though, can't say I've ever seen one with a __proto__ attribute in it. And no, this wasn't quite it, but it was indeed creative, and probably more efficient than my answer.

Python 2, by veedrac
import os, functools
class A:__int__ = os.abort
k(functools.partial(int, A()))

Nice effort; I see your solution to mine is very similar to my solution to yours. This wasn't the intended solution, but I only just figured out partial can be used like this so fair play. I'll probably add a revision that bans functools.partial, but I'll leave that for another day.

Python 3, E.D. (Fixed)
The input 0526315789473684210344827586206896551724137931020408163265306122448979591836734693877551 halts the fixed program.  Since each of the three chunks are separate from each other, you can compute them individually, then combine them together.  A coworker of mine figured out the logic and wrote the script to generate this answer.
Also, the fix didn't entirely work as an input of "0"*88+"1" will halt the program as well, since the check for a nonzero n checks the whole string, while only n[:88] is used in the calculations.  So, any input of the form "0"*88+A where A is a string where all elements are digits, and at least one is nonzero, will cause the program to halt.
Try it online!

Javascript (Node.js), A username
Most inputs to the program will actually throw an error (null, 0, [] etc), but the below solution halts without an error:
f({ replace: () => {} })

Try it online!

JavaScript (Node.js), cracks A username's challenge
f('`W`')

Try it online!
There are multiple ways to make this fail with an error (try a single backtick) but this evaluates to this
return +[`W`]

This results in NaN, and NaN !== NaN.

cQuents, Step Hen
1 2

Try it online!
Essentially, anything that matches /^.+ \d+$/ is valid input that will halt the program.

A crack containing alphanumerics exists, if a cop wants to try it.

@StepHen I am still trying, trying to figure out how the inputs work

From documentation: Input is currently given as a space delimited list of numbers (although unless you do math on them they are not forced to be numbers, as in my test case on TIO)

@StepHen Figured it out as soon as you posted that comment :D

Java
The strings __.-._.-._.-.-.-.-.-._.-._._.-.-._. and __-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_- work, with a minor bug: Integer.toHexString doesn't give a leading 0x, under Java 8. (I didn't try other versions.) Trimming it from the source makes it work fine.

@tuskiomi, it works in Jetbrains IntelliJ and in TIO, and neither prepend the 0x. The . characters are space-filler in the non-checked positions (only every other position is checked).

Well, you got me there. The characters could be technically anything... but this is the correct answer.

Also, How'd ya figure this one out? ;)

@tuskiomi I saw that the bitshifts at the bottom were constructing an int bit by bit with - being 1, and mentally transcribed the two hex ints to binary. Then I added in the padding to make it fit, and made the other string as simple as possible to enter the if.

Did you realize that the solution was bit-banging I2c? :)

@tuskiomi, I hadn't even heard of it until now, to be honest. It's obvious once I looked it up, though. Clever puzzle!

Java, tuskiomi
Fatally errors when the two arguments '_-_-_-_-_-' and '__________' are given.

For me it keeps running

Did you type it correctly? 10 underscores and then 5 underscores and 5 dashes alternating

I copied straight from your post; I just tried switching the parameter's order. no cigar.

JavaScript (ES6), programmer5000
null

The condition was typeof x!=="object"||x; apparently null is an object but falsey in JavaScript.
Try it online!

JavaScript, programmer5000
null

That's basically it.

@programmer5000 Sorry, I didn't see the mistake when trying to FGITW

Python 2, Quelklef
def x():
    import ctypes
    ctypes.cast(1, ctypes.POINTER(ctypes.c_int))[0]

f(x)

I'm sure this isn't the intended solution, but a segfault counts, right?

Not intended, but does work... Wish I could disable imports.

Python 2, Quelklef
def f(x):
	try:x()
	except:1
	while True:1
def x():global True;True=False
f(x)

Try it online!
Redefines True to False.

Yay! This is the solution I was looking for! I did it differently, as f( lambda: globals().update({"True": False}) )

J, miles
Input: '' (the empty vector). Errors with an index error.
$:@#~^:(0([=[e.{#])#~) ''

This approach (erroring out) will work for infinity, floats, and non-positive numbers.
The intended approach is probably an imaginary number, such as 2j2, which returns a result.
   $:@#~^:(0([=[e.{#])#~) 2j2
2j2

Let's decompose the program:
$:@#~^:(0([=[e.{#])#~)
$:@                       call this function (recurse)
   #~                     with the input repeated itself times
     ^:(             )    if:
        0(    f   )#~         f(0, #~ y)
          [=[e.{#]

dyad:
[ = [ e. { # ]  x = 0, y = #~ y
           #    repeat
             ]     y
         {         y[0] times
    [ e.        check if 0 is in this list
[ =             check if that is false

So, we want an input y such that (0{y) # (#~ y) contains a zero. When using an imaginary number as y = a + bi, we get:
#~ y
y # y
(a + j. b) # y
(a # y) , (b # 0)

Which gives us b zeroes in the input. This will make the aforementioned condition false, and this only run once.

Does ending with an error count as cracked? There is actually an input that lets it exit without error. Good find, I didn't think of testing empty input.

@miles Yeah, so long as the program is finite. I'm still looking for a non-empty solution, however.

Yes, that's what I had in mind, I'll have to test more input types next time.

@miles Cool! That was fun, I learned something new about # today.

Yeah, it's one of the few features I haven't found a good use for yet.

JavaScript by Grant Davis
({t:1,get x(){ return this.t--; }})

getter is powerful. you may also try Proxy.

I used __proto__.defineGetter, but this is more elegant. This challenge has taught me a lot about JavaScript.

Bash, Dennis
//

Try it online.

JavaScript (Node.js), tsh
code:
x=>{try{for(;!x||x!=0||x instanceof Object||typeof x!='object';);}catch(e){for(;;);}}

input:
{valueOf:g=>{Object=Number;return 0}}

Try it online!
!x: x resolves to true !true resolves to false
x!=0: valueOf is overridden and returns 0. 0!=0 is false Also sets Object to Number for next step
x instanceof Object: Object now points to Number and x is an Object not a Number so this resolves to false
typeof x!="object": x is an object so typeof x returns "object". "object"!="object" is false

Good job. instanceof is just something too weak...

@tsh Not hard to break things when one messes with prototypes and reassigns critical global variables.

JavaScript (Node.js), 36 bytes, tsh
1.00000001

Any value near 1 under the rounding threshold will make it.
Try it online!

Wow, love it. although that is not what I want...

R, Rift
expression(T <- 0)

Sets T to a false value. I don't know R, seems to work.
Try it online.

CPython 3.6, by wizzwizz4
lambda *a,main=__import__("__main__"):(exec("""main.bool=lambda:True"""),1/0)

C++, SIGSEGV
0

Segfaults.
Try it online!

C++, ecatmur
Truly the most beautiful code I have ever written.
#include <iostream>

auto killmenow = 0;

struct Tee {
    Tee() { if (killmenow++ > 10) { exit(0); } }
};

auto t = Tee{};

int main() {
    f<Tee &, t>(t);
}

This question really confuses me, ergo the above disaster.
Try it online.

Totally not the intended solution, but absolutely a valid crack.

Swift, Alexander
func ==(lhs: Int, rhs: Int) -> Bool {
    return false
}

Redefine the == operator to always return false. This means that now, 0 works because 0 == 0 is now false, and 0 != 0 is still false
Alternatively, redefine the != operator to always return false so that every integer other than 0 will halt.

Solved, but I have another! It's shorter, too! https://codegolf.stackexchange.com/a/136343/11490

I'm just blown away that this is something you can do. First I've seen a language allow the redefinition of critical operators.

JS, 11bytes / 18bytes
code:
 f=a=>{while(!Array.isArray(a)||!a.length);a.map(_=>{for(;;);})}

cracked (throws no error):
f(Array(5))

cracked (throws error):
 a=[1];a.map=1;f(a)

JavaScript, Step Hen
One input that stops the program is the object literal {valueOf: () => false}:

var f=x=>{while(!(x&&x==false));};
f({valueOf: () => false});
console.log('Done!');

JavaScript, Step Hen
[]

Try it online!

Python 3 (CPython), Veedrac
import gc
gc.set_debug(gc.DEBUG_SAVEALL)
gc.collect()
l(gc.garbage[0])

Try it online!

One man's garbage... (nicely done)

JS, Step Hen
"void 0"

Simple: the 5th char is , the string doesn't have any trailing or leading whitespace, and evaled results in undefined.

How did you know about that :( good job

@programmer5000 http://hyperboleandahalf.blogspot.com/2010/04/alot-is-better-than-you-at-everything.html

Python 3: totallyhuman's post, 143 bytes
def f(o):
 while bool(o)==bool(o):0

# My code starts here

class A:
	def __init__(s):s.a=False
	def __bool__(s):s.a=not s.a;return s.a

f(A())

Try it online!

JavaScript, programmer5000
new Buffer(268435440)

Throws an error when it is coerced into a string.
Try it online!
Got it from this request for better error documentation.

Woah! Nice job!

@programmer5000 thanks :P now go crack mine two newest ones, have fun :P

JS, Step Hen
991

Lots of obfuscation!
Try it online!

How did you unobfuscate this?

@Cowsquack Removed everything except the obfuscated code, than removed the ().

Step Hen :P and @Cowsquack JSF*** decoder

JavaScript (Node.js)
g("13")(13/321)

It works, apparently you can replace 13 with 33, 53, etc

That's not what I had in mind, but good job getting around what I had in mind, because you would never have guessed it :P

Python 2, Foon
Crack or hack? I'm not sure which this is yet...
Windows:
exit()
<ctrl>C

Where <ctrl> is the actual key modifier. This will eval exit() in the first pass of the loop and catch the keyboard interrupt in the second. quit will work in place of exit too.
(Nix replace <ctrl>C with <ctrl>D ?)

Python 3.5, Siphor
"\r def t():pass"

Calling f("\r def t():pass") will redefine the "inner" t to a function that does nothing prior to it being created inside the "outer" t.

R Jarko Dubbeldam

f=function(x)while(1)if(length(x))grep(x,'')

Fails with a function argument, e.g.,
f(mean)
# Error in as.character(pattern) :
  cannot coerce type 'closure' to vector of type 'character'

Try it online!

anyfix, Mayube
-5

Easy enough once you learn the neat language. Basically once you make 0 from the addition, the rest is fluff.
Try it online.

JavaScript by w0lf
Object(NaN)

Another crack, more elegant way.

Python 3, Magenta
def f(x):
 y=str(x)
 while not(x and(y[-1]+y[:-1])==str(2*x)):a=1

The trick is to find a number x which when multiplied by two is equal to itself when all the digits are shifted to the right, with wrapping.
Isaacg found the first number for which this works (105263157894736842), and using the same pattern, I found a bunch more inputs: 210526315789473684, 421052631578947368, 315789473684210526 all work.
Because I didn't make the original crack, and @Isaacg hasnt posted this yet, I made this as CW.
Note that these numbers are formed from the decimal expansion of 1/19.

R, Jarko Dubbeldam
expression(quit())

Try it online.

Nice, indeed the intended solution.

Python, Sudo Bash
import signal

class x:
    @property
    def x(self):
        signal.alarm(1)
    def __str__(self):
        return 'x.x'

Python 3 by Veedrac
A single 0xff byte for UTF-8, or anything else that cannot be decoded by the selected encoding.
Try it online!

Python 3.5, Siphor
'yield'

TIO

Python, Alex Hall
"%307d"%1

This creates a truthy string consisting of 306 spaces followed by 1.

Python, by veedrac
import sys;sys.settrace(-1)

The -1 can be replaced with any other non-callable object

Well, that was fast.

Was this the intended solution?

Yep, this was it.

I've done far worse things with sys.setprofile and sys.settrace

Python 2, Alex Hall
__builtin__,True,

Try it online!
We override True to the empty string, which is falsy.

Well done. That was the intended solution.

Python 3, Alex Hall
eval(input())
__import__("os")._exit(0)

Try it online!
Clearly not the intended answer. Bypasses the length limit by evaluating the input.

Batch, SteveFest
Just undo the quote.
"&&exit

(with a trailing )
Another unintended solution:
"|exit

Well done! Although this is not me intended solution

I will add the link to here shortly

C (gcc), dj0wns
%s12345678

Try it Online!
Since c is only defined as an 8 ('\b') character array and the fgets is passed a second argument of 12 ('\f') longer strings begin to corrupt d which is located after c on the stack.  Adding enough characters will cause the snprintf to segfault when it tries to reference the pointer d which has been corrupted

Yay! You found it!

I wanted to find a way to make a buffer overflow non-obvious so my misdirection added alternate solutions sadly.

Python 3, Alex Hall
1<<1017

Try it online!

05AB1E, MilkyWay90
1

TIO
Pretty easy one, all I had to do was look up the command list for the language.

Yeah, my one was easy to crack.

@MilkyWay90 Nothing wrong with that, either.

Okay, thank you! I have another answer that you could crack (A BrainF one)

@MilkyWay90 I don't know anything about--

Oh, okay. I didn't know anything about it until today so...

My comment terminated early because I'd solved it mid-sentence.

Let us continue this discussion in chat.

Javascript, cracks Ethertyte's answer
f(eval('delete Object.prototype.hasOwnProperty'))

Try it online!
I can't believe I didn't think of this earlier.

Python 3, cracks hakr14's challenge
class x():
 def __init__(s):
  global isinstance
  isinstance=lambda x,y:0

f(x())

Try it online!
Simply replaces isinstance with a lambda returning 0, causing the isinstance call to always return 0, instantly exiting the loop.

Python 3, Makonede
class A:
    def __eq__(self, x):
        exit()

f(A())

Try it online!
The solution checks if x == x, and then loops while a or not a. This is always truthy. You cannot override the logical NOT operator so there is no way for this to be falsy. However, you can just input a custom object that exits the program when it is checked with == so the function is still called and runs but exits before it can hit the infinite loops.

"there is no way for this to be falsy" your statement is falsy lol

@Makonede oh. lol, that's smart

@Makonede an object which switches state when observed... who needs quantum computing when you have magic methods?

@hakr14 i know. magical

JavaScript (ES6), programmer5000
"Infinity"

The condition first tests if the input has a .slice method (aka if it's a string or an array) and gets the absolute value of the numeric representation of the string/array. This is then added to 0 and checked against Infinity.
Try it online!

:( I thought mine would last longer! Nice Job!

@programmer5000 thanks :)

[Infinity] also works.

@w0lf also ["Infinity"]

Add++, caird coinheringaahing
The empty input. The answer is pretty pointless, since it never runs in an infinite loop.
Try it online!

Braingolf, Mayube
Answer
163

Code explanation:
1+[#£-0!e>:$_1>|]

1+                  # Add 1 to the input
  [             ]   # While bottom of the stack > 0..
   #£               #   Push 163
     -              #   Subtract from the input
      0             #   Push 0
       !            #   Peek top of the stack
        e           #   If greater than zero, do..
         >          #     Rotate the stack one to the right
          :         #   Else..
           $_       #     Discard top of the stack
             1      #     Push
              >     #     Rotate the stack one to the right
               |    #   End ifelse

Which results in outputting 0.
Try it online!

Woop! You got it!
Fyi 163 is the Unicode codepoint of £

@Mayube Yeah, just running #£ alone gave it a bit away :p.

Darn! I actually tested 163 as an argument and it didn't work at all!

@EriktheOutgolfer then you did something wrong, it's taken as an argument

@Mayube I just passed in 163...maybe I saw something wrong.

Also @Adnan It really warms my heart to see somebody else understand braingolf enough to be able to post their own char-by-char explanation <3

Although quick correction, [] loops check the bottom of the stack, not the top

@Mayube Thanks, it has been corrected.

JavaScript (Babel Node), programmer5000
new Set() was posted as a crack but didn't work for me (Try it online!), so I made one that doesn't throw, but does create a TypeError.
let f=x=>{while(x+"h");}

class Halt {
    toString() {
	return {}
    }
}
f(new Halt())

Try it online!
P.S. The solution I really wanted was to negate the charCode somehow and be errorless but I couldn't get that to not resolve to concatenation. :)
EDIT: An more modern alternative:
f( {
    [Symbol.toPrimitive] (hint) {
        return {}
    }
} )

Good, but still not desired!

So there's an error-free solution?

A solution that doesn't use throw.

JavaScript (browser), tsh
document.all

I started trying falsy values. document.all did the job.

R, Jarko Dubbeldam
it's my first time that I participated at something like this... hope i got it right.
.Internal(.invokeRestart(list(NULL, NULL), NULL))

Try it online!

I guess that's the intended solution. f(quit()) would also work

This is not really a crack. Both this solution and @Rift quit before (or regardless of) evaluating the function.

Both solutions are evaluated in the function body.

CPython 3.6, by wizzwizz4
1/0

Almost certainly not the intended solution, but it works

Befunge 93, Dopapp
<

The code calculates (ord(input) - 3*4*5) / 0 = (ord(input) - 60) / 0, which gives Infinity or -Infinity for any ascii value ≠60 and NaN for ascii value 60 (<) on the linked interpreter. The part #v_@ only terminates if the top value of the stack is falsy, which is only the case for NaN.

JavaScript (ES7), Step Hen
I've found 5 solutions that work, so far:
[]

new Array()

Array.prototype

String.prototype

Number.prototype

Strangely, Object.prototype doesn't work.

Oh, I completely forgot that that is basically the same as my intended solution. I'd love for you to figure out why though :P it's a really weird perk of floats I just discovered

I'll come back to it in the morning, @StepHen; I'm about to pack up for the day.

I'll tell you why. Check Boolean(input) and Number(input) for each of those as input. The "weird perk of floats" is that the exponentiation operator ** will convert any left operand, even something that coerces to NaN, into 1 if the right operand coerces to 0. Since Number(Object.prototype) is NaN and not 0 like the rest of the working inputs, it will not work.

JavaScript (Node.js), Step Hen
Array(4) works because it is creating an empty array of size 4 and the string representation of that is ,,,.
Try it online!

Java 8, Socratic Phoenix
These anonymous class answers are getting a bit overdone, but it works and I have no shame.
import java.util.ArrayList;

// ...

new ArrayList<Object>() {
    public boolean isEmpty() {
        boolean ret = !super.isEmpty();
        add(new Object());
        return ret;
    }
}

You can avoid the import if you're patient enough to build out all the List methods. I'm not.
Try it online.

Node.JS, programmer5000
x = {}
x.constructor = false
f(x)

We define an object where x.constructor is false so it terminates immediately
TIO

Python 3, Erik Brody Dreyer
While error raising cracks are 10 a penny, a simple non-erroring one is just 88 zeros in a row:
def fun(n):
while not (int(n[17]+n[:17])==2*int(n[:18]) and int(n[45]+n[18:45])==3*int(n[18:46]) and int(n[87]+n[46:87])==5*int(n[46:88])):
    print("Ha")
fun("0"*88)
print("halted and did not error")

Try it online!

JavaScript (Node.js), programmer5000
Object.defineProperty(a={},"__proto__",{value:false,writable:false})

Try it online!
Simple enough. A truthy object who's __proto__ is defined to be false permanently.

JavaScript (Node.js) by Alex Varga
({toString(){return this.t--;},t:1})

Try it online!

yep. golfed a little: {valueOf:()=>this.q?0:this.q=1}

R, Gregor
expression(set.seed(5))

Similar principle to my other R answer. Seems to work.
Try it online.

R, Jarko Dubbeldam
just break out of the while loop
expression(break)

JavaScript, Birjolaxew
new Proxy({},{get(){throw''}})

SmallTalk, Yimin Rong
1086

I should have trusted him.

JavaScript, Birjolaxew
Object.freeze({[Symbol.toPrimitive]() { raise; }})

raise isn't a JS keyword, you might be looking for throw

@SuperStormer Doesn't matter anyway :P.

JavaScript (ES7), iovoid
46474849

WolframAlpha made the calcs trivial.

Python3, by AlexHall
Probably not what OP had in mind:
help.__doc__

Here's a test on my system:
Python 3.6.0 |Anaconda 4.3.1 (64-bit)| (default, Dec 23 2016, 12:22:00)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
>>> s = "help.__doc__"
>>> len(s)
12
>>> eval(s)
"Define the builtin 'help'.\n\n    This is a wrapper around pydoc.help that provides a helpful message\n    when 'help' is typed at the Python interactive prompt.\n\n    Calling help() at the Python prompt starts an interactive help session.\n    Calling help(thing) prints help for the python object 'thing'.\n    "
>>> len(eval(s))
307

It doesn't work with Python2 on my system.

BrainF, MilkyWay90
0
I brute forced this one. My first guess was correct. And two subsequent inputs to make sure I was right.
Oops?

Never thought about bruteforcing, actually.

JavaScript (Node.js), programmer5000
null

! > Will cause an error "TypeError: Cannot read property 'constructor' of null".
undefined also works.

JavaScript (Node.js)
I've done some research, and find out that JavaScript that only uses ()[]+! is called JSFuck. With the help of JScrewIt and JS Minify, I've found the solution:
"[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]][([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+([][[]]+[])[+!![]]+(![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+(!![]+[])[+!![]]]((!![]+[])[+!![]]+(!![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+(![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+[+[]]]+(!![]+[])[!![]+!![]+!![]]+([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+[!![]+!![]+!![]]]+(![]+[])[+!![]]+(![]+[])[!![]+!![]])()(([]+[])[(![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+([][[]]+[])[+!![]]+(!![]+[])[+[]]+([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+(!![]+[])[+!![]]]()[+!![]+[!![]+!![]]]+(+[![]]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]][([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+([][[]]+[])[+!![]]+(![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+(!![]+[])[+!![]]]((!![]+[])[+!![]]+(!![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+(!![]+[])[(![]+[])[!![]+!![]+!![]]+([][[]]+[])[+[]]+([][(!![]+[])[!![]+!![]+!![]]+([][[]]+[])[+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([![]]+[][[]])[+!![]+[+[]]]+(!![]+[])[!![]+!![]+!![]]+(![]+[])[!![]+!![]+!![]]]()+[])[!![]+!![]]]()[+!![]+[+[]]]+![]+(!![]+[])[(![]+[])[!![]+!![]+!![]]+([][[]]+[])[+[]]+([][(!![]+[])[!![]+!![]+!![]]+([][[]]+[])[+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([![]]+[][[]])[+!![]+[+[]]]+(!![]+[])[!![]+!![]+!![]]+(![]+[])[!![]+!![]+!![]]]()+[])[!![]+!![]]]()[+!![]+[+[]]])()[([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+([][[]]+[])[+!![]]+(![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+(!![]+[])[+!![]]](([]+[])[(![]+[])[!![]+!![]+!![]]+([][[]]+[])[+[]]+([][(!![]+[])[!![]+!![]+!![]]+([][[]]+[])[+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([![]]+[][[]])[+!![]+[+[]]]+(!![]+[])[!![]+!![]+!![]]+(![]+[])[!![]+!![]+!![]]]()+[])[!![]+!![]]]()))[+!![]+[+[]]]+([][[]]+[])[+[]]+(!![]+!![]+[])+(!![]+!![]+!![]+!![]+!![]+!![]+[])+(+[]+[])+(!![]+!![]+!![]+!![]+!![]+!![]+[])+([]+[])[(![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+([][[]]+[])[+!![]]+(!![]+[])[+[]]+([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+(!![]+[])[+!![]]]()[+!![]+[!![]+!![]]])+(([]+[]+[]+[]+[]+[]+[]+[]+[]+[]))"

Try it online!
Explanation
[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]][([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+([][[]]+[])[+!![]]+(![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+(!![]+[])[+!![]]]((!![]+[])[+!![]]+(!![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+(![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+[+[]]]+(!![]+[])[!![]+!![]+!![]]+([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+[!![]+!![]+!![]]]+(![]+[])[+!![]]+(![]+[])[!![]+!![]])()( // eval function, copied from https://jscrew.it/ with only Node.js support
                                                                                // '"'
    ([]+[])[                                                                                // ''['fontcolor']() == ''
        (![]+[])[+[]]+                                                                                // f
        (!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+              // o
        ([][[]]+[])[+!![]]+                                                                                // n
        (!![]+[])[+[]]+                                                                                // t
        ([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+             // c
        (!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+              // o
        (![]+[])[!![]+!![]]+                                                                                // l
        (!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+              // o
        (!![]+[])[+!![]]                                                                                // r
    ]()[                                                                                // ''['fontcolor']()['12'] == 'u'
        +!![]+                                                                                // 1
        [!![]+!![]]                                                                                // 2
    ]+
    (                                                                                // '\\'
        +[![]]+                                                                                // NaN
        [][                                                                                // []['fill']
            (![]+[])[+[]]+                                                                                // f
            ([![]]+[][[]])[+!![]+[+[]]]+                                                                                // i
            (![]+[])[!![]+!![]]+                                                                                // l
            (![]+[])[!![]+!![]]                                                                                // l
        ][                                                                                // []['fill']['constructor']
            ([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+         // c
            (!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+          // o
            ([][[]]+[])[+!![]]+                                                                                // n
            (![]+[])[!![]+!![]+!![]]+                                                                                // s
            (!![]+[])[+[]]+                                                                                // t
            (!![]+[])[+!![]]+                                                                                // r
            ([][[]]+[])[+[]]+                                                                                // u
            ([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+         // c
            (!![]+[])[+[]]+                                                                                // t
            (!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+          // o
            (!![]+[])[+!![]]                                                                                // r
        ](                                                                                // []['fill']['constructor']('return/false/')() == /false/
            (!![]+[])[+!![]]+                                                                                // r
            (!![]+[])[!![]+!![]+!![]]+                                                                                // e
            (!![]+[])[+[]]+                                                                                // t
            ([][[]]+[])[+[]]+                                                                                // u
            (!![]+[])[+!![]]+                                                                                // r
            ([][[]]+[])[+!![]]+                                                                                // n
                                                                                // /
            (!![]+[])[                                                                                // 'true'['sub']() == 'true'
                (![]+[])[!![]+!![]+!![]]+                                                                                // s
                ([][[]]+[])[+[]]+                                                                                // u
                (                                                                                // b
                    [][                                                                                // []['entries']
                        (!![]+[])[!![]+!![]+!![]]+                                                                                // e
                        ([][[]]+[])[+!![]]+                                                                                // n
                        (!![]+[])[+[]]+                                                                                // t
                        (!![]+[])[+!![]]+                                                                                // r
                        ([![]]+[][[]])[+!![]+[+[]]]+                                                                                // i
                        (!![]+[])[!![]+!![]+!![]]+                                                                                // e
                        (![]+[])[!![]+!![]+!![]]                                                                                // s
                    ]()+                                                                                // []['entries']() == Object [Array Iterator] {}
                    []                                                                                // []['entries']() + [] == '[object Array Iterator]'
                )[!![]+!![]]                                                                                // '[object Array Iterator]'[2] == 'b'
            ]()[+!![]+[+[]]]+                                                                                // 'true'[10] == '/'
            ![]+                                                                                // 'false'
            (!![]+[])[                                                                                // / (see above)
                (![]+[])[!![]+!![]+!![]]+
                ([][[]]+[])[+[]]+
                (
                    [][
                        (!![]+[])[!![]+!![]+!![]]+
                        ([][[]]+[])[+!![]]+
                        (!![]+[])[+[]]+
                        (!![]+[])[+!![]]+
                        ([![]]+[][[]])[+!![]+[+[]]]+
                        (!![]+[])[!![]+!![]+!![]]+
                        (![]+[])[!![]+!![]+!![]]
                    ]()
                    +[]
                )[!![]+!![]]
            ]()[+!![]+[+[]]]
        )()[                                                                                // /false/['constructor']
            ([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+         // c
            (!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+          // o
            ([][[]]+[])[+!![]]+                                                                                // n
            (![]+[])[!![]+!![]+!![]]+                                                                                // s
            (!![]+[])[+[]]+                                                                                // t
            (!![]+[])[+!![]]+                                                                                // r
            ([][[]]+[])[+[]]+                                                                                // u
            ([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+         // c
            (!![]+[])[+[]]+                                                                                // t
            (!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+          // o
            (!![]+[])[+!![]]                                                                                // r
        ](                                                                                // /false/['constructor']('') == /<\/sub>/
            ([]+[])[
                (![]+[])[!![]+!![]+!![]]+                                                                                // s
                ([][[]]+[])[+[]]+                                                                                // u
                (                                                                                // b
                    [][
                        (!![]+[])[!![]+!![]+!![]]+
                        ([][[]]+[])[+!![]]+
                        (!![]+[])[+[]]+
                        (!![]+[])[+!![]]+
                        ([![]]+[][[]])[+!![]+[+[]]]+
                        (!![]+[])[!![]+!![]+!![]]+
                        (![]+[])[!![]+!![]+!![]]
                    ]()+[]
                )[!![]+!![]]
            ]()                                                                                // ''
        )
    )[+!![]+[+[]]]+                                                                                // 'NaN/<\\/sub>/'[10] == '\\'
    ([][[]]+[])[+[]]+                                                                                // u
    (!![]+!![]+[])+                                                                                // 2
    (!![]+!![]+!![]+!![]+!![]+!![]+[])+                                                                                // 6
    (+[]+[])+                                                                                // 0
    (!![]+!![]+!![]+!![]+!![]+!![]+[])+                                                                                // 6
    ([]+[])[                                                                                // '"'
        (![]+[])[+[]]+
        (!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+
        ([][[]]+[])[+!![]]+
        (!![]+[])[+[]]+
        ([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+
        (!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+
        (![]+[])[!![]+!![]]+
        (!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+
        (!![]+[])[+!![]]
    ]()[
        +!![]+
        [!![]+!![]]
    ]
)+
(([]+[]+[]+[]+[]+[]+[]+[]+[]+[]))                                                                                // Padding to 4321 characters

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes