top | item 45510319

What would cause a Python interpreter to crash? A good interview question

5 points| sefk | 4 months ago |sef.kloninger.com

5 comments

order

tkluck|4 months ago

I clicked the link expecting a discussion of what would cause a Python interpreter to crash, but found only a generic list of low level problems for any piece of software, and the statement that the headline was an interview question at YouTube ten years ago.

zahlman|4 months ago

> I remember this leading to a fun, rambling, back-and-forth discussion of the ways computers can fail. There are so many! Every level of the stack can fail in interesting ways: storage, RAM, memory management, networking. How would a bit flip in a TLB manifest? How does TCP/IP detect and handle ordering? collisions?

Sure, but the simplest ways (at least with CPython) are to invoke C code that crashes via the FFI, or to manually explicitly create a code object from invalid bytecode data (or hex-edit a .pyc file so that the usual machinery does it for you).

Also, as usual I'm tired of the implication that networking is a necessary component of "the stack".

sefk|4 months ago

I liked the interview question that I got when interviewing at YouTube in 2015.

Discuss what would cause a Python interpreter to crash. Not a program written in Python, but the interpreter itself.

skylurk|4 months ago

Would this count?

  import ctypes
  ctypes.string_at(0)

samdoesnothing|4 months ago

This seems like an orthogonal question to architecture doesn't it?