esp-idf/tools
Frantisek Hrbata 6406620712 fix(debug_ext): CTRL+C handling while waiting on gdb process
idf.py spawns gdb process within a thread and uses Thread.join() to wait
for the gdb process to finish. As CTRL+C(SIGINT) is used by gdb to interrupt the
running program, we catch the SIGINT while waiting on the gdb to finish,
and try Thread.join() again.

With cpython's commit

	commit a22be4943c119fecf5433d999227ff78fc2e5741
	Author: Victor Stinner <vstinner@python.org>
	Date:   Mon Sep 27 14:20:31 2021 +0200

	    bpo-45274: Fix Thread._wait_for_tstate_lock() race condition (GH-28532)

this logic doesn't work anymore, because cpython internally marks the
thread as stopped when join() is interrupted with an exception. IMHO
this is broken in cpython and there is a bug report about this
https://github.com/python/cpython/issues/90882. Problem is that
waiting on a thread to finish is based on acquiring a lock. Meaning
join() is waiting on _tstate_lock. If this wait is interrupted, the
above referenced commit adds a logic that checks if the lock is help,
meaning the thread is done and marks the thread as stopped. But there is
no way to tell if the lock was acquired by us running join() or if it's
held by someone else e.g. still by the thread bootstrap code. Meaning
the thread is still running.

I may be missing something, but I don't see any reason why to spawn gdb
process within a thread. This change removes the thread and spawns gdb
directly. Instead waiting on a thread, we wait on the process to finish,
replacing join() with wait() and avoiding this problem.

Closes https://github.com/espressif/esp-idf/issues/11871

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2023-07-21 12:37:19 +02:00
..
ble feat: add requirements.ttfw.txt 2022-08-01 15:52:21 +08:00
catch Whitespace: Automated whitespace fixes (large commit) 2020-11-11 07:36:35 +00:00
ci fix(tools/python_dep_check): replace deprecated pkg_resources with importlib 2023-07-14 14:16:10 +02:00
cmake build system: more accurate error information for git_describe 2023-07-10 11:31:32 +08:00
docker tools: Docker: add build-essentials needed for linux targets 2023-02-28 11:27:25 +01:00
esp_app_trace sys_view: upgrade to version 3.32 2023-01-24 00:26:58 +07:00
esp_prov ci(esp_prov): remove import future usage 2023-07-19 14:03:12 +08:00
gen_soc_caps_kconfig build-system: include soc_caps defines into kconfig 2021-12-06 12:37:07 +08:00
idf_py_actions fix(debug_ext): CTRL+C handling while waiting on gdb process 2023-07-21 12:37:19 +02:00
kconfig_new tools: Move out kconfig_new in favour of using the esp-idf-kconfig package 2022-11-15 21:19:51 +01:00
ldgen fix: Compatibility with pyparsing>=3.1.0 2023-06-25 19:59:13 +02:00
mass_mfg tools: remove the dependency on the future package 2022-08-09 16:46:58 +02:00
mocks [tcp_transport] - Adds Socks4 proxy transport 2023-03-27 14:46:40 +02:00
requirements fix(tools/python_dep_check): replace deprecated pkg_resources with importlib 2023-07-14 14:16:10 +02:00
templates/sample_component add new command to idf 2020-09-21 23:38:52 +02:00
test_apps esp_netif: Make esp_netif_receive() return value configurable 2023-07-07 13:56:13 +02:00
test_build_system tools: do not disable pytest-embedded 2023-06-14 12:42:50 +02:00
test_idf_py hints: add a more complete description for component not found errors 2022-12-06 10:54:44 +08:00
test_idf_tools ci: add dep check_python_dependencies.pyt test 2023-03-17 15:22:33 +01:00
test_mkdfu mkdfu.py: Support setting flash parameters 2022-05-27 15:44:56 +02:00
test_mkuf2 idf.py: Change copyright in tools dir 2022-05-24 14:01:50 +02:00
test_sbom tools: add sbom information for submodules 2023-06-14 12:38:12 +02:00
unit-test-app Merge branch 'refactor/driver_ut_to_test_app_v5.1' into 'release/v5.1' 2023-05-18 16:18:26 +08:00
check_python_dependencies.py fix(tools/python_dep_check): replace deprecated pkg_resources with importlib 2023-07-14 14:16:10 +02:00
check_term.py check_term: allow alacritty term 2022-05-19 11:10:59 +08:00
detect_python.fish Tools: Use default value in the Python detections scripts 2022-03-11 11:00:31 +01:00
detect_python.sh Tools: Use default value in the Python detections scripts 2022-03-11 11:00:31 +01:00
eclipse-code-style.xml tools: add code formatter rules for Eclipse 2016-11-03 18:41:00 +08:00
format-minimal.sh global: use '/usr/bin/env bash' instead of '/usr/bin/bash' in shebangs 2020-04-03 01:10:02 +02:00
format.sh global: use '/usr/bin/env bash' instead of '/usr/bin/bash' in shebangs 2020-04-03 01:10:02 +02:00
gdb_panic_server.py esp32h4: removed esp32h4 related codes 2023-04-26 18:53:12 +08:00
gen_esp_err_to_name.py tool: skip test folder when generating esp_err_t table 2022-11-10 10:37:59 +08:00
generate_debug_prefix_map.py build: create BUILD_DIR/prefix_map_gdbinit when enable reproducible build 2021-10-26 10:55:00 +08:00
idf_monitor.py feat(idf_monitor): move idf_monitor to separate repo 2023-02-03 11:20:15 +01:00
idf_size.py tools: Move out idf_size.py in favour of using the esp-idf-size package 2023-03-27 19:40:33 +02:00
idf_tools.py build system: fix init.bat crash in windows when folder contains unicode characters 2023-07-10 11:33:01 +08:00
idf.py Tools bugfix: Removed working directory when using idf.py 2023-06-09 14:24:29 +02:00
install_util.py Tools: --disable-* argument for removing features 2022-06-30 12:31:59 +02:00
mkdfu.py tools: remove the dependency on the future package 2022-08-09 16:46:58 +02:00
mkuf2.py Merge branch 'fix/flake8_v5_warnings' into 'master' 2022-08-12 23:27:14 +08:00
python_version_checker.py Tools: Fix silent failure about the incompatible Python 2022-02-16 18:44:13 +01:00
requirements_schema.json Tools: Make easier the detection of the list of Python features 2022-02-03 19:02:14 +01:00
requirements.json feat: add requirements.ttfw.txt 2022-08-01 15:52:21 +08:00
set-submodules-to-github.sh global: use '/usr/bin/env bash' instead of '/usr/bin/bash' in shebangs 2020-04-03 01:10:02 +02:00
split_paths_by_spaces.py tools: fixup version references related to paths with spaces 2022-05-02 19:05:47 +02:00
tools_schema.json tools: add esp-rom-elfs version '20220823' 2022-09-21 22:39:03 +04:00
tools.json tools: add ULP toolchain for linux-i686 platform 2023-06-13 12:50:04 +07:00