Re: Packed executable exit code 1 issue

[email protected] (Roderich Schupp) Mon, 17 Jul 2023 12:30:20 +0200
Newsgroups perl.par
Message-ID <CAC9r9zaV5WDKCdKXC1j8uFe0CqguNwgc+os+YnpzGPmNahg5BQ@mail.gmail.com>
--000000000000b894070600ac4907
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Mon, Jul 17, 2023 at 7:56=E2=80=AFAM Deepak Khosla via par <[email protected]=
> wrote:
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D
> use strict;
> use warnings;
> my $exit_code =3D $ARGV[0];
> print "called with $0 $exit_code\n";
>
> END {
>     $? =3D $exit_code;     #  Setting this in case exit is ignoring our
exit_code
>     print STDERR "Exiting final with exit_status $exit_code, ? =3D $? \n"=
;
>     exit ($exit_code);
> }
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D
> ...
> But running the packaged version - I get varied results. The sample code
always returns 0 for $? But my bigger piece of code provides proper code
for 0 or 2, but a 0 when exiting with a 1.
> [dkhosla]$ ./t 2
> called with ./t 2
> Exiting final with exit_status 2, ? =3D 2
> [dkhosla]$ echo $?
> 0

It's a bug in PAR::Packer =F0=9F=99=81
Please try with HEAD from https://github.com/rschupp/PAR-Packer

Cheers, Roderich

--000000000000b894070600ac4907
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Mon, Jul 17, 2023 at 7:56=E2=80=AFAM Deepak Khosla via =
par &lt;<a href=3D"mailto:[email protected]">[email protected]</a>&gt; wrote:<br>&gt;=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D<br>&gt; use strict;<br>&gt; use warnings;<br>&gt; my $exit_code =3D =
$ARGV[0];<br>&gt; print &quot;called with $0 $exit_code\n&quot;;<br>&gt;<br=
>&gt; END {<br>&gt; =C2=A0 =C2=A0 $? =3D $exit_code; =C2=A0 =C2=A0 # =C2=A0=
Setting this in case exit is ignoring our exit_code<br>&gt; =C2=A0 =C2=A0 p=
rint STDERR &quot;Exiting final with exit_status $exit_code, ? =3D $? \n&qu=
ot;;<br>&gt; =C2=A0 =C2=A0 exit ($exit_code);<br>&gt; }<br>&gt; =3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D<br>&gt; ...<br>&gt; But running the packaged version - I get vari=
ed results. The sample code always returns 0 for $? But my bigger piece of =
code provides proper code for 0 or 2, but a 0 when exiting with a 1.<br>&gt=
; [dkhosla]$ ./t 2<br>&gt; called with ./t 2<br>&gt; Exiting final with exi=
t_status 2, ? =3D 2<br>&gt; [dkhosla]$ echo $?<br>&gt; 0<br><div><br></div>=
<div>It&#39;s a bug in PAR::Packer =F0=9F=99=81=C2=A0</div><div>Please try =
with HEAD from <a href=3D"https://github.com/rschupp/PAR-Packer">https://gi=
thub.com/rschupp/PAR-Packer</a> <br></div><div><br></div><div>Cheers, Roder=
ich<br></div></div>

--000000000000b894070600ac4907--