Source: svox
Severity: normal
Hi,
svox has a failing autopkgtest with popt 1.19+dfsg-1~exp1 from
experimental, log from autopkgtest is attached.
The binary pico2wave uses memory that is now, correctly, being
freed by popt, this has been a long standing issue with the
library. The binary pico2wave therefore fails when used with
certain command line arguments. An example is the arguments used
in the autopkgtest.
I have attached a patch that solves the issue. It is a one line
fix, which duplicates a string before its freed by popt.
Regards,
Håvard
autopkgtest [17:44:12]: starting date: 2022-09-20
autopkgtest [17:44:12]: version 5.25
autopkgtest [17:44:12]: host ci-worker13; command line: /usr/bin/autopkgtest --no-built-binaries '--setup-commands=echo '"'"'svox unstable/amd64'"'"' > /var/tmp/debci.pkg 2>&1 || true' '--setup-commands=echo '"'"'Acquire::Retries "10";'"'"' > /etc/apt/apt.conf.d/75retry 2>&1 || true' --user debci --apt-upgrade --add-apt-release=experimental --pin-packages=experimental=src:popt --output-dir /tmp/debci-worker-26264309-NbheM4Vrtu/autopkgtest-incoming/unstable/amd64/s/svox/26264309 svox -- lxc --sudo --name ci-263-f0ec40b8 autopkgtest-unstable-amd64
autopkgtest [17:44:24]: @@@@@@@@@@@@@@@@@@@@ test bed setup
Get:1 http://deb.debian.org/debian experimental InRelease [97.5 kB]
Get:2 http://deb.debian.org/debian experimental/non-free Sources [2,512 B]
Get:3 http://deb.debian.org/debian experimental/main Sources [447 kB]
Get:4 http://deb.debian.org/debian experimental/contrib Sources [1,820 B]
Get:5 http://deb.debian.org/debian experimental/main amd64 Packages [402 kB]
Get:6 http://deb.debian.org/debian experimental/contrib amd64 Packages [6,056 B]
Get:7 http://deb.debian.org/debian experimental/non-free amd64 Packages [7,388 B]
Fetched 964 kB in 0s (2,871 kB/s)
Reading package lists...
Get:1 http://deb.debian.org/debian unstable InRelease [158 kB]
Get:2 http://deb.debian.org/debian-debug unstable-debug InRelease [56.7 kB]
Hit:3 http://deb.debian.org/debian experimental InRelease
Get:4 http://deb.debian.org/debian unstable/contrib Sources.diff/Index [63.3 kB]
Get:5 http://deb.debian.org/debian unstable/non-free Sources.diff/Index [63.3 kB]
Get:6 http://deb.debian.org/debian unstable/main Sources.diff/Index [63.6 kB]
Get:7 http://deb.debian.org/debian unstable/main amd64 Packages.diff/Index [63.6 kB]
Get:8 http://deb.debian.org/debian unstable/non-free amd64 Packages.diff/Index [63.3 kB]
Get:9 http://deb.debian.org/debian-debug unstable-debug/contrib Sources.diff/Index [63.3 kB]
Get:10 http://deb.debian.org/debian-debug unstable-debug/non-free Sources.diff/Index [63.3 kB]
Get:11 http://deb.debian.org/debian-debug unstable-debug/main Sources.diff/Index [63.6 kB]
Get:12 http://deb.debian.org/debian-debug unstable-debug/main amd64 Packages.diff/Index [63.6 kB]
Get:13 http://deb.debian.org/debian-debug unstable-debug/non-free amd64 Packages.diff/Index [63.3 kB]
Get:14 http://deb.debian.org/debian unstable/contrib Sources T-2022-09-20-1646.49-F-2022-09-20-1646.49.pdiff [31 B]
Get:15 http://deb.debian.org/debian unstable/non-free Sources T-2022-09-20-1646.49-F-2022-09-20-1646.49.pdiff [31 B]
Get:16 http://deb.debian.org/debian unstable/main Sources T-2022-09-20-1646.49-F-2022-09-20-1106.00.pdiff [22.7 kB]
Get:17 http://deb.debian.org/debian unstable/main amd64 Packages T-2022-09-20-1646.49-F-2022-09-20-1106.00.pdiff [36.2 kB]
Get:14 http://deb.debian.org/debian unstable/contrib Sources T-2022-09-20-1646.49-F-2022-09-20-1646.49.pdiff [31 B]
Get:17 http://deb.debian.org/debian unstable/main amd64 Packages T-2022-09-20-1646.49-F-2022-09-20-1106.00.pdiff [36.2 kB]
Get:16 http://deb.debian.org/debian unstable/main Sources T-2022-09-20-1646.49-F-2022-09-20-1106.00.pdiff [22.7 kB]
Get:15 http://deb.debian.org/debian unstable/non-free Sources T-2022-09-20-1646.49-F-2022-09-20-1646.49.pdiff [31 B]
Get:18 http://deb.debian.org/debian unstable/non-free amd64 Packages T-2022-09-20-1106.00-F-2022-09-20-1106.00.pdiff [5,854 B]
Get:18 http://deb.debian.org/debian unstable/non-free amd64 Packages T-2022-09-20-1106.00-F-2022-09-20-1106.00.pdiff [5,854 B]
Get:19 http://deb.debian.org/debian-debug unstable-debug/contrib Sources T-2022-09-20-1646.49-F-2022-09-20-1646.49.pdiff [31 B]
Get:19 http://deb.debian.org/debian-debug unstable-debug/contrib Sources T-2022-09-20-1646.49-F-2022-09-20-1646.49.pdiff [31 B]
Get:20 http://deb.debian.org/debian-debug unstable-debug/non-free Sources T-2022-09-20-1106.00-F-2022-09-20-1106.00.pdiff [887 B]
Get:21 http://deb.debian.org/debian-debug unstable-debug/main Sources T-2022-09-20-1646.49-F-2022-09-20-1106.00.pdiff [19.2 kB]
Get:22 http://deb.debian.org/debian-debug unstable-debug/main amd64 Packages T-2022-09-20-1646.49-F-2022-09-20-1106.00.pdiff [19.6 kB]
Get:23 http://deb.debian.org/debian-debug unstable-debug/non-free amd64 Packages T-2022-09-20-1106.00-F-2022-09-20-1106.00.pdiff [305 B]
Get:20 http://deb.debian.org/debian-debug unstable-debug/non-free Sources T-2022-09-20-1106.00-F-2022-09-20-1106.00.pdiff [887 B]
Get:23 http://deb.debian.org/debian-debug unstable-debug/non-free amd64 Packages T-2022-09-20-1106.00-F-2022-09-20-1106.00.pdiff [305 B]
Get:22 http://deb.debian.org/debian-debug unstable-debug/main amd64 Packages T-2022-09-20-1646.49-F-2022-09-20-1106.00.pdiff [19.6 kB]
Get:21 http://deb.debian.org/debian-debug unstable-debug/main Sources T-2022-09-20-1646.49-F-2022-09-20-1106.00.pdiff [19.2 kB]
Fetched 954 kB in 2s (498 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
Calculating upgrade...
The following packages will be upgraded:
base-passwd
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 60.0 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http://deb.debian.org/debian unstable/main amd64 base-passwd amd64 3.6.1 [60.0 kB]
debconf: delaying package configuration, since apt-utils is not installed
Fetched 60.0 kB in 0s (5,006 kB/s)
(Reading database ...
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 13011 files and directories currently installed.)
Preparing to unpack .../base-passwd_3.6.1_amd64.deb ...
Unpacking base-passwd (3.6.1) over (3.6.0) ...
Setting up base-passwd (3.6.1) ...
Reading package lists...
Building dependency tree...
Reading state information...
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
autopkgtest [17:44:29]: testbed dpkg architecture: amd64
autopkgtest [17:44:29]: testbed running kernel: Linux 5.10.0-17-amd64 #1 SMP Debian 5.10.136-1 (2022-08-13)
autopkgtest [17:44:29]: @@@@@@@@@@@@@@@@@@@@ apt-source svox
Get:1 http://deb.debian.org/debian unstable/non-free svox 1.0+git20130326-12 (dsc) [2,291 B]
Get:2 http://deb.debian.org/debian unstable/non-free svox 1.0+git20130326-12 (tar) [26.4 MB]
Get:3 http://deb.debian.org/debian unstable/non-free svox 1.0+git20130326-12 (diff) [21.0 kB]
gpgv: unknown type of key resource 'trustedkeys.kbx'
gpgv: keyblock resource '/tmp/dpkg-verify-sig.lTRuOZM7/trustedkeys.kbx': General error
gpgv: Signature made Mon 25 Oct 2021 11:08:31 PM UTC
gpgv: using RSA key E7D0D210DA2640861ADA77EA45D4ECCC64849B79
gpgv: Can't check signature: No public key
dpkg-source: warning: cannot verify signature ./svox_1.0+git20130326-12.dsc
autopkgtest [17:44:32]: testing package svox version 1.0+git20130326-12
autopkgtest [17:44:32]: build not needed
autopkgtest [17:44:32]: test command1: preparing testbed
Reading package lists...
Building dependency tree...
Reading state information...
Correcting dependencies...Starting pkgProblemResolver with broken count: 0
Starting 2 pkgProblemResolver with broken count: 0
Done
Done
Starting pkgProblemResolver with broken count: 0
Starting 2 pkgProblemResolver with broken count: 0
Done
The following additional packages will be installed:
libpopt0 libttspico-data libttspico-utils libttspico0
The following NEW packages will be installed:
libpopt0 libttspico-data libttspico-utils libttspico0
0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 4,355 kB of archives.
After this operation, 7,132 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian experimental/main amd64 libpopt0 amd64 1.19+dfsg-1~exp1 [48.9 kB]
Get:2 http://deb.debian.org/debian unstable/non-free amd64 libttspico-data all 1.0+git20130326-12 [4,156 kB]
Get:3 http://deb.debian.org/debian unstable/non-free amd64 libttspico0 amd64 1.0+git20130326-12 [140 kB]
Get:4 http://deb.debian.org/debian unstable/non-free amd64 libttspico-utils amd64 1.0+git20130326-12 [10.2 kB]
debconf: delaying package configuration, since apt-utils is not installed
Fetched 4,355 kB in 0s (10.6 MB/s)
Selecting previously unselected package libpopt0:amd64.
(Reading database ...
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 13011 files and directories currently installed.)
Preparing to unpack .../libpopt0_1.19+dfsg-1~exp1_amd64.deb ...
Unpacking libpopt0:amd64 (1.19+dfsg-1~exp1) ...
Selecting previously unselected package libttspico-data.
Preparing to unpack .../libttspico-data_1.0+git20130326-12_all.deb ...
Unpacking libttspico-data (1.0+git20130326-12) ...
Selecting previously unselected package libttspico0:amd64.
Preparing to unpack .../libttspico0_1.0+git20130326-12_amd64.deb ...
Unpacking libttspico0:amd64 (1.0+git20130326-12) ...
Selecting previously unselected package libttspico-utils.
Preparing to unpack .../libttspico-utils_1.0+git20130326-12_amd64.deb ...
Unpacking libttspico-utils (1.0+git20130326-12) ...
Setting up libttspico-data (1.0+git20130326-12) ...
Setting up libttspico0:amd64 (1.0+git20130326-12) ...
Setting up libpopt0:amd64 (1.19+dfsg-1~exp1) ...
Setting up libttspico-utils (1.0+git20130326-12) ...
Setting up autopkgtest-satdep (0) ...
Processing triggers for libc-bin (2.34-8) ...
(Reading database ... 13083 files and directories currently installed.)
Removing autopkgtest-satdep (0) ...
autopkgtest [17:44:36]: test command1: pico2wave --wave=$AUTOPKGTEST_TMP/output.wav 'Hello, world!'
autopkgtest [17:44:36]: test command1: [-----------------------
free(): double free detected in tcache 2
bash: line 1: 1465 Aborted bash -ec 'pico2wave --wave=$AUTOPKGTEST_TMP/output.wav '\''Hello, world!'\''' 2> >(tee -a /tmp/autopkgtest-lxc.3fqiwhzm/downtmp/command1-stderr 1>&2) > >(tee -a /tmp/autopkgtest-lxc.3fqiwhzm/downtmp/command1-stdout)
autopkgtest [17:44:36]: test command1: -----------------------]
autopkgtest [17:44:36]: test command1: - - - - - - - - - - results - - - - - - - - - -
command1 FAIL non-zero exit status 134
autopkgtest [17:44:36]: test command1: - - - - - - - - - - stderr - - - - - - - - - -
free(): double free detected in tcache 2
autopkgtest [17:44:36]: @@@@@@@@@@@@@@@@@@@@ summary
command1 FAIL non-zero exit status 134
From b0dfdfae8058dbffc54d2146594c70cf65f48b2c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?H=C3=A5vard=20F=2E=20Aasen?= <havard.f.aa...@pfft.no>
Date: Wed, 21 Sep 2022 22:50:50 +0200
Subject: [PATCH] Duplicate string, before it's freed by popt
Previous versions of the library popt had a memory leak, and as of
version 1.19 that has been fixed.
This application used part of the now freed memory, which causes the
warning "free(): double free detected in tcache 2" when it is being
executed with specific arguments.
Before the memory is freed by popt, we duplicate it. As before, the
now duplicated string is freed at the end of the application.
---
...3-pico2wave-Convert-text-to-.wav-using-svox-text-to-sp.patch | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/debian/patches/0003-pico2wave-Convert-text-to-.wav-using-svox-text-to-sp.patch b/debian/patches/0003-pico2wave-Convert-text-to-.wav-using-svox-text-to-sp.patch
index e9c28c3..0146e54 100644
--- a/debian/patches/0003-pico2wave-Convert-text-to-.wav-using-svox-text-to-sp.patch
+++ b/debian/patches/0003-pico2wave-Convert-text-to-.wav-using-svox-text-to-sp.patch
@@ -192,7 +192,7 @@ Subject: [PATCH 3/7] pico2wave: Convert text to .wav using svox text-to-speech s
+ const char **extra_argv;
+ extra_argv = poptGetArgs(optCon);
+ if(extra_argv) {
-+ text = (char *) &(*extra_argv)[0];
++ text = strdup((char *) &(*extra_argv)[0]);
+ } else {
+ // read from stdin
+ size_t len = myread(stdin, &text);
--
2.35.1