* [scarthgap][PATCH] bzip2: fix 'bzip2 --version > /tmp/aaa 2>&1' hang
@ 2026-07-16 8:54 Jaipaul Cheernam
2026-07-23 8:46 ` [OE-core] " Yoann Congal
2026-07-23 9:26 ` [scarthgap][PATCH v2] " Jaipaul Cheernam
0 siblings, 2 replies; 3+ messages in thread
From: Jaipaul Cheernam @ 2026-07-16 8:54 UTC (permalink / raw)
To: openembedded-core
From: Hongxu Jia <hongxu.jia@windriver.com>
According to [1]
As of the current version 1.0.8, bzip2 --version will print version
info but it will also continue compressing stdin:
$ ./bzip2 --version
bzip2, a block-sorting file compressor. Version 1.0.8, 13-Jul-2019.
Copyright (C) 1996-2019 by Julian Seward.
This program is free software; [...]
bzip2: I won't write compressed data to a terminal.
bzip2: For help, type: `bzip2 --help'.
Debian (and its downstreams like Ubuntu) will patch this out [2],
making the < /dev/null unnecessary, port a part of debian patch
to fix the issue
[1] https://stackoverflow.com/questions/59757176/why-using-dev-null-with-a-program-like-bzip2
[2] https://sources.debian.org/src/bzip2/1.0.8-6/debian/patches/20-legacy.patch/
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit ae4fe4263ba9d372f9b9e80df4ec4697b51c1f9b)
Signed-off-by: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
---
...-fix-bzip2-version-tmp-aaa-will-hang.patch | 62 +++++++++++++++++++
meta/recipes-extended/bzip2/bzip2_1.0.8.bb | 1 +
2 files changed, 63 insertions(+)
create mode 100644 meta/recipes-extended/bzip2/bzip2/0001-fix-bzip2-version-tmp-aaa-will-hang.patch
diff --git a/meta/recipes-extended/bzip2/bzip2/0001-fix-bzip2-version-tmp-aaa-will-hang.patch b/meta/recipes-extended/bzip2/bzip2/0001-fix-bzip2-version-tmp-aaa-will-hang.patch
new file mode 100644
index 0000000000..84206b2a4d
--- /dev/null
+++ b/meta/recipes-extended/bzip2/bzip2/0001-fix-bzip2-version-tmp-aaa-will-hang.patch
@@ -0,0 +1,62 @@
+From a9dd6acbaca836fc4e943e69a31b2e7acda32045 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Wed, 13 Nov 2024 19:49:23 +0800
+Subject: [PATCH] fix 'bzip2 --version > /tmp/aaa 2>&1' hang
+
+According to [1]
+
+As of the current version 1.0.8, bzip2 --version will print version
+info but it will also continue compressing stdin:
+
+ $ ./bzip2 --version
+ bzip2, a block-sorting file compressor. Version 1.0.8, 13-Jul-2019.
+
+ Copyright (C) 1996-2019 by Julian Seward.
+
+ This program is free software; [...]
+
+ bzip2: I won't write compressed data to a terminal.
+ bzip2: For help, type: `bzip2 --help'.
+
+Debian (and its downstreams like Ubuntu) will patch this out [2],
+making the < /dev/null unnecessary:
+
+[1] https://stackoverflow.com/questions/59757176/why-using-dev-null-with-a-program-like-bzip2
+[2] https://sources.debian.org/src/bzip2/1.0.8-6/debian/patches/20-legacy.patch/
+
+Upstream-Status: Submitted [bzip2-devel@sourceware.org]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ bzip2.c | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/bzip2.c b/bzip2.c
+index d95d280..6ec9871 100644
+--- a/bzip2.c
++++ b/bzip2.c
+@@ -1890,7 +1890,9 @@ IntNative main ( IntNative argc, Char *argv[] )
+ case '8': blockSize100k = 8; break;
+ case '9': blockSize100k = 9; break;
+ case 'V':
+- case 'L': license(); break;
++ case 'L': license();
++ exit ( 0 );
++ break;
+ case 'v': verbosity++; break;
+ case 'h': usage ( progName );
+ exit ( 0 );
+@@ -1916,8 +1918,8 @@ IntNative main ( IntNative argc, Char *argv[] )
+ if (ISFLAG("--keep")) keepInputFiles = True; else
+ if (ISFLAG("--small")) smallMode = True; else
+ if (ISFLAG("--quiet")) noisy = False; else
+- if (ISFLAG("--version")) license(); else
+- if (ISFLAG("--license")) license(); else
++ if (ISFLAG("--version")) { license(); exit ( 0 ); } else
++ if (ISFLAG("--license")) { license(); exit ( 0 ); } else
+ if (ISFLAG("--exponential")) workFactor = 1; else
+ if (ISFLAG("--repetitive-best")) redundant(aa->name); else
+ if (ISFLAG("--repetitive-fast")) redundant(aa->name); else
+--
+2.34.1
+
diff --git a/meta/recipes-extended/bzip2/bzip2_1.0.8.bb b/meta/recipes-extended/bzip2/bzip2_1.0.8.bb
index f922490868..fa205edbb0 100644
--- a/meta/recipes-extended/bzip2/bzip2_1.0.8.bb
+++ b/meta/recipes-extended/bzip2/bzip2_1.0.8.bb
@@ -26,6 +26,7 @@ SRC_URI = "https://sourceware.org/pub/${BPN}/${BPN}-${PV}.tar.gz \
file://configure.ac;subdir=${BP} \
file://Makefile.am;subdir=${BP} \
file://run-ptest \
+ file://0001-fix-bzip2-version-tmp-aaa-will-hang.patch;subdir=${BP} \
"
SRC_URI[md5sum] = "67e051268d0c475ea773822f7500d0e5"
SRC_URI[sha256sum] = "ab5a03176ee106d3f0fa90e381da478ddae405918153cca248e682cd0c4a2269"
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [OE-core] [scarthgap][PATCH] bzip2: fix 'bzip2 --version > /tmp/aaa 2>&1' hang
2026-07-16 8:54 [scarthgap][PATCH] bzip2: fix 'bzip2 --version > /tmp/aaa 2>&1' hang Jaipaul Cheernam
@ 2026-07-23 8:46 ` Yoann Congal
2026-07-23 9:26 ` [scarthgap][PATCH v2] " Jaipaul Cheernam
1 sibling, 0 replies; 3+ messages in thread
From: Yoann Congal @ 2026-07-23 8:46 UTC (permalink / raw)
To: jaipaul.cheernam, openembedded-core
Hello,
Following up on Paul's review:
https://lore.kernel.org/all/333e485ec6c7e75b8bdbbd18d85398afb8079828.camel@pbarker.dev/T/#m03bd736e6e764ed3eb653941a1a42dd762769077
While this is a backport from master, we need a little bit more info for
merging this into stable.
On Thu Jul 16, 2026 at 10:54 AM CEST, Jaipaul Cheernam via lists.openembedded.org wrote:
> From: Hongxu Jia <hongxu.jia@windriver.com>
>
> According to [1]
>
> As of the current version 1.0.8, bzip2 --version will print version
> info but it will also continue compressing stdin:
Is this something new in 1.0.8 or did it always behaved this way?
>
> $ ./bzip2 --version
> bzip2, a block-sorting file compressor. Version 1.0.8, 13-Jul-2019.
>
> Copyright (C) 1996-2019 by Julian Seward.
>
> This program is free software; [...]
>
> bzip2: I won't write compressed data to a terminal.
> bzip2: For help, type: `bzip2 --help'.
>
> Debian (and its downstreams like Ubuntu) will patch this out [2],
> making the < /dev/null unnecessary, port a part of debian patch
> to fix the issue
>
> [1] https://stackoverflow.com/questions/59757176/why-using-dev-null-with-a-program-like-bzip2
> [2] https://sources.debian.org/src/bzip2/1.0.8-6/debian/patches/20-legacy.patch/
>
> Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> (cherry picked from commit ae4fe4263ba9d372f9b9e80df4ec4697b51c1f9b)
^ Add the added info here in your v2 commit message.
> Signed-off-by: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
> ---
> ...-fix-bzip2-version-tmp-aaa-will-hang.patch | 62 +++++++++++++++++++
> meta/recipes-extended/bzip2/bzip2_1.0.8.bb | 1 +
> 2 files changed, 63 insertions(+)
> create mode 100644 meta/recipes-extended/bzip2/bzip2/0001-fix-bzip2-version-tmp-aaa-will-hang.patch
>
> diff --git a/meta/recipes-extended/bzip2/bzip2/0001-fix-bzip2-version-tmp-aaa-will-hang.patch b/meta/recipes-extended/bzip2/bzip2/0001-fix-bzip2-version-tmp-aaa-will-hang.patch
> new file mode 100644
> index 0000000000..84206b2a4d
> --- /dev/null
> +++ b/meta/recipes-extended/bzip2/bzip2/0001-fix-bzip2-version-tmp-aaa-will-hang.patch
> @@ -0,0 +1,62 @@
> +From a9dd6acbaca836fc4e943e69a31b2e7acda32045 Mon Sep 17 00:00:00 2001
> +From: Hongxu Jia <hongxu.jia@windriver.com>
> +Date: Wed, 13 Nov 2024 19:49:23 +0800
> +Subject: [PATCH] fix 'bzip2 --version > /tmp/aaa 2>&1' hang
> +
> +According to [1]
> +
> +As of the current version 1.0.8, bzip2 --version will print version
> +info but it will also continue compressing stdin:
> +
> + $ ./bzip2 --version
> + bzip2, a block-sorting file compressor. Version 1.0.8, 13-Jul-2019.
> +
> + Copyright (C) 1996-2019 by Julian Seward.
> +
> + This program is free software; [...]
> +
> + bzip2: I won't write compressed data to a terminal.
> + bzip2: For help, type: `bzip2 --help'.
> +
> +Debian (and its downstreams like Ubuntu) will patch this out [2],
> +making the < /dev/null unnecessary:
> +
> +[1] https://stackoverflow.com/questions/59757176/why-using-dev-null-with-a-program-like-bzip2
> +[2] https://sources.debian.org/src/bzip2/1.0.8-6/debian/patches/20-legacy.patch/
> +
> +Upstream-Status: Submitted [bzip2-devel@sourceware.org]
Change this to a more precise URL (I think sourceware has publicly
accessible archives). I'd really like to check why it has not merged, if
it received comments, etc.
Please send a v2 with the above changes.
Thanks!
--
Yoann Congal
Smile ECS
^ permalink raw reply [flat|nested] 3+ messages in thread
* [scarthgap][PATCH v2] bzip2: fix 'bzip2 --version > /tmp/aaa 2>&1' hang
2026-07-16 8:54 [scarthgap][PATCH] bzip2: fix 'bzip2 --version > /tmp/aaa 2>&1' hang Jaipaul Cheernam
2026-07-23 8:46 ` [OE-core] " Yoann Congal
@ 2026-07-23 9:26 ` Jaipaul Cheernam
1 sibling, 0 replies; 3+ messages in thread
From: Jaipaul Cheernam @ 2026-07-23 9:26 UTC (permalink / raw)
To: openembedded-core
From: Hongxu Jia <hongxu.jia@windriver.com>
According to [1]
As of the current version 1.0.8, bzip2 --version will print version
info but it will also continue compressing stdin:
$ ./bzip2 --version
bzip2, a block-sorting file compressor. Version 1.0.8, 13-Jul-2019.
Copyright (C) 1996-2019 by Julian Seward.
This program is free software; [...]
bzip2: I won't write compressed data to a terminal.
bzip2: For help, type: `bzip2 --help'.
This is a long-standing bug, not new to 1.0.8 -- the same code
(license() followed by break, with no exit) exists in bzip2 1.0.6 and
earlier. The upstream bzip2 master branch on GitLab already includes
this fix.
Debian (and its downstreams like Ubuntu) will patch this out [2],
making the < /dev/null unnecessary, port a part of debian patch
to fix the issue
[1] https://stackoverflow.com/questions/59757176/why-using-dev-null-with-a-program-like-bzip2
[2] https://sources.debian.org/src/bzip2/1.0.8-6/debian/patches/20-legacy.patch/
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit ae4fe4263ba9d372f9b9e80df4ec4697b51c1f9b)
[Jaipaul: backport to scarthgap -- added commit message context that this is a
long-standing bug (not new to 1.0.8), updated Upstream-Status in patch
to actual mailing list URL in the patch file, this patch is already present on master,
wrynose and walnascar branches using the same bzip2 1.0.8]
Signed-off-by: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
---
...-fix-bzip2-version-tmp-aaa-will-hang.patch | 65 +++++++++++++++++++
meta/recipes-extended/bzip2/bzip2_1.0.8.bb | 1 +
2 files changed, 66 insertions(+)
create mode 100644 meta/recipes-extended/bzip2/bzip2/0001-fix-bzip2-version-tmp-aaa-will-hang.patch
diff --git a/meta/recipes-extended/bzip2/bzip2/0001-fix-bzip2-version-tmp-aaa-will-hang.patch b/meta/recipes-extended/bzip2/bzip2/0001-fix-bzip2-version-tmp-aaa-will-hang.patch
new file mode 100644
index 0000000000..2d02328d11
--- /dev/null
+++ b/meta/recipes-extended/bzip2/bzip2/0001-fix-bzip2-version-tmp-aaa-will-hang.patch
@@ -0,0 +1,65 @@
+From a9dd6acbaca836fc4e943e69a31b2e7acda32045 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Wed, 13 Nov 2024 19:49:23 +0800
+Subject: [PATCH] fix 'bzip2 --version > /tmp/aaa 2>&1' hang
+
+According to [1]
+
+As of the current version 1.0.8, bzip2 --version will print version
+info but it will also continue compressing stdin:
+
+ $ ./bzip2 --version
+ bzip2, a block-sorting file compressor. Version 1.0.8, 13-Jul-2019.
+
+ Copyright (C) 1996-2019 by Julian Seward.
+
+ This program is free software; [...]
+
+ bzip2: I won't write compressed data to a terminal.
+ bzip2: For help, type: `bzip2 --help'.
+
+Debian (and its downstreams like Ubuntu) will patch this out [2],
+making the < /dev/null unnecessary:
+
+[1] https://stackoverflow.com/questions/59757176/why-using-dev-null-with-a-program-like-bzip2
+[2] https://sources.debian.org/src/bzip2/1.0.8-6/debian/patches/20-legacy.patch/
+
+Upstream-Status: Submitted [https://sourceware.org/pipermail/bzip2-devel/2024q4/000234.html]
+Note: updated Upstream-Status URL to point to the actual mailing list
+archive entry.
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+Signed-off-by: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
+---
+ bzip2.c | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/bzip2.c b/bzip2.c
+index d95d280..6ec9871 100644
+--- a/bzip2.c
++++ b/bzip2.c
+@@ -1890,7 +1890,9 @@ IntNative main ( IntNative argc, Char *argv[] )
+ case '8': blockSize100k = 8; break;
+ case '9': blockSize100k = 9; break;
+ case 'V':
+- case 'L': license(); break;
++ case 'L': license();
++ exit ( 0 );
++ break;
+ case 'v': verbosity++; break;
+ case 'h': usage ( progName );
+ exit ( 0 );
+@@ -1916,8 +1918,8 @@ IntNative main ( IntNative argc, Char *argv[] )
+ if (ISFLAG("--keep")) keepInputFiles = True; else
+ if (ISFLAG("--small")) smallMode = True; else
+ if (ISFLAG("--quiet")) noisy = False; else
+- if (ISFLAG("--version")) license(); else
+- if (ISFLAG("--license")) license(); else
++ if (ISFLAG("--version")) { license(); exit ( 0 ); } else
++ if (ISFLAG("--license")) { license(); exit ( 0 ); } else
+ if (ISFLAG("--exponential")) workFactor = 1; else
+ if (ISFLAG("--repetitive-best")) redundant(aa->name); else
+ if (ISFLAG("--repetitive-fast")) redundant(aa->name); else
+--
+2.34.1
+
diff --git a/meta/recipes-extended/bzip2/bzip2_1.0.8.bb b/meta/recipes-extended/bzip2/bzip2_1.0.8.bb
index b661bc9546..6c02dc3ed0 100644
--- a/meta/recipes-extended/bzip2/bzip2_1.0.8.bb
+++ b/meta/recipes-extended/bzip2/bzip2_1.0.8.bb
@@ -27,6 +27,7 @@ SRC_URI = "https://sourceware.org/pub/${BPN}/${BPN}-${PV}.tar.gz \
file://Makefile.am;subdir=${BP} \
file://run-ptest \
file://CVE-2026-42250.patch;subdir=${BP} \
+ file://0001-fix-bzip2-version-tmp-aaa-will-hang.patch;subdir=${BP} \
"
SRC_URI[md5sum] = "67e051268d0c475ea773822f7500d0e5"
SRC_URI[sha256sum] = "ab5a03176ee106d3f0fa90e381da478ddae405918153cca248e682cd0c4a2269"
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-07-23 9:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-16 8:54 [scarthgap][PATCH] bzip2: fix 'bzip2 --version > /tmp/aaa 2>&1' hang Jaipaul Cheernam
2026-07-23 8:46 ` [OE-core] " Yoann Congal
2026-07-23 9:26 ` [scarthgap][PATCH v2] " Jaipaul Cheernam
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox