Conversation
So I just fought the weirdest bug in a while: lately #Ghidra provides a #Python scripting interface based on #Jpype (PyGhidra).

I had this script where I thought I fixed a bug by referencing X.y.z instead of X.z. Except nothing changed, the buggy behavior is still there (the file output contains garbage).

I add logging, the logs appear and show everything is fine.

Add more logs, exceptions even (to stop at a specific state). They run and show all is fine.

After I restart Ghidra the bug is gone.

To be clear: there must be some kind of bytecode caching that affects my object reference but does not affect additional logging/exception throwing??

Any ideas?
1
2
1
Theory: the output file got cached and I was looking at old output (which is weird because I only use `with open(...)` blocks)
1
0
0

@buherator if you go

record event into log
error
write log
...
with open ( log )

the new log would not be written?

otherwise it doesn't sound familiar and I would suspect that middle ware thing.

1
0
1
@bmaxv Now that you mention it I *really* start to suspect some fuckery between Ghidra and the filesystem because while I could get _some_ logs to a file these were also highly unreliable (like records just stopped appearing) so I could only rely on logging to Ghidra's console...
0
0
0