23m: round final — DR-trap delivery anomaly under wine threads documented (near-zero stops despite verified arming and confirmed module execution); full stop-logging added to fnexec; roadmap to bit-exact fixed: G-form via stabilized series, consumer via init-family decode or perf_event HW breakpoints, then RT_FIRCONV gate
This commit is contained in:
+22
-2
@@ -74,6 +74,7 @@ def main():
|
||||
print('NO HOST')
|
||||
return 1
|
||||
print('host %d at %.2fs' % (host, time.time() - t0), flush=True)
|
||||
fd = os.open(f'/proc/{host}/mem', os.O_RDONLY)
|
||||
|
||||
# EARLY arm: exec watch on DESIGN bodies (inherited by future clones)
|
||||
fd0 = os.open(f'/proc/{host}/mem', os.O_RDONLY)
|
||||
@@ -127,6 +128,7 @@ def main():
|
||||
print('armed %d/%d tids' % (len(armed), len(seized)), flush=True)
|
||||
|
||||
n0 = n1 = 0
|
||||
STOPLOG=[]
|
||||
samples = []
|
||||
t_end = time.time() + DUR
|
||||
last_sweep = 0.0
|
||||
@@ -151,6 +153,9 @@ def main():
|
||||
time.sleep(0.001)
|
||||
if arm(tid):
|
||||
armed.add(tid)
|
||||
d0=pt(PTRACE_PEEKUSER,tid,DR_BASE)
|
||||
d7=pt(PTRACE_PEEKUSER,tid,DR7_OFF)
|
||||
print(' tid %d dr0=%#x dr7=%#x'%(tid,d0 or 0,d7 or 0),flush=True)
|
||||
try:
|
||||
pt(PTRACE_CONT, tid, 0, 0)
|
||||
except OSError:
|
||||
@@ -162,6 +167,21 @@ def main():
|
||||
if pid == 0:
|
||||
time.sleep(0.0004)
|
||||
continue
|
||||
ent=[round(time.time()-t0,3), pid, hex(status)]
|
||||
if os.WIFSTOPPED(pid) and (status>>8)==5:
|
||||
rg=UserRegs()
|
||||
if pt(PTRACE_GETREGS,pid,0,ctypes.addressof(rg)) is not None:
|
||||
ent+= [rg.rip, pt(PTRACE_PEEKUSER,pid,DR_BASE+48)]
|
||||
# auto-dump arrays on design hits
|
||||
if rg.rip in (0x1802A24C0,0x1802FA420):
|
||||
def dmp(ptr):
|
||||
try:
|
||||
b=os.pread(fd,2049*4,ptr)
|
||||
return np.frombuffer(b,dtype='<f4').astype(np.float32).tolist()
|
||||
except OSError: return []
|
||||
ent.append({'rcx':rg.rcx,'rdx':rg.rdx,
|
||||
'in':dmp(rg.rcx),'out':dmp(rg.rdx)})
|
||||
STOPLOG.append(ent)
|
||||
sig = status >> 8
|
||||
if os.WIFEXITED(status) or os.WIFSIGNALED(status):
|
||||
continue
|
||||
@@ -222,8 +242,8 @@ def main():
|
||||
print('hits: 529fe0=%d loop=%d render_fresh=%s armed=%d/%d'
|
||||
% (n0, n1, fresh, len(armed), len(seized)))
|
||||
import json
|
||||
json.dump(samples[:300], open('/tmp/opencode/fnexec/hits.json', 'w'),
|
||||
indent=1, default=str)
|
||||
json.dump(dict(samples=samples[:300], stops=STOPLOG[:4000]),
|
||||
open('/tmp/opencode/fnexec/hits.json', 'w'), indent=1, default=str)
|
||||
proc.kill()
|
||||
return 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user