[Issue 23654] execv_: toAStringz: memory corruption

2023-10-22 Thread d-bugmail--- via Digitalmars-d-bugs
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.

[Issue 23654] execv_: toAStringz: memory corruption

2023-08-30 Thread d-bugmail--- via Digitalmars-d-bugs
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

[Issue 23654] execv_: toAStringz: memory corruption

2023-08-30 Thread d-bugmail--- via Digitalmars-d-bugs
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. --

[Issue 23654] execv_: toAStringz: memory corruption

2023-08-30 Thread d-bugmail--- via Digitalmars-d-bugs
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

[Issue 23654] execv_: toAStringz: memory corruption

2023-08-29 Thread d-bugmail--- via Digitalmars-d-bugs
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. --

[Issue 23654] execv_: toAStringz: memory corruption

2023-08-29 Thread d-bugmail--- via Digitalmars-d-bugs
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 // //

[Issue 23654] execv_: toAStringz: memory corruption

2023-08-28 Thread d-bugmail--- via Digitalmars-d-bugs
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. --

[Issue 23654] execv_: toAStringz: memory corruption

2023-01-26 Thread d-bugmail--- via Digitalmars-d-bugs
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. --

[Issue 23654] execv_: toAStringz: memory corruption

2023-01-26 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=23654 Steven Schveighoffer changed: What|Removed |Added CC||schvei...@gmail.com

[Issue 23654] execv_: toAStringz: memory corruption

2023-01-26 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=23654 Steven Schveighoffer changed: What|Removed |Added Component|dmd |phobos --

[Issue 23654] execv_: toAStringz: memory corruption

2023-01-26 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=23654 hst...@qfbox.info changed: What|Removed |Added CC||hst...@qfbox.info --

[Issue 23654] execv_: toAStringz: memory corruption

2023-01-26 Thread d-bugmail--- via Digitalmars-d-bugs
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) --

[Issue 23654] execv_: toAStringz: memory corruption

2023-01-26 Thread d-bugmail--- via Digitalmars-d-bugs
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); > } >

[Issue 23654] execv_: toAStringz: memory corruption

2023-01-26 Thread d-bugmail--- via Digitalmars-d-bugs
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 --