mirror of
https://github.com/geohot/qira
synced 2025-03-12 18:13:15 +03:00
Merge pull request #240 from korniltsev/thread_leak
kill analysis thread on deletefork
This commit is contained in:
commit
841197e3cd
@ -417,6 +417,7 @@ class Trace:
|
||||
self.strace = []
|
||||
self.mapped = []
|
||||
|
||||
self.keep_analysis_thread = True
|
||||
threading.Thread(target=self.analysis_thread).start()
|
||||
|
||||
def fetch_raw_memory(self, clnum, address, ln):
|
||||
@ -502,8 +503,8 @@ class Trace:
|
||||
self.strace = ret
|
||||
|
||||
def analysis_thread(self):
|
||||
#print "*** started analysis_thread"
|
||||
while 1:
|
||||
print("*** started analysis_thread", self.forknum)
|
||||
while self.keep_analysis_thread:
|
||||
time.sleep(0.2)
|
||||
# so this is done poorly, analysis can be incremental
|
||||
if self.maxclnum == None or self.db.get_maxclnum() != self.maxclnum:
|
||||
@ -527,6 +528,7 @@ class Trace:
|
||||
self.needs_update = True
|
||||
|
||||
#print "analysis is ready"
|
||||
print("*** ended analysis_thread", self.forknum)
|
||||
|
||||
def load_base_memory(self):
|
||||
def get_forkbase_from_log(n):
|
||||
|
@ -146,7 +146,9 @@ def deletefork(forknum):
|
||||
global program
|
||||
print("deletefork", forknum)
|
||||
os.unlink(qira_config.TRACE_FILE_BASE+str(int(forknum)))
|
||||
del program.traces[forknum]
|
||||
if forknum in program.traces:
|
||||
program.traces[forknum].keep_analysis_thread = False
|
||||
del program.traces[forknum]
|
||||
push_updates()
|
||||
|
||||
@socketio.on('doslice', namespace='/qira')
|
||||
|
Loading…
x
Reference in New Issue
Block a user