Closed zargony closed 7 years ago
Nice timing, I just ran into this one this morning. Honestly I'm kinda floored by write_all() just unsafe stuffing the return value into a slice length without validating it. Maybe I'll PR a fix later.
@zargony wait until you hear why gdb returns -1 for writes to stdout. I'm about to file another issue. :)
If
syscall!
fails and returns -1 insidewrite_all
, it crashes because the write_all loop still tries to calculate the new buffer offset. Maybesyscall!
should returnisize
(orc_int
?). Gdb seems to report back -1 if a hostio call fails (just like libc does on the host).For some reason all writes to stdout fail for me (syscall returning -1), while stderr works fine. (SAM3X, black magic probe 1.6, gdb 7.10.1, rustc nightly 2017-05-01)