radareorg / radare2

UNIX-like reverse engineering framework and command-line toolset
https://www.radare.org/
GNU Lesser General Public License v3.0
19.71k stars 2.94k forks source link

Fix concurrency issue ##test #22851

Closed kyufie closed 4 weeks ago

kyufie commented 4 weeks ago

Description

There's a bit of a problem with r2r on Android aarch64.

$ r2r test/db/asm
INFO: Running from /data/data/com.termux/files/home/project/radare2/test
Already up to date.
Loaded 10298 tests.
INFO: Skipping json tests because jq is not available
[41/10298]                 41 OK         0 BR        0 XX        0 FXFORTIFY: pthread_mutex_unlock called on a destroyed mutex (0xb400007303ff884c)
[1]    6672 abort      r2r test/db/asm

This patch makes sure that sigchild thread will fire a signal to the subprocess wait func only after it has done with the lock.

Also a small fix about unlocking an unlocked lock.

trufae commented 4 weeks ago

Good catch!