radareorg / radare2-r2pipe

Access radare2 via pipe from any programming language!
390 stars 99 forks source link

(Dotnet) Infinite loop in RunCommand; StandardOutput always returns 0xFFFF #80

Closed benhall-7 closed 5 years ago

benhall-7 commented 6 years ago

Example code where it hangs (the exact file I have it open doesn't matter, the issue persists no matter what I choose): https://gist.github.com/BenHall-7/5cb97c1f7d4e3453b7e8cfbba301ceef And of course the files I choose open fine in regular r2.

The r2pipe commit I'm using is the current one (#399), but I'm not sure how up to date my build of radare2 is. It's from only a few months ago at most (maybe that presents an issue, but I figure there's something else I'm missing that causes this).

Some more details from the situation: when StandardInput is written to (the command "i" in this case) it does manage to write that value to the buffer, however after Flush is called those values are still there, and I'm not sure if that's part of the issue. The BaseStream of StandardOutput however has the underlying buffer set to null and a lot of fields throw exceptions. image

This might not necesarily be an issue with the code on this respository per-se, but I've run out of ideas to try and fix this and I'm hoping someone else can identify a possible cause