New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
printf stops printing after first newline #44
Comments
That @jmattsson . I committed a patch for this into our review queue yesterday, it's a bug in the write syscall. Because everyone's on holidays this week I'm not sure if we'll get the fix merged to github until next week (review policy), but I might be able to pop up a temporary branch. |
Really? I instrumented |
Yeah it's not an obvious bug though., _write_r should return number of bytes written, but doesn't. Stdout is line buffered by default: so the first line gets sent to _write_r & TXed,, _write_r returns zero, newlib discards the rest of the buffer thinking there was an error. Fix is incoming now, should be auto-pushed github shortly... |
Ah, sneaky bug! Glad it was an easy fix though. |
Fix VFS unit test failure ("Open & write & close through VFS passes performance test") Closes #44 See merge request idf/esp-idf!3759
Cherry pixk of bug espressif#7631 See espressif#7631 Co-authored-by: Victor Morales <chipahuac@hotmail.com>
It appears that for some strange reason the regular C
printf()
function stops printing when it encounters the first newline (\n
) in a string. This can be trivially reproduced by attempting to print two lines in the one call; see below for a patch to the official 01_hello_world example.Despite applying the above patch, the output stays at:
If using the
%s
modifier, a newline in the argument string also causesprintf()
to stop outputting characters, effectively cutting short the output. E.g.yields the following output:
The text was updated successfully, but these errors were encountered: