[PATCH] a shocking error in "bin/fricas"

10 views
Skip to first unread message

Qian Yun

unread,
Mar 16, 2021, 7:37:56 AM3/16/21
to fricas-devel
The error I mentioned in previous email about endless loop
invoking "viewman" on macOS can be easily reproduced on Linux
as well:

Simple build with "--with-x=no", then a default "FRICAS=. ./bin/fricas"
will end up with endless:

/bin/sh: line 1: /tmp/fricas/target/x86_64-linux-gnu/lib/viewman: No
such file or directory

This is caused by d1b3fa941ad7b01f9e33f8b952db3a54158a9b60 in 2020-04-17

--- a/src/etc/fricas
+++ b/src/etc/fricas
@@ -131,6 +131,11 @@ if [ ! -f $FRICAS/lib/viewman ] ; then
otheropts="-nogr"
fi

+if [ ! -f $FRICAS/bin/hypertex ]; then
+ echo "hypertex not present, disabling"
+ otheropts="-noht"
+fi
+

while [ "$*" != "" ] ; do

The fix would be:

diff --git a/src/etc/fricas b/src/etc/fricas
index 35a881d6..2fa42b85 100644
--- a/src/etc/fricas
+++ b/src/etc/fricas
@@ -135,7 +135,7 @@ fi

if [ ! -f $FRICAS/bin/hypertex ]; then
echo "hypertex not present, disabling"
- otheropts="-noht"
+ otheropts="$otheropts -noht"
fi


Waldek Hebisch

unread,
Mar 16, 2021, 3:54:05 PM3/16/21
to fricas...@googlegroups.com
On Tue, Mar 16, 2021 at 07:37:44PM +0800, Qian Yun wrote:
> The error I mentioned in previous email about endless loop
> invoking "viewman" on macOS can be easily reproduced on Linux
> as well:
>
> Simple build with "--with-x=no", then a default "FRICAS=. ./bin/fricas"
> will end up with endless:
>
> /bin/sh: line 1: /tmp/fricas/target/x86_64-linux-gnu/lib/viewman: No such
> file or directory
>
> This is caused by d1b3fa941ad7b01f9e33f8b952db3a54158a9b60 in 2020-04-17

Good catch.
<snip>
> The fix would be:
>
> diff --git a/src/etc/fricas b/src/etc/fricas
> index 35a881d6..2fa42b85 100644
> --- a/src/etc/fricas
> +++ b/src/etc/fricas
> @@ -135,7 +135,7 @@ fi
>
> if [ ! -f $FRICAS/bin/hypertex ]; then
> echo "hypertex not present, disabling"
> - otheropts="-noht"
> + otheropts="$otheropts -noht"
> fi

OK, please commit.

--
Waldek Hebisch

Qian Yun

unread,
Mar 17, 2021, 6:35:30 AM3/17/21
to fricas...@googlegroups.com
BTW, the usage of unsafe string functions in sman makes me
very worried...

- Qian
Reply all
Reply to author
Forward
0 new messages