https://issues.dlang.org/show_bug.cgi?id=23654
--- Comment #12 from kdevel ---
(In reply to kdevel from comment #5)
> Created attachment 1868 [details]
> Patch (v0) against process.d
>
> Could not yet test this code. That is how I would implement those D wrappers.
The test is rather simple.
https://issues.dlang.org/show_bug.cgi?id=23654
--- Comment #11 from Steven Schveighoffer ---
If you look at that commit from 2015, it was using alloca before, and now uses
malloc. But the issue is that the `toAStringz` which allocates an array of C
strings using the GC. This was the case before
https://issues.dlang.org/show_bug.cgi?id=23654
--- Comment #10 from anonymous4 ---
As I understand the code initially didn't touch GC (because it can fail after
fork or to match posix guarantees) then regressed to use GC.
--
https://issues.dlang.org/show_bug.cgi?id=23654
--- Comment #9 from Steven Schveighoffer ---
(In reply to anonymous4 from comment #6)
> Doesn't fork break the GC heap? If you want to allocate from GC after fork,
> it may not work.
fork *can* hang if another thread is holding the GC lock. But we
https://issues.dlang.org/show_bug.cgi?id=23654
--- Comment #8 from kdevel ---
(In reply to anonymous4 from comment #6)
> Doesn't fork break the GC heap? If you want to allocate from GC after fork,
> it may not work.
The corruption does not require a previous call to fork.
--
https://issues.dlang.org/show_bug.cgi?id=23654
--- Comment #7 from kdevel ---
Created attachment 1888
--> https://issues.dlang.org/attachment.cgi?id=1888=edit
D-Program execv-recur.d demonstrating the memory corruption
//
// execv-recur.d
// 2023-08-29 stvo
//
// disable the GC with
//
//
https://issues.dlang.org/show_bug.cgi?id=23654
--- Comment #6 from anonymous4 ---
Doesn't fork break the GC heap? If you want to allocate from GC after fork, it
may not work.
--
https://issues.dlang.org/show_bug.cgi?id=23654
--- Comment #5 from kdevel ---
Created attachment 1868
--> https://issues.dlang.org/attachment.cgi?id=1868=edit
Patch (v0) against process.d
Could not yet test this code. That is how I would implement those D wrappers.
--
https://issues.dlang.org/show_bug.cgi?id=23654
Steven Schveighoffer changed:
What|Removed |Added
CC||schvei...@gmail.com
https://issues.dlang.org/show_bug.cgi?id=23654
Steven Schveighoffer changed:
What|Removed |Added
Component|dmd |phobos
--
https://issues.dlang.org/show_bug.cgi?id=23654
hst...@qfbox.info changed:
What|Removed |Added
CC||hst...@qfbox.info
--
https://issues.dlang.org/show_bug.cgi?id=23654
--- Comment #3 from kdevel ---
Created attachment 1867
--> https://issues.dlang.org/attachment.cgi?id=1867=edit
use new for allocation (no malloc)
--
https://issues.dlang.org/show_bug.cgi?id=23654
--- Comment #1 from kdevel ---
(In reply to kdevel from comment #0)
> private void toAStringz(in string[] a, const(char)**az)
> {
> import std.string : toStringz;
> foreach (string s; a)
> {
> *az++ = toStringz(s);
> }
>
https://issues.dlang.org/show_bug.cgi?id=23654
--- Comment #2 from kdevel ---
Created attachment 1866
--> https://issues.dlang.org/attachment.cgi?id=1866=edit
GC disabled
--
14 matches
Mail list logo