Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1swg2Z-005Mhj-I6 for pgsql-hackers@arkaria.postgresql.org; Fri, 04 Oct 2024 11:00:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1swg2Y-00F5By-VH for pgsql-hackers@arkaria.postgresql.org; Fri, 04 Oct 2024 11:00:06 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1swg2Y-00F5Bq-LJ for pgsql-hackers@lists.postgresql.org; Fri, 04 Oct 2024 11:00:06 +0000 Received: from mail-lj1-x232.google.com ([2a00:1450:4864:20::232]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1swg2U-002Usr-Gc for pgsql-hackers@postgresql.org; Fri, 04 Oct 2024 11:00:06 +0000 Received: by mail-lj1-x232.google.com with SMTP id 38308e7fff4ca-2facaa16826so19025801fa.0 for ; Fri, 04 Oct 2024 04:00:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728039603; x=1728644403; darn=postgresql.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=hKwCLmUfHETOo/+8zYvqOOSSmCVYC8nHsnkis+1f+QQ=; b=DqHWEyKeDMesrB7JSAefzeBYUQSUcpHBUox2K5CIXWNB4H33Y2pVKNpZxTS0H6xff3 YBLatG6lpWNM1mxwWzSYHva+1cH2/C4EsmtQREq3KccYizInjXAh0Zr3+y4YAVSrt84g QgVBbNYVsPS/9csQW0WfJl1ZAG26UlbYo9NdWZvWs5D0kcjH31OYHH9kMK8W59g63O+q VnDADQY+I4/pSD5ygNVdym/vILmgEsrK8nxplzDt94Jf+PCMYfiS2+Dmmcoh6d9IVzUq Tr8/o4lwekGxXTjQi8c9VU4UVLNakssWmDMms5Z2sCwGM6AhaXbtKrHFkFkVIy5cC1mJ tviQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728039603; x=1728644403; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=hKwCLmUfHETOo/+8zYvqOOSSmCVYC8nHsnkis+1f+QQ=; b=wyq+QEHbe6d4iY18p5/ai5l4Q/pVnJDwhtB9RZ+LbVMrW/6BuJGFEzPF0ODrjgV9vU BbVq3vyCoKADhTVleW3/f3e+Yw3uY/kUJ73Ogd2IkS5rhiEuFgTcOsco63BDoeNEh7X8 4Mx1j31pt1a8fc2N78yiPg6eUnoLMwgUrY86eTz4Dd17+aeP0m5GhWDmA/gESLD2Wxv9 mweIIXz5PXyT1VyVyRspGpw7cW871F4NRIHGda8+u96WaYiEjqAVfsUeRrygjHaEsMkF pPCbFVv8+h+H91UnL8uwbq9j5rxbwrzVnX6rwpJ/MXpa2b1KCakcUjjUcV6BLnoz9gQE +GPg== X-Gm-Message-State: AOJu0YzjL+mh54rYDHEfdZO5CLKlUp4ZtkPzj23DdHecDfn+G7Gjh/c/ TiIpGIs7pU2R5PuSg5AJXV0V/VNjPgChqU3cbiNdVeMNIQi7mfY0 X-Google-Smtp-Source: AGHT+IHcjHDDawthU10O+GPCyB65zpAJDxx5/AU97MoeWLhmS3JYvH1QjwOt7QPcmlMl+PCNZreoUg== X-Received: by 2002:a2e:4e02:0:b0:2f5:2e2:eadf with SMTP id 38308e7fff4ca-2faf3c1c87fmr10266421fa.10.1728039602581; Fri, 04 Oct 2024 04:00:02 -0700 (PDT) Received: from [1.0.0.7] ([178.155.26.244]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-2faecc6b443sm4380561fa.98.2024.10.04.04.00.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 04 Oct 2024 04:00:01 -0700 (PDT) Message-ID: Date: Fri, 4 Oct 2024 14:00:00 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: IPC::Run accepts bug reports Content-Language: en-US To: Noah Misch Cc: pgsql-hackers@postgresql.org, Robert Haas References: <20240615234824.a9@rfd.leadboat.com> From: Alexander Lakhin In-Reply-To: <20240615234824.a9@rfd.leadboat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello Noah, 16.06.2024 02:48, Noah Misch wrote: > I don't see in https://github.com/cpan-authors/IPC-Run/issues anything > affecting PostgreSQL. If you know of IPC::Run defects, please report them. > If I knew of an IPC::Run defect affecting PostgreSQL, I likely would work on > it before absurdity like https://github.com/cpan-authors/IPC-Run/issues/175 > NetBSD-10-specific behavior coping. It looks like a recent indri failure [1] revealed one more IPC::Run anomaly. The failure log contains: # Running: pgbench -n -t 1 -Dfoo=bla -Dnull=null -Dtrue=true -Done=1 -Dzero=0.0 -Dbadtrue=trueXXX -Dmaxint=9223372036854775807 -Dminint=-9223372036854775808 -M prepared -f /Users/buildfarm/bf-data/HEAD/pgsql.build/src/bin/pgbench/tmp_check/t_001_pgbench_with_server_main_data/001_pgbench_error_sleep_undefined_variable [22:38:14.887](0.014s) ok 362 - pgbench script error: sleep undefined variable status (got 2 vs expected 2) [22:38:14.887](0.000s) ok 363 - pgbench script error: sleep undefined variable stdout /(?^:processed: 0/1)/ [22:38:14.887](0.000s) not ok 364 - pgbench script error: sleep undefined variable stderr /(?^:sleep: undefined variable)/ [22:38:14.887](0.000s) [22:38:14.887](0.000s) #   Failed test 'pgbench script error: sleep undefined variable stderr /(?^:sleep: undefined variable)/' #   at t/001_pgbench_with_server.pl line 1242. [22:38:14.887](0.000s) #                   '' #     doesn't match '(?^:sleep: undefined variable)' So the pgbench process exited as expected, stdout contained expected string, but stderr happened to be empty. Maybe such behavior is specific to macOS, and even on indri it's the only failure of that ilk out of 2000+ runs (and I couldn't reproduce this in a Linux VM), but I find this place in IPC::Run suspicious: sub _read { ...     my $r = POSIX::read( $_[0], $s, 10_000 );     croak "$!: read( $_[0] )" if not($r) and !$!{EINTR}; That is, EINTR kind of recognized as an expected error, but there is no retry in this case. Thus, with the following modification, which simulates read() failed with EINTR:  sub _read {      confess 'undef' unless defined $_[0];      my $s = ''; -    my $r = POSIX::read( $_[0], $s, 10_000 ); +    my $r; +if (int(rand(100)) == 0) +{ +   $r = 0;  $! = Errno::EINTR; +} +else +{ +    $r = POSIX::read( $_[0], $s, 10_000 ); +}      croak "$!: read( $_[0] )" if not($r) and !$!{EINTR}; I can see failures like the one in question when running that test. Perhaps, I could reproduce the issue with a program, that sends signals to running (pgbench) processes (and thus interrupts read()), if it makes sense. What do you think? [1] https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=indri&dt=2024-10-02%2002%3A34%3A16 Best regards, Alexander