Commit graph

12 commits

Author SHA1 Message Date
Florian Märkl
a72a275ca2
Fix deadlock in rz_th_queue_close_when_empty() (#6383)
empty_cond was never signalled and the termination depended only on
the timeout in rz_th_queue_close_when_empty() causing a re-check of
emptiness.
However, the rz_th_cond_timed_wait() implementation, which was used
there, was flawed because it expected a relative timeout but passed that
directly to pthread_cond_timedwait() which expected an absolute time
value, practically causing it to time out immediately. Depending on the
pthread_cond implementation, this possibly created a situation where the
mutex could never be acquired by another thread, effectively causing a
deadlock. This behavior was observed on Mac OS X 10.5 (ppc) when running
the test_core_bin test.
We solve this by not using a timeout at all and signalling the condition
variable for all waiting threads at the appropriate time.
2026-05-25 09:25:29 +02:00
Arya H R
a6edb4ecc5
Fix various Coverity findings (#5668) 2025-12-30 02:02:56 +08:00
Giovanni
0a0e6c0b88
Optimize queue to act also as proper channel (#5627) 2025-12-20 00:40:13 +08:00
wargio
c613ac3b70 Revert back only the changes for the threads code and ignores rz-test 2024-06-02 18:11:06 +08:00
Khairul Azhar Kasmiran
7b91fb69c2
Revert #4506 (#4519) 2024-05-27 21:50:58 +08:00
Giovanni
d19fc9d0d8
Add N_THREAD_LIMIT to limit the max number of threads (upper limit). (#4510) 2024-05-24 16:12:08 +08:00
Giovanni
a060e3beb5
Add rz_th_queue_from_pvector to initialize a queue from a pvector (#4069)
* Add rz_th_queue_from_pvector to initialize a queue from a pvector
* Rename methods to create queue.
2024-01-05 21:40:25 +08:00
Giovanni
ccbfe57b68
Allow to cancel and to print progress of the current diffing job (#4051) 2023-12-29 14:25:38 +08:00
Giovanni
5789f6557e
Threaded analysis matching (#3090) 2022-10-24 00:40:42 +02:00
Giovanni
6654fa7a58
Allow RzThreadQueue to be initialized with a list (#3039) 2022-09-20 07:05:57 +08:00
Dean
59b38e6efa
Add /*<type>*/ comments everywhere (#2986)
Adds /*<type>*/ comments and a linter check from rz-bindgen to enforce
their existence and consistency

Also includes the following fixes made when adding the annotations:
* removed unused intern_table arguments in pyc_dis.c, pyc_dis.h, asm_pyc.c
* removed unused classes argument from place_nodes in agraph.c
* removed unused recurse and recurse_bb functions in canalysis.c
* removed unused vars field from RzPrint struct
* removed unused RzAnalysisType* structs from rz_analysis.h
* removed unused list field from RzEgg struct
* fixed bug in bp_plugin.c where duplication-checking logic iterates over the wrong list
* removed unused q_regs field from RzDebug struct
* removed unused backtrace field from RzDebugPlugin struct
* removed unused classes_list field from RzBinNXOObj struct
* removed unused methods_list and classes_list fields from RzBinZimgObj struct
2022-09-11 13:04:53 +08:00
Giovanni
a988941bf2
Refactor thread code and add RzThreadQueue (#2683)
* Kill the thread only if is alive.
* Remove rz_th_lock_guard.
* Use rz_sys_usleep since pthread_yield/sched_yield are not portable.
* Kill threads only on error.
* Avoid killing already-dead threads.
* RzThreadFunction now returns void* and added test_thread_queue.
* Removed pthread_exit
2022-06-19 21:07:13 +08:00