compuphase/Black-Magic-Probe-Book

Trace Access Denied - error 122

sidprice opened this issue · 9 comments

I cannot get BMTrace to work (Windows), I see the above error message.

According to winerror.h, code 122 is ERROR_INSUFFICIENT_BUFFER (a data buffer passed to a system call is too small). This might be caused by structure padding.
Has BMTrace worked before, or has it never worked? If it did work before, any idea what changed?

Yes, BMTrace has previously worked, I don't remember any changes, perhaps my target is sending larger amounts of data, perhaps 64 bytes each USB packet

In commit b37136e I added an extra code to the error message, to hopefully pinpoint the problem.

Unfortunately the mingw build fails, the file "usb-support.h" appears to be missing.

Oops, I forgot to add the files to the project before commit. Fixed in commit bbc60b4.

bmtrace_1

Error when running BMTrace.

Hmmm... so now the "access denied" error is magically gone and another error pops up. It feels to me like a memory corruption bug.
You can comment out this particular assertion; it does no harm. However, the situation simply should not occur because it implies that time jumps backward...

I commented out the assertion and BMTrace now works

Commit ffc80c9 has a fix for the bug signalled by the assertion. When multiple trace messages arrive in a single USB packet, the timestamp on the 2nd (and further) was set incorrectly.