Using RunCommand or TProcess (+ poUsePipes) to wrap the command "lxc init ..." crashes
* Lazarus/FPC Version: Lazarus 4.0RC2 (rev lazarus_4_0RC2-94-ga540e7372b) FPC 3.2.3 x86_64-linux-gtk2 * Operating System: DEVUAN | uname -a = Linux myhost 6.1.0-30-amd64 freepascal.org/lazarus/lazarus#1 SMP PREEMPT_DYNAMIC Debian 6.1.124-1 (2025-01-12) x86_64 GNU/Linux * CPU / Bitness: 64 ## What happens I use RunCommand (but TProcess reading StdOutput has the same problem) to wrap the execution of a LXD virtualisation system command (LXD is similar to Docker). The command is lxc and the strange thing is that the crash occurs with a certain parameter. For example, launching lxc list -f json RunCommand/TProcess (Options := \[poUsePipes\]) works. On the other hand, launching lxc init ubuntu:20.04 u1 RunCommand/TProcess (Options := \[poUsePipes\]) crashes. ## What did you expect What I would expect is for the command to be executed normally and all the way through, returning the standard output. ## Steps to reproduce You need to install LXD and run following source. I also performed several test, as suggested from MarkMLl in the official forum, as documented in: https://forum.lazarus.freepascal.org/index.php/topic,70123.0.html ``` program testlxc; uses process; const LXC_BIN = ‘/usr/bin/lxc’; var AStdOut: string; begin Writeln(LXC_BIN + ‘ LIST ’); RunCommand(LXC_BIN, [‘list’], AStdOut); // this works Writeln(‘output: >>’); Writeln(AStdOut); Writeln(‘<<’); Writeln(LXC_BIN + ‘ INIT ’); RunCommand(LXC_BIN, [‘init’, ‘ubuntu:20.04’, ‘u1’], AStdOut); // here it crashes Writeln(‘output: >>’); Writeln(AStdOut); Writeln(‘<<’); end. ```
issue