[issue39776] PyContextVar_Get(): crash due to race condition in updating tstate->id

2020-03-04 Thread Evgeny Boytsov
Evgeny Boytsov added the comment: I checked both my test example and real production code with your patch. I'm unable to reproduce the bug, so I think it is fixed now. Thank you! -- ___ Python tracker <https://bugs.python.org/is

[issue39776] Crash in decimal module in heavy-multithreaded scenario

2020-02-28 Thread Evgeny Boytsov
Evgeny Boytsov added the comment: Also I understood the source of your crash with my initial example. Since you haven't used CMake to configure project, pybind didn't setup required macroses to enable threading support. So no issues

[issue39776] Crash in decimal module in heavy-multithreaded scenario

2020-02-28 Thread Evgeny Boytsov
Evgeny Boytsov added the comment: I rewrote my example without pybind and eliminated C++ module (I realized that time.sleep() also releases the GIL, so we achieve the same effect). Still the same results: with python 3.7.3 app crashes with attached ASAN output, with python 3.7.3 without

[issue39776] Crash in decimal module in heavy-multithreaded scenario

2020-02-28 Thread Evgeny Boytsov
Evgeny Boytsov added the comment: Your callstack is very strange. At line 30 of main.cpp GIL is obviously locked: // importing module in this tread gstate = PyGILState_Ensure(); py::module crash_test = py::module::import( "crash_test" ); <-- import PyGILState_Re

[issue39776] Crash in decimal module in heavy-multithreaded scenario

2020-02-27 Thread Evgeny Boytsov
Evgeny Boytsov added the comment: I'am unable to reproduce neither my or your issues with python 3.6. The program runs infinitely as it meant to be. Can you please give me C++ traceback from the core dump, which was created when you ran my pr

[issue39776] Crash in decimal module in heavy-multithreaded scenario

2020-02-27 Thread Evgeny Boytsov
Evgeny Boytsov added the comment: Thank you for feedback. I will try to reproduce the issue with 3.6. By the way, haven't you used gdb with python pretty-printers enabled to examine the state of the program? I've got the same error message, then I breaked the execution in debugger

[issue39776] Crash in decimal module in heavy-multithreaded scenario

2020-02-27 Thread Evgeny Boytsov
Evgeny Boytsov added the comment: Please note, that UnlockGILandSleep takes GIL back before returning. In a real production code there is a database query. In this example I emulate them with random sleep. So I don't see any problems

[issue39776] Crash in decimal module in heavy-multithreaded scenario

2020-02-27 Thread Evgeny Boytsov
New submission from Evgeny Boytsov : Hello everybody! We are using Python 3.7 running at CentOS 7 x64. Python is used as a library to create dynamic extensions for our app server. Some time ago we began to experience crashes in decimal module in some heavy-multithreaded scenarios. After

[issue30929] AttributeErrors after import in multithreaded environment

2017-07-15 Thread Evgeny Boytsov
Evgeny Boytsov added the comment: The same behaviour is reprodusible at ubuntu 16.04 with python 3.5.2. And a colleague of mine said that he was able to reproduce the issue with python 3.6. -- ___ Python tracker <http://bugs.python.org/issue30

[issue30929] AttributeErrors after import in multithreaded environment

2017-07-14 Thread Evgeny Boytsov
New submission from Evgeny Boytsov: Hello everybody! We are using Python 3.4 running at CentOS 7 x64 and experiencing some problems with simulatenous import of modules from different threads of execution. The attached archive contains simple example, which demonstrates the issue. There is