What | Removed | Added |
---|---|---|
Status | RESOLVED | REOPENED |
Resolution | FIXED | --- |
(In reply to Jiri Slaby from comment #1) > Created attachment 693723 [details] > potential fix Reopening as this patch is still needed. No matter whether glibc-debuginfo is installed or not, it behaves the same. Important is how the code below is compiled (-g -Og needed). Source: #include <stdio.h> int main(void) { fwrite("a", 1, 1, stdout); fwrite("b", 1, 1, stdout); fwrite("\n", 1, 1, stdout); return 0; } Build: gcc tracer.c -Og -g Without the patch: $ ltrace ./a.out fwrite() = <void> fwrite() = <void> fwrite(ab ) = <void> +++ exited (status 0) +++ With the patch: ltrace ./a.out fwrite("a", 1, 1, 0x7f049ee5b760) = 1 fwrite("b", 1, 1, 0x7f049ee5b760) = 1 fwrite("\n", 1, 1, 0x7f049ee5b760ab ) = 1 +++ exited (status 0) +++ I tried to build with all these flags, but the issue is not reproducible, so Og must enable some more: -fcombine-stack-adjustments -fcompare-elim -fcprop-registers -fdefer-pop -fforward-propagate -fguess-branch-probability -fipa-profile -fipa-pure-const -fipa-reference -fomit-frame-pointer -freorder-blocks -fshrink-wrap -fsplit-wide-types -ftree-builtin-call-dce -ftree-ccp -ftree-coalesce-vars -ftree-copy-prop -ftree-dce -ftree-dominator-opts -ftree-dse -ftree-fre -ftree-ch -ftree-sink -ftree-slsr -ftree-ter