Description
Steps to reproduce: clone this branch: https://github.com/micropython/micropython-lib/tree/asyncio . Install all modules with "make install". Cd to asyncio/ and run test_http_client.py. You will get segfault or with low probability dump error message about line 67:
self.add_reader(ret.obj.fileno(), lambda f: self.call_soon(cb, f), ret.obj)
As can be seen, it's lambda with free variables.
Going to gdb, segfault deterministically happens at the same place for a given build, given Python source, and given heap size. But varying any of these params make segfault shift (and be again 100% reproducible).
I initially was sure it's cell containing NULL and being derefenced 0 specifically, free var cell. However, while cleaning up code a bit for this report, it's no longer so obvious. But I'm still think that's it. (And again, we need to add bytecode execution tracing code).
All this happens on 32 bit. Caveat: some of dependencies (select.epoll) may not work immediately on 64 bit.