#950008 gfan: assertion fails on riscv64

#950008#5
Date:
2020-01-28 09:29:07 UTC
From:
To:
Hi,

many of sagemath's doctests in the interface to gfan fail on riscv64 with the following error:

gfan_*: src/application.cpp:42: char* tail(char*): Assertion `*p==*m' failed.

It looks like the pointer arithmetic in the function tail() in application.cpp does not work like this on riscv64. Unfortunately there are no porterboxes for riscv64 yet, so I can't come up with a minimal example triggering the bug.

Best,
Tobias

#950008#10
Date:
2020-01-28 12:51:33 UTC
From:
To:
Hello!

I am forwarding the bug report below from the Debian package of gfan:

#950008#17
Date:
2020-01-28 13:28:02 UTC
From:
To:
Hi,

Thanks for the bug report.
Line 30 of application.cpp looks suspicious:
  while(p[l]!=0 && p[l]!='/');
Does it help to change it to
  while(l!=0 && p[l]!='/');
?
If not, I think I need to know what the char* argv[0] points to when main is  called.

Best regards,
Anders

#950008#22
Date:
2021-07-07 15:50:08 UTC
From:
To:
This is also causing macaulay2 to FTBFS in riscv64 [1]:

    checking whether the package gfan is installed... gfan: src/application.cpp:42: char* tail(char*): Assertion `*p==*m' failed.
    yes, but < 0.6, will build

    ...

    make -C gfan fetch
    make[3]: Entering directory '/<<PKGBUILDDIR>>/M2/libraries/gfan'
    error: for the third-party library or program source "gfan"
           the source code is not present in the file "/<<PKGBUILDDIR>>/M2/BUILD/tarfiles/gfan0.6.2.tar.gz"
           so either download a "fat" tar file of the Macaulay2 source code
           or rerun the Macaulay2 "configure" command with the added option "--enable-download"
           to enable automatic downloading of the source code over the internet
    make[3]: *** [../Makefile.library:235: /<<PKGBUILDDIR>>/M2/BUILD/tarfiles/gfan0.6.2.tar.gz] Error 1

[1] https://buildd.debian.org/status/fetch.php?pkg=macaulay2&arch=riscv64&ver=1.18%2Bds-1%7Eexp1&stamp=1625665959&raw=0

#950008#27
Date:
2021-11-09 01:13:25 UTC
From:
To:
I included a slight modification of this patch (with "l >= 0" instead of
"l != 0") in the latest gfan upload (0.6.2-5).  Fingers crossed that it
fixes things on riscv64!

Doug

#950008#32
Date:
2021-11-19 10:32:13 UTC
From:
To:
This patch (attached) appears to have worked!  The most recent build of
Macaulay2 on riscv64 [1], while failing for other reasons, got past the gfan
detection stage:

    checking whether the package gfan is installed... yes

I'll wait to see if it works for the next riscv64 build of Sage before
closing this bug.

Doug

[1] https://buildd.debian.org/status/fetch.php?pkg=macaulay2&arch=riscv64&ver=1.19%2Bds-1&stamp=1637315650&raw=0

#950008#37
Date:
2021-11-19 10:49:45 UTC
From:
To:
Thanks,
I have made this update to the gfan svn.
Best regards,
Anders



This patch (attached) appears to have worked!  The most recent build of
Macaulay2 on riscv64 [1], while failing for other reasons, got past the gfan
detection stage:

    checking whether the package gfan is installed... yes

I'll wait to see if it works for the next riscv64 build of Sage before
closing this bug.

Doug

[1] https://buildd.debian.org/status/fetch.php?pkg=macaulay2&arch=riscv64&ver=1.19%2Bds-1&stamp=1637315650&raw=0