Red Hat Bugzilla – Bug 664080
math lib functions no longer work
Last modified: 2010-12-24 19:26:54 EST
$ echo "s(1);e(1)" | /f14/usr/bin/bc -l
$ echo "s(1);e(1)" | /f11/usr/bin/bc -l
Thanks for report - strange, can't reproduce here...
$ rpm -q bc
$ echo "s(1);e(1)" | bc -l
And that's the same version which is in f14. Some specific arch?
I had a quick look at this again...
It doesn't look to be an issue specific to the math lib (-l option)
as in the following example, n is not defined and should give a
different error and e is defined and should not give error.
$ echo "v=n(1);v=e(1)" | LANG=C /usr/bin/bc -l
(standard_in) 1: Assignment of a void expression
(standard_in) 2: Assignment of a void expression
That along with the fact that I also have it working
on another i686 F14 box with same sw versions, suggested
to me something low level. So I rebuilt the binary
(which still had the issue), and ran it under an F11 chroot
and it was OK!
That suggests to me a glibc issue?
$ rpm -q gcc kernel glibc
$ uname -a
Linux 126.96.36.199-64.fc14.i686 #1 SMP Fri Dec 3 12:35:42 UTC 2010 i686 i686 i386 GNU/Linux
$ grep -E "(model|flags)" /proc/cpuinfo
model : 13
model name : Intel(R) Pentium(R) M processor 1.70GHz
flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov clflush dts acpi mmx fxsr sse sse2 ss tm pbe nx up bts est tm2
I'll try replacing memcpy and strcmp etc. this evening...
glibc - maybe ... could you please try to recompile bc srpm on your FC-14 machine and check it again? Maybe bc just needs to be rebuilt in F14...
Sorry for being unclear. When I said "So I rebuilt the binary" above,
that was the rpm. Then I rebuilt a version without readline for
testing in the F11 chroot (with older readline)
Found the issue in bc with a bit of thought and valgrind...
I'll send the fix upstream, but there's not been a release
for 4 years, so I'd apply it locally anyway. cheers.
--- storage.c.orig 2010-12-21 19:43:14.663540110 +0000
+++ storage.c 2010-12-21 19:42:01.392540111 +0000
@@ -99,6 +99,7 @@
f = &functions[indx];
f->f_defined = FALSE;
+ f->f_void = FALSE;
f->f_body = (char *) bc_malloc (BC_START_SIZE);
f->f_body_size = BC_START_SIZE;
f->f_code_size = 0;
Thanks for the patch, sure, upstream seems to be dead (1.06.95 for years), I'll do an update soon.
bc-1.06.95-2.fc14 has been submitted as an update for Fedora 14.
bc-1.06.95-2.fc14 has been pushed to the Fedora 14 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
su -c 'yum --enablerepo=updates-testing update bc'. You can provide feedback for this update here: https://admin.fedoraproject.org/updates/bc-1.06.95-2.fc14
bc-1.06.95-2.fc14 has been pushed to the Fedora 14 stable repository. If problems still persist, please make note of it in this bug report.