[Issue 21730] New: null ptr dereferenced in ChunksImpl.opApply (SIGSEGV)
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Mar 18 21:03:41 UTC 2021
https://issues.dlang.org/show_bug.cgi?id=21730
Issue ID: 21730
Summary: null ptr dereferenced in ChunksImpl.opApply (SIGSEGV)
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: normal
Priority: P1
Component: phobos
Assignee: nobody at puremagic.com
Reporter: kdevel at vogtner.de
```three.d
import std.stdio;
void main ()
{
auto err1 = File ("/tmp/err1.txt", "w+x");
remove ("/tmp/err1.txt");
err1.close;
foreach (ubyte [] buf; chunks (err1, 4096))
stderr.writeln (buf);
}
```
(gdb) r
[...]
Program received signal SIGSEGV, Segmentation fault.
0xXXXXXXXXXXXXXXXX in std.stdio.ChunksImpl() (this=..., dg=...)
at [...]dmd2/linux/bin64/../../src/phobos/std/stdio.d:4711
4711 while ((r = trustedFread(f._p.handle, buffer)) > 0)
(gdb) p f
$1 = {_p = 0x0, _name = "/tmp/err1.txt"}
(related to Issue 21729)
--
More information about the Digitalmars-d-bugs
mailing list