Bug 1796 – execv does not initialize argv properly

Status
RESOLVED
Resolution
INVALID
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Linux
Creation time
2008-01-21T12:46:00Z
Last change time
2015-06-09T01:31:21Z
Assigned to
bugzilla
Creator
andrei

Comments

Comment #0 by andrei — 2008-01-21T12:46:02Z
Consider: import std.process, std.stdio; void main(string[] args) { writeln(args); assert(args.length); execv(args[0], args[1 .. $]); } This program should execute itself forever. In fact, when started with no options, it asserts at the second execution: args is not properly initialized by the execv function.
Comment #1 by andrei — 2008-01-21T12:51:47Z
Sorry - that's the actual behavior of execv. Not a bug.