Skip to content

Commit dd8f041

Browse files
committed
fixup pending hooks in interrupt handlers
1 parent d14efc8 commit dd8f041

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

pyplugins/apis/kffi.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -605,8 +605,10 @@ def _tramp_interrupt_handler(self):
605605
"""
606606
if not hasattr(self, '_pending_tramp_callbacks') or not self._pending_tramp_callbacks:
607607
return False
608-
while self._pending_tramp_callbacks:
609-
func = self._pending_tramp_callbacks.pop(0)
608+
pending_tramp_callbacks = self._pending_tramp_callbacks[:]
609+
self._pending_tramp_callbacks = []
610+
while pending_tramp_callbacks:
611+
func = pending_tramp_callbacks.pop(0)
610612
tramp_info = yield from self.generate_trampoline()
611613
tramp_id = tramp_info.get("tramp_id")
612614
tramp_addr = tramp_info.get("tramp_addr")

pyplugins/apis/syscalls.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,7 @@ def _syscall_interrupt_handler(self) -> bool:
457457
return False
458458

459459
pending_hooks = self._pending_hooks[:]
460+
self._pending_hooks = []
460461
while pending_hooks:
461462
# Take one item from the queue
462463
hook_config, func = pending_hooks.pop(0)

pyplugins/apis/uprobes.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ def _uprobe_interrupt_handler(self) -> bool:
139139
return False
140140

141141
pending_uprobes = self._pending_uprobes[:]
142+
self._pending_uprobes = []
142143

143144
while pending_uprobes:
144145
uprobe_config, func = pending_uprobes.pop(0)

0 commit comments

Comments
 (0)