Mailing List Archive

configure script errors
I am not sure it is worth a fix, given that the
stated goal (by at least one dev) is to replace
the configure script with cmake, but here is
an issue with the configure script that one
might want to fix.

For systems that are "well endowed" (lots
of CPUs), the configure line at/near 2688
are of the form:

if test -f /proc/cpuinfo ; then
if test x"$processor" = x"" -o x"$processor" = x"$arch_default" -o \
x"$processor" = x"unknown" ; then
processor=`cat /proc/cpuinfo | grep "model name" | head -n 1`
fi
processor_flags=`cat /proc/cpuinfo | grep "flags" | head -n 1`
fi

can result in a message of the form:

grep: write error: Broken pipe
cat: write error: Broken pipe

as head exits when it receives the needed lines
resulting in SIGPIPEs backing upstream.

A trivial fix is of the forms:

grep -m 1 "^\s*model name" /proc/cpuinfo

and

grep -m 1 "^\s*flags" /proc/cpuinfo

Thanks.
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: configure script errors [ In reply to ]
On 3/6/22 22:27, Gary Buhrmaster wrote:
> I am not sure it is worth a fix, given that the
> stated goal (by at least one dev) is to replace
> the configure script with cmake, but here is
> an issue with the configure script that one
> might want to fix.

Since the fix is trivial, while we are still using the configure script,
it makes sense to fix it.

>
> For systems that are "well endowed" (lots
> of CPUs),

Out of curiosity, how many CPUs?

> the configure line at/near 2688
> are of the form:
>
> if test -f /proc/cpuinfo ; then
> if test x"$processor" = x"" -o x"$processor" = x"$arch_default" -o \
> x"$processor" = x"unknown" ; then
> processor=`cat /proc/cpuinfo | grep "model name" | head -n 1`
> fi
> processor_flags=`cat /proc/cpuinfo | grep "flags" | head -n 1`
> fi
>
> can result in a message of the form:
>
> grep: write error: Broken pipe
> cat: write error: Broken pipe
>
> as head exits when it receives the needed lines
> resulting in SIGPIPEs backing upstream.

git blame shows those lines are 17 years old.  processor is only used to
echo it at the end of configure.  processor_flags is unused.

>
> A trivial fix is of the forms:
>
> grep -m 1 "^\s*model name" /proc/cpuinfo
>
> and
>
> grep -m 1 "^\s*flags" /proc/cpuinfo
>

"^\s*" shouldn't be necessary.  If you still want it, however, \s is
Perl syntax, so it should be [[:space:]] for POSIX compliance.

What does `grep "model name" /proc/cpuinfo` output for a hybrid CPU
architecture?

Regards,

Scott
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: configure script errors [ In reply to ]
On Mon, Mar 7, 2022 at 5:53 PM Scott Theisen <scott.the.elm@gmail.com> wrote:

> Out of curiosity, how many CPUs?

No idea as to where the minimum might be
encountered. but the (AWS) instance I was
running had 64 processors. The bug is real
for any number of processors due to "racing"
conditions. That others did not encounter it
is more about getting lucky than about proper
design (it has always been architecturally
broken since "forever").
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org