From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 4BABC384A86E for ; Mon, 19 Aug 2024 19:51:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4BABC384A86E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 4BABC384A86E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1724097079; cv=none; b=pAYtU0FOBARKh1bBU2o+DAQTypE/jEOuip3pFGCrvMmkY5psM0ycQl1vzCGNQWlZh/Ip5P9kdnPBXzF1oRQqGRf5TPRyaKWW36SflP7YZZw2ny6s7B8iyudoYpClre+G1Wvum+taL+oyvIhczLK5C2y+HwditE1y1Gm/i/oSgDM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1724097079; c=relaxed/simple; bh=g1GndWZEYB1+prN1qZf4mMlL9XZ4n4pLg4miuDuAcPM=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=aU1qADsMhm8DMxMxn4jqawwwKBTsO5zlYMgwfrdfw9bWJmQsFRcQDxgW8rAXANqlPR8Lb5moW10incuk/+Ow/54H4oQL5/u+IVEXMtfqGg1PAtAiNlZrtq8n0JLg39JUXTiNm8AAVUtCneWeqYCxZw7qKzpR+xEfWRQdvZOMrq4= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724097076; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kFu/SfK5ayUUkCFXplc30RHdpRHLJkI27fxq1sPM9dU=; b=ctctcuWTacvvHoCLWpEG5QsBz4R0qNECz5JTpCf2VAvmh4a1PE0eRFjgz5mF3k7h6Ey+Bg 9cVPbM/oQVxKD83z1EDoo2sU1pVLWOxS8iR2MiZOmVrkGT1qfdLpv8Nl5YGDNuJXnzsYeg 7gqcgcqh65zoQmxuoiNZ3d9joBwdSEI= Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-240-gqjqPiN9NlOY_CeN9EgIsA-1; Mon, 19 Aug 2024 15:51:15 -0400 X-MC-Unique: gqjqPiN9NlOY_CeN9EgIsA-1 Received: by mail-pl1-f198.google.com with SMTP id d9443c01a7336-201e49afd9aso37854485ad.0 for ; Mon, 19 Aug 2024 12:51:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724097074; x=1724701874; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=kFu/SfK5ayUUkCFXplc30RHdpRHLJkI27fxq1sPM9dU=; b=UG3OAnFdzKjZSXgSD019DKm05Wx5cFCxZO9l4ajCoWMeAASaiKV9NOywwtHGSWwYsA T9rx/Gv3czaZeRI4nWcPNl62MqA0M2n1ivmDR0BBOWpD/N88zd1Y0k/HsLLW6pqBnA+g VPW7IPMERYll51BLkSjsPqSqAY8UybMfWyV4taVUpJUwFnuuFJ2dtcxINrzSYr8TwWKz 4SvHpeHpSxU414MSH90Cxjybs4imTqRNSQdPCSD5zt1riM69wlEEotoMv4c5YGnv0f0V 2uAn38fF4GyjCkKvVQTs3Oh5Ev/SfUMB0+Ob5klxNIZpYgVOIla/5j3NR2Vw5m07p3Zh 5+fQ== X-Gm-Message-State: AOJu0YwT6vvA2eXMGwiiG6SFRlLW7MhFGjLY8kY5AanHhyPwr017LeEv KfZ6cXaH5aBQe50DDOzVo21TftSKnEYVOqN4rAblZ/Dgep96hgMBadbHayELiFQB1HF7iy18rIo IlJC/vf1IZscXk7EJzNKZfsh0tJkhponYQ03Gy/NiQJ3Rx3qVFAqoa9jOA5buGBjS X-Received: by 2002:a17:903:5ce:b0:1fd:6ca4:f987 with SMTP id d9443c01a7336-2025f0a116emr8047115ad.15.1724097073917; Mon, 19 Aug 2024 12:51:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHwqJHzEwsr8LExOv0yzkkBfojad9ZH9x7lo2tJwwhTjmOeeSdUGCxOPa9dK/6k7sQBYx//og== X-Received: by 2002:a17:903:5ce:b0:1fd:6ca4:f987 with SMTP id d9443c01a7336-2025f0a116emr8046875ad.15.1724097073245; Mon, 19 Aug 2024 12:51:13 -0700 (PDT) Received: from [150.1.200.127] (174-21-139-113.tukw.qwest.net. [174.21.139.113]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-201f0319755sm65704095ad.65.2024.08.19.12.51.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 19 Aug 2024 12:51:12 -0700 (PDT) Message-ID: Date: Mon, 19 Aug 2024 12:51:12 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] find-debuginfo.sh: Exit with real exit status in parallel jobs To: Mark Wielaard Cc: debugedit@sourceware.org References: <4120f4aea4b7f2cb5c30f55c19ae63a1e710df34.1723834460.git.keiths@redhat.com> <20240817212015.GA17272@gnu.wildebeest.org> From: Keith Seitz In-Reply-To: <20240817212015.GA17272@gnu.wildebeest.org> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-10.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 8/17/24 2:20 PM, Mark Wielaard wrote: > On Fri, Aug 16, 2024 at 11:54:20AM -0700, Keith Seitz wrote: >> Currently, when the script is executed in parallel (-jN), the >> resulting exit status will always be 0. >> >> The script execs an appropriate number of clones of itself, calling >> run_job to run the actual workload. This then calls do_file(), saving >> the exit status into "res.$jobid". >> >> In do_file(), though, if an error occurs, exit is called. This causes >> the entire exec'd shell to exit with status 0 (since there are almost >> always echo calls as the last executed statement). The real exit >> status is therefor never written to the "res.$jobid" files by run_job(). >> >> The simple solution is to use 'return' instead of 'exit'. A number >> of minor adjustments are also made to propagate this properly so that >> it is reported as the correct exit status. > > Good find. Code looks correct. Except don't we now also need to check > the result of do_file () in the non-parallel case? Something like: > > diff --git a/scripts/find-debuginfo.in b/scripts/find-debuginfo.in > index f40e566f86c3..5998b9d1fa6c 100755 > --- a/scripts/find-debuginfo.in > +++ b/scripts/find-debuginfo.in > @@ -579,6 +579,10 @@ fi > if [ $n_jobs -le 1 ]; then > while read nlinks inum f; do > do_file "$nlinks" "$inum" "$f" > + res=$? > + if [ "$res" != "0" ]; then > + exit $res > + fi > done <"$temp/primary" > else > for ((i = 1; i <= n_files; i++)); do Yes, that does look appropriate. My apologies for not following through with the non-parallel invocation. I guess I could have (further) modified my custom rpm package to specifically test this case, too, and submit a more complete patch. >> While at it, I've incorporated a patch for find-debuginfo/30505. >> Using this patch and another patch to the RPM package (submitted as >> github issue #3215), failures of gdb-add-index.sh will now properly fail >> the build instead of being swallowed. It should be much easier for >> developers to figure out why their builds have failed should gdb crash. > > Thanks, that has been a long standing issue. Smart to introduce a new > _find_debuginfo_exit_on_error for rpm-config. The reason errors > weren't reported in the past was because people would then disable > creating debuginfo packages completely. But these days we really > should report (and fix) any errors. > > There are a couple of other places, the main debugedit invocation, > strip_to_debug, add_minidebug, which really should report errors > too. But that can wait. Indeed. I'm selfish, so I am attempting to improve testing for areas for which I am directly responsible, but perhaps I can add that to a TODO and give it a try with my mass prebuilder some time to verify. In any case, a step in the right direction. Thank you for the review! Keith