[Issue 23654] execv_: toAStringz: memory corruption
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Oct 22 11:43:47 UTC 2023
https://issues.dlang.org/show_bug.cgi?id=23654
--- Comment #12 from kdevel <kdevel at vogtner.de> ---
(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.
1. Locate process.d (locate src/phobos/std/process.d) and copy it
to the current working directory.
2. Download, compile, execute execv-recur.d (4th attachment)
$ dmd execv-recur.d process.d
$ ./execv-recur 1
[...]
self <./execv-recur> newargs [0, 1] <./execv-recur> <131072>
dump: <2> <4> <2> <32> <2> <4> <2>
object.Exception at execv-recur.d(49): exp <4> actual <131072>
[...]
3. Download the Patch (3rd attachment) apply, recompile, execute:
$ patch -i issue-23654.v0.patch
patching file process.d
Hunk #1 succeeded at 4309 (offset 50 lines).
Hunk #2 succeeded at 4374 (offset 50 lines).
$ dmd execv-recur.d process.d
$ ./execv-recur 1
[...]
self <./execv-recur> newargs [0, 1] <./execv-recur> <262144>
rc = <-1> errno = <7> strerror = <Argument list too long>
This is the expected outcome.
--
More information about the Digitalmars-d-bugs
mailing list