Bug#933945: bc: Carriage return stopped working between calculations

2019-08-07 Thread Thomas Stewart
Hi,

I performed a git bisect compiling[1] both readline and bc from
upstream[0] and found the commit (8e6ccd0) that introduced the issue.
However this commit is the entire diff from "readline-7.0 patch 5" to
"readline-8.0 distribution sources and documentation".

I also found that if I compiled without readline or libedit support the
behaviour reverted to normal, albeit without any readline history.

Kind Regards
--
Tom

[0]
http://git.savannah.gnu.org/cgit/readline.git
https://git.savannah.gnu.org/git/readline.git
https://ftp.gnu.org/gnu/bc/

[1] compile.sh
#!/bin/bash -eux
cd /home/thomas/scratch/bctest/readline
rm -r -f /home/thomas/scratch/bctest/readline/i
./configure --prefix=`pwd`/i
make -j 8
make install

cd /home/thomas/scratch/bctest
wget -c https://ftp.gnu.org/gnu/bc/bc-1.07.1.tar.gz
rm -r -f /home/thomas/scratch/bctest/bc-1.07.1
tar xf bc-1.07.1.tar.gz
cd bc-1.07.1/
export CFLAGS="-I/home/thomas/scratch/bctest/readline/i/include/"
export LDFLAGS="-L/home/thomas/scratch/bctest/readline/i/lib/"
./configure --prefix=`pwd`/i 
--with-readline=/home/thomas/scratch/bctest/readline/i/
make -j 8
make install

echo
echo "LD_LIBRARY_PATH=\"/home/thomas/scratch/bctest/readline/i/lib\" 
/home/thomas/scratch/bctest/bc-1.07.1/i/bin/bc"



Bug#933945: bc: Carriage return stopped working between calculations

2019-08-05 Thread Thomas Stewart
Package: bc
Version: 1.07.1-2+b2
Severity: normal

Dear Maintainer,

   * What led up to the situation?

Instead of a normal calculator I use bc for quick calculations. Often
between different calculations I press return a few times to space
things out (and to focus the mind).


   * What outcome did you expect instead?

It seems this functionality does not work anymore. Historically if you
run bc and press enter, newlines are shown on screen scrolling the
output up one line. However now pressing enter does nothing (unless you
are doing an actual calculation).

I expect to be able to press return at a bc(1) prompt and for a newline
to scroll the output up.


   * What I found out.

I think I have narrowed the issue down to the libreadline.so.7 to
libreadline.so.8 update that hit the mirrors on the 22nd July 2019.

If two chroots are created from the 22nd July, one at 03:59 and one at
08:59 with the following commands:
$ sudo debootstrap --variant=minbase --include=bc bullseye 
bullseye-20190722T035916Z 
https://snapshot.debian.org/archive/debian/20190722T035916Z/
$ sudo debootstrap --variant=minbase --include=bc bullseye 
bullseye-20190722T085948Z 
https://snapshot.debian.org/archive/debian/20190722T085948Z/

The first chroot works as expected however the second does not, I tested
as below:
$ sudo chroot bullseye-20190722T035916Z/ bc
$ sudo chroot bullseye-20190722T085948Z/ bc

Looking at the libraries linked and comparing them shows that
libreadline changed version from 7 to 8.
$ ldd bullseye-20190722T035916Z/usr/bin/bc | awk '{print $1}' > 1
$ ldd bullseye-20190722T085948Z/usr/bin/bc | awk '{print $1}' > 2
$ diff -u 1 2
--- 1   2019-08-02 13:45:33.594849157 +0100
+++ 2   2019-08-02 13:45:36.334827465 +0100
@@ -1,5 +1,5 @@
 linux-vdso.so.1
-libreadline.so.7
+libreadline.so.8
 libncurses.so.6
 libtinfo.so.6
 libc.so.6

I'm not sure what to try next.

Kind Regards
--
Tom

-- System Information:
Debian Release: bullseye/sid
  APT prefers testing
  APT policy: (800, 'testing'), (700, 'unstable'), (600, 'experimental'), (500, 
'unstable-debug'), (500, 'testing-debug'), (1, 'experimental-debug')
Architecture: amd64 (x86_64)
Foreign Architectures: armel, armhf, i386

Kernel: Linux 4.19.0-5-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages bc depends on:
ii  libc6 2.28-10
ii  libncurses6   6.1+20190713-1
ii  libreadline8  8.0-2
ii  libtinfo6 6.1+20190713-1

bc recommends no packages.

bc suggests no packages.

-- no debconf information