If I run some code that uses `std.process.execute` inside LLDB it will result in an exception thrown: "Interrupted system call". It does not occur when running the program by itself, only when running inside LLDB.
Steps to reproduce:
$ dmd --version
DMD64 D Compiler v2.103.1
Copyright (C) 1999-2023 by The D Language Foundation, All Rights Reserved written by Walter Bright
$ cat main.d
void main()
{
import std.process;
execute(["ls"]);
}
$ dmd main.d
$ ./main
$ echo $?
0
$ lldb main
(lldb) target create "main"
Current executable set to 'main' (x86_64).
(lldb) r
Process 40798 launched: 'main' (x86_64)
std.exception.ErrnoException@std/stdio.d(1166): Enforcement failed (Interrupted system call)
----------------
??:? @safe noreturn std.exception.bailOut!(std.exception.ErrnoException).bailOut(immutable(char)[], ulong, scope const(char)[]) [0x10003c988]
??:? @safe bool std.exception.enforce!(std.exception.ErrnoException).enforce!(bool).enforce(bool, lazy const(char)[], immutable(char)[], ulong) [0x10003c9f3]
??:? @safe ubyte[] std.stdio.File.rawRead!(ubyte).rawRead(ubyte[]) [0x1000439d6]
??:? void std.stdio.File.ByChunkImpl.prime() [0x100042788]
??:? ref std.stdio.File.ByChunkImpl std.stdio.File.ByChunkImpl.__ctor(std.stdio.File, ubyte[]) [0x10004293b]
??:? ref std.stdio.File.ByChunkImpl std.stdio.File.ByChunkImpl.__ctor(std.stdio.File, ulong) [0x10004280d]
??:? std.stdio.File.ByChunkImpl std.stdio.File.byChunk(ulong) [0x100042c5b]
??:? @trusted std.typecons.Tuple!(int, "status", immutable(char)[], "output").Tuple std.process.executeImpl!(std.process.pipeProcess, const(char[])[]).executeImpl(const(char[])[], const(immutable(char)[][immutable(char)[]]), std.process.Config, ulong, scope const(char)[]) [0x10004091a]
??:? @safe std.typecons.Tuple!(int, "status", immutable(char)[], "output").Tuple std.process.execute(scope const(char[])[], const(immutable(char)[][immutable(char)[]]), std.process.Config, ulong, scope const(char)[]) [0x10003fbbe]
??:? _Dmain [0x10000127d]
Process 40798 exited with status = 1 (0x00000001)
(lldb)
Most of the times when I run the program the exception is thrown, but not always. I tried both using DMD and LDC. Both running ARM64 and x86-64 (through Rosetta).
Comment #1 by doob — 2023-05-29T18:09:13Z
Forgot this info:
$ lldb --version
lldb-1403.0.17.64
Apple Swift version 5.8 (swiftlang-5.8.0.124.2 clang-1403.0.22.11.100)
$ sw_vers
ProductName: macOS
ProductVersion: 13.3.1
ProductVersionExtra: (a)
BuildVersion: 22E772610a
$ xcodebuild -version
Xcode 14.3
Build version 14E222b
Comment #2 by robert.schadek — 2024-12-01T16:41:24Z