fricas-aldor interface is broken

9 views
Skip to first unread message

Ralf Hemmecke

unread,
Feb 13, 2023, 2:50:58 PM2/13/23
to fricas-devel, Peter Broadbery
I relized that the fricas-aldor interface is currently broken.
(configure --enable-aldor)
To be more exact, the problematic commit is

991f83471e23485f1cb68a78e6b2f02e8d137fba

That innocent looking commit hangs the compilation of the interface when
doing it with make -j8. With -j1 it gives a segfault when compiling
ap/HOMOL.ap, see below.

Interestingly, comparing the output of "cd BUILDDIR/src/aldor; make -j1"
with what happens just one commit before, yields the exact same
compilation commands up to HOMOL.ap.

I'm currently a bit helpless of what exactly causes the problem that
lets aldor jump into a segfault on compiling HOMOL.ap.

Any help is appreciated.

Ralf



======================

commit 991f83471e23485f1cb68a78e6b2f02e8d137fba (HEAD -> bad)
Author: Waldek Hebisch <heb...@mail.math.uni.wroc.pl>
Date: Sun Jun 26 22:46:49 2022 +0200

Generalize LinearlyExplicitOver

diff --git a/ChangeLog b/ChangeLog
index 7b7c36697..94dd9e341 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2022-06-26 Waldek Hebisch <c...@fricas.math.uni.wroc.pl>
+
+ * src/algebra/catdef.spad: Generalize LinearlyExplicitOver
+
2022-06-26 Waldek Hebisch <c...@fricas.math.uni.wroc.pl>

* src/interp/i-resolv.boot: Add two more special
diff --git a/src/algebra/catdef.spad b/src/algebra/catdef.spad
index 545c9ec9e..866a2c30a 100644
--- a/src/algebra/catdef.spad
+++ b/src/algebra/catdef.spad
@@ -854,7 +854,7 @@ LeftOreRing() : Category == EntireRing with
++ References:
++ Description:
++ An extension ring with an explicit linear dependence test.
-LinearlyExplicitOver(R : Ring) : Category == Ring with
+LinearlyExplicitOver(R : Ring) : Category == RightModule(R) with
reducedSystem : Matrix % -> Matrix R
++ reducedSystem(A) returns a matrix B such that \spad{A x = 0}
and \spad{B x = 0}
++ have the same solutions in R.

===============================

aldor -Wname=fricas -Mno-abbrev -Mpreview -Y al -L
FriCASLib=fricas_HOMOL -fao=ao/HOMOL.ao ap/HOMOL.ap 2>&1 | tee
tmp/HOMOL_ao.out
Segmentation fault
ar r al/libfricas_CHAINC.al ao/lang.ao ao/boolean0.ao ao/minimach.ao
ao/subsetc.ao ao/BASTYPE.ao ao/init_SINT.ao ao/HASHSTAT.ao ao/KOERCE.ao
ao/init_OUTFORM.ao ao/SETCAT.ao ao/init_PI.ao ao/ABELSG.ao
ao/init_NNI.ao ao/ABELMON.ao ao/ABELGRP.ao ao/ATFINAG.ao ao/AGG.ao
ao/ATTWSR.ao ao/ATCS.ao ao/ATNZDIV.ao ao/ATSHMUT.ao ao/ATUNIKN.ao
ao/CABMON.ao ao/COMPAR.ao ao/init_LIST.ao ao/IEVALAB.ao ao/init_EQ.ao
ao/EVALAB.ao ao/PORDER.ao ao/ORDSET.ao ao/HOAGG.ao ao/KONVERT.ao
ao/init_INFORM.ao ao/CLAGG.ao ao/ELTAB.ao ao/ELTAGG.ao ao/IXAGG.ao
ao/MAGMA.ao ao/MAGMAWU.ao ao/SGROUP.ao ao/MONOID.ao ao/NASRNG.ao
ao/NASRING.ao ao/init_UNISEG.ao ao/LNAGG.ao ao/FLAGG.ao ao/A1AGG.ao
ao/AHYP.ao ao/BGAGG.ao ao/DIOPS.ao ao/DIAGG.ao ao/ELAGG.ao ao/KDAGG.ao
ao/RCAGG.ao ao/URAGG.ao ao/STAGG.ao ao/LSAGG.ao ao/TBAGG.ao ao/ALAGG.ao
ao/ALIST.ao ao/APRODC.ao ao/CHARZ.ao ao/init_OMDEV.ao ao/OM.ao ao/AMR.ao
ao/LIST.ao ao/OASGP.ao ao/OAMON.ao ao/OCAMON.ao ao/OAGROUP.ao
ao/ORDRING.ao ao/SEGCAT.ao ao/SEGXCAT.ao ao/SEG.ao ao/ARR2CAT.ao
ao/ATADDVA.ao ao/ATAPPRO.ao ao/ATARBEX.ao ao/ATARBPR.ao ao/ATCANCL.ao
ao/ATCANON.ao ao/ATCUNOR.ao ao/ATMULVA.ao ao/ATRIG.ao ao/ATVCWC.ao
ao/JOINLAT.ao ao/BJOIN.ao ao/MEETLAT.ao ao/BMEET.ao ao/BLAT.ao ao/LAT.ao
ao/DISTLAT.ao ao/BDISTL.ao ao/FINITE.ao ao/LOGIC.ao ao/BOOLEAN.ao
ao/ORDFIN.ao ao/CHAR.ao ao/SETAGG.ao ao/FSAGG.ao ao/CCLASS.ao
ao/CFCAT.ao ao/CHARNZ.ao ao/DIFRING.ao ao/ELEMFUN.ao ao/LORER.ao
ao/init_SUP.ao ao/GCDDOM.ao ao/PID.ao ao/EUCDOM.ao ao/IPC.ao ao/IDPC.ao
ao/FMCAT.ao ao/HYPCAT.ao ao/KOERCEF.ao ao/init_MATRIX.ao
ao/init_VECTOR.ao ao/LINEXP.ao ao/LZSTAGG.ao ao/OAMONS.ao ao/NNI.ao
ao/NONE.ao ao/OINTDOM.ao ao/PDRING.ao ao/init_DFLOAT.ao ao/init_FLOAT.ao
ao/REAL.ao ao/RETRACT.ao ao/init_SYMBOL.ao ao/SAOS.ao ao/SEXCAT.ao
ao/SPFCAT.ao ao/SRAGG.ao ao/STEP.ao ao/STRICAT.ao ao/STRING.ao
ao/TRIGCAT.ao ao/TRANFUN.ao ao/init_FR.ao ao/UFD.ao ao/MATCAT.ao
ao/VECTCAT.ao ao/VECTOR.ao ao/MATRIX.ao ao/OSGROUP.ao ao/ORDMON.ao
ao/PI.ao ao/SINT.ao ao/STREAM.ao ao/UNISEG.ao ao/axlit.ao ao/axextend.ao
ao/HOMOL.ao
ar: creating al/libfricas_CHAINC.al
ar: ao/HOMOL.ao: No such file or directory
make[1]: *** [cliques.mk:4170: al/libfricas_CHAINC.al] Error 1
rm ao/.dir
make[1]: Leaving directory
'/home/hemmecke/backup/git/fricas-bisect/build/991f83471e23485f1cb68a78e6b2f02e8d137fba_2023-02-13_13-09-34/src/aldor'
make: *** [Makefile:440: al/libfricas.al] Error 2


Waldek Hebisch

unread,
Feb 13, 2023, 4:31:22 PM2/13/23
to fricas...@googlegroups.com
On Mon, Feb 13, 2023 at 08:50:53PM +0100, Ralf Hemmecke wrote:
> I relized that the fricas-aldor interface is currently broken.
> (configure --enable-aldor)
> To be more exact, the problematic commit is
>
> 991f83471e23485f1cb68a78e6b2f02e8d137fba
>
> That innocent looking commit

Actually, this is change that exposed latent problems in our
code. One problem was in interpreter and was worked around
in previous commit. But there were also several fixes to
Spad compiler in the period between time when I first tried
this change and time when I could commit it without causing
regression. There were several other algebra changes that
required fixes to Spad compiler. This change could work
as a trigger for problem fixed in Spad, but not fixed in
Aldor.

> hangs the compilation of the interface when
> doing it with make -j8. With -j1 it gives a segfault when compiling
> ap/HOMOL.ap, see below.
>
> Interestingly, comparing the output of "cd BUILDDIR/src/aldor; make -j1"
> with what happens just one commit before, yields the exact same compilation
> commands up to HOMOL.ap.
>
> I'm currently a bit helpless of what exactly causes the problem that lets
> aldor jump into a segfault on compiling HOMOL.ap.

AFAICS this is Aldor crashing on content of HOMOL.ap. So one should
look at changes in HOMOL.ap and previous .ap files (a lot of type info
is defined in earlier files). Based on that one should be able to
say if this is interface probles, that is .ap files are wrong,
or Aldor problem (crahs on valid code).

--
Waldek Hebisch

Ralf Hemmecke

unread,
Feb 25, 2023, 5:23:19 PM2/25/23
to fricas...@googlegroups.com
Meanwhile Peter Broadbery has found and corrected a bug in the aldor
compiler. Thank you, Peter!

https://github.com/aldorlang/aldor/commit/2f5b4896eed78cb37a31a49a51662e98e4462821

With that aldor no longer hangs when building FriCAS in either of the
recent versions (09-Feb-2023):

https://github.com/fricas/fricas/commit/68a3e8eee6d1dc20b925fd11220f38f2a033e027

commit 68a3e8eee6d1dc20b925fd11220f38f2a033e027 (HEAD -> b)
Author: Waldek Hebisch <heb...@mail.math.uni.wroc.pl>
Date: Thu Feb 9 20:57:11 2023 +0100

Simplify pathnames

commit b489cd365696faadc11829fd80493001a0203f6f (a)
Author: Waldek Hebisch <heb...@mail.math.uni.wroc.pl>
Date: Thu Feb 9 20:25:42 2023 +0100

Simplify hashtables
https://github.com/fricas/fricas/commit

However, I can no longer compile sieve.as (is attached) with
68a3e8eee6d1dc20b925fd11220f38f2a033e027, because I get the following
error. So this commit introduces a bug.

hemmecke:~/scratch/aldortest>fricas -nosman
Checking for foreign routines
FRICAS="/home/hemmecke/HDD/hemmecke/software/lib/fricas/target/x86_64-linux-gnu"
spad-lib="/home/hemmecke/HDD/hemmecke/software/lib/fricas/target/x86_64-linux-gnu/lib/libspad.so"
foreign routines found
openServer result -2
FriCAS Computer Algebra System
Version: FriCAS 50b3b2d46cc1d9b7fbd1c77a506006220667fda7
Timestamp: Sa 25 Feb 2023 15:58:01 CET
-----------------------------------------------------------------------------
Issue )copyright to view copyright notices.
Issue )summary for a summary of useful system commands.
Issue )quit to leave FriCAS and return to shell.
-----------------------------------------------------------------------------

(1) -> )co sieve.as
Compiling FriCAS source code from file
/home/hemmecke/scratch/aldortest/sieve.as using Aldor compiler
and options
-O -Fasy -Fao -Flsp -lfricas -Mno-ALDOR_W_WillObsolete -DFriCAS -Y
$FRICAS/algebra -I $FRICAS/algebra
Use the system command )set compiler args to change these
options.

>> Error detected within library code:
Strange argument to pathname

(1) ->


Ralf




====================================================================
sieve.as

Waldek Hebisch

unread,
Feb 25, 2023, 7:07:26 PM2/25/23
to fricas...@googlegroups.com
On Sat, Feb 25, 2023 at 11:23:15PM +0100, Ralf Hemmecke wrote:
> Meanwhile Peter Broadbery has found and corrected a bug in the aldor
> compiler. Thank you, Peter!
>
> https://github.com/aldorlang/aldor/commit/2f5b4896eed78cb37a31a49a51662e98e4462821
>
> However, I can no longer compile sieve.as (is attached) with
> 68a3e8eee6d1dc20b925fd11220f38f2a033e027, because I get the following error.
> So this commit introduces a bug.

I seems that I missed one place that needed updating. Can you try
the attached patch.


--
Waldek Hebisch
i-syscmd.diff

Ralf Hemmecke

unread,
Feb 26, 2023, 2:45:06 AM2/26/23
to fricas...@googlegroups.com
Works. Thanks.

Ralf
Reply all
Reply to author
Forward
0 new messages