Bug 18196 – segmentation fault on "fwrite" on any system with glibc-core-2.25

Status
NEW
Severity
critical
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2018-01-05T16:49:45Z
Last change time
2024-12-01T16:31:50Z
Assigned to
Eduard Staniloiu
Creator
Gleb Kulikov
Moved to GitHub: phobos#9733 →

Comments

Comment #0 by gleb — 2018-01-05T16:49:45Z
dmd, installed from "official" rpm: any program (for example, code follows) traps on "writeln" with follows diagnosis: module main; import std.stdio; int main(string[] args) { writefln("Hello World\n"); return 0; } Fatal error: glibc detected an invalid stdio handle Program received signal SIGSEGV, Segmentation fault. 0x00007ffff7460299 in fwrite () from /lib64/libc.so.6 (gdb) bt #0 0x00007ffff7460299 in fwrite () from /lib64/libc.so.6 #1 0x00000000004046ba in std.stdio (obj=..., f=0x655160 <std.stdio>) at /usr/include/d/std/stdio.d:4064 #2 0x00000000004045f1 in std.stdio.File.LockingTextWriter (this=..., writeme=...) at /usr/include/d/std/stdio.d:2775 #3 0x0000000000403ddb in std.range.primitives (e=..., r=...) at /usr/include/d/std/range/primitives.d:269 #4 0x0000000000403dad in std.range.primitives (e=..., r=...) at /usr/include/d/std/range/primitives.d:358 #5 0x0000000000403d41 in std.format (this=..., writer=...) at /usr/include/d/std/format.d:1188 #6 0x0000000000403871 in std.format (fmt=..., w=...) at /usr/include/d/std/format.d:474 #7 0x00000000004037d1 in std.stdio.File (this=..., fmt=...) at /usr/include/d/std/stdio.d:1496 #8 0x0000000000403759 in std.stdio (fmt=...) at /usr/include/d/std/stdio.d:3797 #9 0x000000000040370a in D main (args=...) at hello.d:7
Comment #1 by edi33416 — 2018-12-12T08:45:09Z
Cheers What version of `dmd` are you using? What OS are you using? Since you mentioned `rpm` I'm thinking about rhel, centos or fedora. I'm not sure how up to date the `rpm` package is. I recommend that you try installing `dmd` from the downloads page, https://dlang.org/download.html, and try your example again.
Comment #2 by edi33416 — 2018-12-12T09:40:19Z
I setup a fresh Fedora 64bit VM, everything is freshly installed The code snippet is working as expected with * glibc 2.28 * gcc 8.2.1 * dmd v2.083.1 Looking forward to your update. Cheers, Edi
Comment #3 by robert.schadek — 2024-12-01T16:31:50Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/phobos/issues/9733 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB