Re: assertion error in Swig_smartptr_upcast on MacOS only (swig 4.2.0)

William S Fulton <[email protected]> Tue, 9 Jan 2024 11:07:15 +0000
Newsgroups gmane.comp.programming.swig
Message-ID <CANGqftBuqTN_Eg5WJX5dnb6F6UzgVrHNAhA8V6h_Y9k4ki7CBA@mail.gmail.com>
--===============5506394332428250352==
Content-Type: multipart/alternative; boundary="000000000000515b5e060e815382"

--000000000000515b5e060e815382
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Grab the preprocessed output by adding -E:

swig4.0 -E -python -outdir . -c++ -builtin -interface _stir -o
stirPYTHON_wrap.cxx stir.i > stir.preprocssed.i

and create a Github issue. We should be able to recreate it with this.
assert is only used with debug builds, so that should explain why it is
different on different systems if SWIG is built differently.  I think just
with or without -g.

William

On Tue, 9 Jan 2024 at 09:05, <[email protected]> wrote:

> Hi
>
>
>
> I=E2=80=99m trying to update our conda-forge feedstock to the latest vers=
ion of
> our STIR software. However, all MacOS builds fail when calling swig to
> generate the Python wrapper:
>
>
>
> Assertion failed: (replace_count), function Swig_smartptr_upcast, file
> Modules/utils.cxx, line 177.
>
>
>
> However, Linux and Windows builds work fine. All of them use conda-forge
> builds of swig 4.2.0
>
>
>
> Anyone any suggestions where this could come from?
>
>
>
> Kris
>
>
>
> PS: STIR is rather large, and I don=E2=80=99t have access to a Mac to try=
 to cut
> down where this happens.
>
>
>
> PS: The full command line to call swig (and some more info) is on set to
> current master after merge of TOF (so 6.0.0 pre-release) by KrisThieleman=
s
> =C2=B7 Pull Request #105 =C2=B7 conda-forge/stir-feedstock (github.com)
> <https://github.com/conda-forge/stir-feedstock/pull/105>, but is
> essentially
>
>
>
> swig4.0 -python -outdir . -c++ -builtin -interface _stir -o
> stirPYTHON_wrap.cxx stir.i
>
>
>
> (It turns out that at least on Linux, swig4.0 is linked to swig. The name
> swig4.0 is rather confusing for swig 4.2.0, but ok).
>
>
> _______________________________________________
> Swig-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/swig-user
>

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

<div dir=3D"ltr"><div>Grab the preprocessed output by adding -E:</div><div>=
<br></div><div><span style=3D"color:rgb(31,35,40);font-family:Consolas;font=
-size:12px">swig4.0 -E -python -outdir . -c++ -builtin -interface _stir -o =
stirPYTHON_wrap.cxx stir.i &gt; stir.preprocssed.i</span><br></div><div><sp=
an style=3D"color:rgb(31,35,40);font-family:Consolas;font-size:12px"><br></=
span></div><div><span style=3D"color:rgb(31,35,40);font-family:Consolas;fon=
t-size:12px">and create a Github issue. We should be able to recreate it wi=
th this. assert is only used with debug builds, so that should explain why =
it is different on different systems if SWIG is built differently.=C2=A0 I =
think just with or without -g.</span></div><div><span style=3D"color:rgb(31=
,35,40);font-family:Consolas;font-size:12px"><br></span></div><div><span st=
yle=3D"color:rgb(31,35,40);font-family:Consolas;font-size:12px">William</sp=
an></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_att=
r">On Tue, 9 Jan 2024 at 09:05, &lt;<a href=3D"mailto:kris.f.thielemans@gma=
il.com">[email protected]</a>&gt; wrote:<br></div><blockquote cla=
ss=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid =
rgb(204,204,204);padding-left:1ex"><div class=3D"msg-8626011834426230158"><=
div lang=3D"EN-GB" style=3D"overflow-wrap: break-word;"><div class=3D"m_-86=
26011834426230158WordSection1"><p class=3D"MsoNormal">Hi<u></u><u></u></p><=
p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p><p class=3D"MsoNormal">I=E2=
=80=99m trying to update our conda-forge feedstock to the latest version of=
 our STIR software. However, all MacOS builds fail when calling swig to gen=
erate the Python wrapper:<u></u><u></u></p><p class=3D"MsoNormal"><u></u>=
=C2=A0<u></u></p><p class=3D"MsoNormal">Assertion failed: (replace_count), =
function Swig_smartptr_upcast, file Modules/utils.cxx, line 177.<u></u><u><=
/u></p><p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p><p class=3D"MsoNormal=
">However, Linux and Windows builds work fine. All of them use conda-forge =
builds of swig 4.2.0<u></u><u></u></p><p class=3D"MsoNormal"><u></u>=C2=A0<=
u></u></p><p class=3D"MsoNormal">Anyone any suggestions where this could co=
me from?<u></u><u></u></p><p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p><p=
 class=3D"MsoNormal">Kris<u></u><u></u></p><p class=3D"MsoNormal"><u></u>=
=C2=A0<u></u></p><p class=3D"MsoNormal">PS: STIR is rather large, and I don=
=E2=80=99t have access to a Mac to try to cut down where this happens.<u></=
u><u></u></p><p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p><p class=3D"Mso=
Normal">PS: The full command line to call swig (and some more info) is on <=
a href=3D"https://github.com/conda-forge/stir-feedstock/pull/105" target=3D=
"_blank">set to current master after merge of TOF (so 6.0.0 pre-release) by=
 KrisThielemans =C2=B7 Pull Request #105 =C2=B7 conda-forge/stir-feedstock =
(github.com)</a>, but is essentially<u></u><u></u></p><p class=3D"MsoNormal=
"><u></u>=C2=A0<u></u></p><p class=3D"MsoNormal" style=3D"background:white"=
><span style=3D"font-size:9pt;font-family:Consolas;color:rgb(31,35,40);bord=
er:1pt none windowtext;padding:0cm">swig4.0 -python -outdir . -c++ -builtin=
 -interface _stir -o stirPYTHON_wrap.cxx stir.i<u></u><u></u></span></p><p =
class=3D"MsoNormal"><u></u>=C2=A0<u></u></p><p class=3D"MsoNormal">(It turn=
s out that at least on Linux, swig4.0 is linked to swig. The name swig4.0 i=
s rather confusing for swig 4.2.0, but ok).<u></u><u></u></p><p class=3D"Ms=
oNormal"><u></u>=C2=A0<u></u></p></div></div>______________________________=
_________________<br>
Swig-user mailing list<br>
<a href=3D"mailto:[email protected]" target=3D"_blank">Swig-u=
[email protected]</a><br>
<a href=3D"https://lists.sourceforge.net/lists/listinfo/swig-user" rel=3D"n=
oreferrer" target=3D"_blank">https://lists.sourceforge.net/lists/listinfo/s=
wig-user</a><br>
</div></blockquote></div></div>

--000000000000515b5e060e815382--


--===============5506394332428250352==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--===============5506394332428250352==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Swig-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/swig-user

--===============5506394332428250352==--