-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Description
Issue description
The exact setup for this to happen seems really bizarre to me, but here it goes: I get a deadlock when using Flask with its default debug app reloader with my pybind11 module. I've reduced the example down to the smallest thing I can think of that still replicates.
The ingredients:
#include <pybind11/functional.h>- A pybind11-bound function that takes a
std::function - A class defined in the module
- A Flask app running with
app.run(debug=True) - A route in that Flask app that calls the function from 2.
What really confuses me is that if I remove the class in step 3, the deadlock goes away. Similarly, if the function in step 2 doesn't take something complicated (like just an int), the deadlock goes away. If the call to run the app is instead just app.run(), the deadlock goes away (similarly if use_reloader=False is passed). Something in the combination of all three of these things causes the deadlock when the passed-in function is invoked. Using a default std::function parameter doesn't seem to change anything.
Versions:
$ python --version
Python 3.6.4
$ gcc --version
gcc (GCC) 7.3.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
pybind11 stable branch (see submodule in reproduction repo)