883 files, from working commit b1a079a. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
26 lines
1.7 KiB
Python
26 lines
1.7 KiB
Python
from pathlib import Path
|
|
import json,sys,tempfile
|
|
sys.path.insert(0,str(Path(__file__).resolve().parents[1]/'ops'))
|
|
from crash_report import analyze
|
|
with tempfile.TemporaryDirectory() as folder:
|
|
p=Path(folder)/'fixture.txt'
|
|
p.write_text('''<Exception.Summary:>
|
|
0xC00000E5 (EXCEPTION_INTERNAL_ERROR) at 0000000140030123
|
|
DBG-ADDR<0000000140030123>("<unknown>")
|
|
</Exception.Summary>
|
|
DBG-MODULE<0000000140000000 00400000 "WowB_loader.dll" "loader.pdb" 0 {}>
|
|
Stack and registers: DO_NOT_EXPORT password=dummy-session-key
|
|
''')
|
|
result=analyze(p)
|
|
assert result['frames'][0]['module']=='WowB_loader.dll' and result['frames'][0]['rva']=='0x30123'
|
|
assert result['fault_location']=={'module':'WowB_loader.dll','rva':'0x30123','pdb_reference':'loader.pdb'}
|
|
assert result['exception_code']=='0xC00000E5' and result['instruction']=='0x140030123'
|
|
assert 'DO_NOT_EXPORT' not in json.dumps(result) and 'dummy-session-key' not in json.dumps(result)
|
|
p.write_text('<Exception.Summary:>\nACCESS_VIOLATION - The instruction at "0x00000001403a74f1" referenced memory.\n</Exception.Summary>')
|
|
assert analyze(p)['exception_code']=='0xC0000005' and analyze(p)['fault_location'] is None
|
|
p.write_text('''<Exception.Summary:>\nACCESS_VIOLATION - The instruction at "0x00007ffffed39583" referenced memory.\nDBG-ADDR<0000000140000123>\n</Exception.Summary>\nDBG-MODULE<00007ffffeb60000 00756000 "d3d11.dll" "" 0 {}>''')
|
|
r=analyze(p)
|
|
assert r['fault_location']==dict(module='d3d11.dll',rva='0x1d9583',pdb_reference='')
|
|
assert r['frames'][0]['module']=='unresolved' # Fault PC and return frames differ.
|
|
print('Crash metadata resolves unknown frames by module ranges and excludes raw memory, registers and secrets.')
|