Closed Bug 1350825 Opened 5 years ago Closed 5 years ago
Printf chops off output - bug in fwrite() call
It looks like it prints partial lines, leaves out characters, whatever. For example: [Codegen# Emitting wasm code [Codegen 0333201c [Codegen 03332020 [Codegen 03332024 [Codegen 03332028 [Codegen# block0 ?:3840206052 [Codegen 1000 [Codegeninstruction WasmParameter [Codegeninstruction Integer [Codegen 0333202c [Codegeninstruction ShiftI:ursh [Codegen 03332030 [Codegeninstruction Integer [Codegen 03332034 [Codegeninstruction ModI [Codegen 03332038 [Codegen 0333203c [Codegen 03332040 [Codegen 03332044 [Codegen 03332048 [Codegen 0333204c Looks more like a generic printf problem than anything else.
This is an old bug that incorrectly checks the return value from fwrite() - depending on your point of view, it should compare to the number of objects written, namely 1, not the number of bytes written, n; or, it should reverse the arguments to fwrite so that it is n objects of size 1 each, and comparing to n is correct. The bug is presumably uncovered by the recent printf rewrite. Bug in vm/Printer.cpp:444.
Assignee: nobody → lhansen
Priority: -- → P1
Summary: ARM disassembler utterly broken (printf broken?) → Printf chops off output - bug in fwrite() call
Change the order of arguments to fwrite, and label them. (Fingering nbp for a review since he wrote/ported the code but really would be nice to just land this asap, so anyone should feel free to jump in...)
Attachment #8851498 - Flags: review?(nicolas.b.pierron)
Attachment #8851498 - Flags: review?(nicolas.b.pierron) → review+
Pushed by email@example.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/571ac5ec20ab get the order of arguments to fwrite right. r=nbp
https://hg.mozilla.org/integration/mozilla-inbound/rev/571ac5ec20ab70db4e71ec81bdb07dd9b294f572 Bug 1350825 - get the order of arguments to fwrite right. r=nbp
You need to log in before you can comment on or make changes to this bug.