Bug 1226493 - zypper sh (zypper shell) hangs forever waiting for return on ^C
Summary: zypper sh (zypper shell) hangs forever waiting for return on ^C
Status: RESOLVED FIXED
Alias: None
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: libzypp (show other bugs)
Version: Current
Hardware: Other All
: P5 - None : Minor (vote)
Target Milestone: ---
Assignee: E-mail List
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-06-18 18:08 UTC by Andreas Stieger
Modified: 2024-07-02 15:00 UTC (History)
1 user (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Stieger 2024-06-18 18:08:15 UTC
rpm -q zypper libzypp
zypper-1.14.73-1.2.x86_64
libzypp-17.34.1-1.1.x86_64

zypper shell exists fine:

$ zypper sh
zypper> exit
$ zypper sh
zypper> exit

Pressing CTRL-C hangs it:

$ zypper sh
zypper> ^C
Trying to exit gracefully...

Pressing CTRL-C again:
^C
Zypper is currently cleaning up, exiting as soon as possible.
^C
Zypper is currently cleaning up, exiting as soon as possible.
^C
Zypper is currently cleaning up, exiting as soon as possible.


Pressing return here exits. This is surprising.

gdb --args zypper sh
GNU gdb (GDB; openSUSE Tumbleweed) 13.2
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-suse-linux".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://bugs.opensuse.org/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from zypper...
Reading symbols from /usr/lib/debug/usr/bin/zypper.debug...
(gdb) run
Starting program: /usr/bin/zypper sh
Missing separate debuginfos, use: zypper install glibc-debuginfo-2.39-9.1.x86_64
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
[New Thread 0x7ffff5dc96c0 (LWP 23573)]
[Detaching after fork from child process 23574]
[Detaching after fork from child process 23576]
[Detaching after fork from child process 23578]
[Detaching after fork from child process 23580]
[Detaching after fork from child process 23582]
[Detaching after fork from child process 23584]
[Detaching after fork from child process 23586]
[Detaching after fork from child process 23594]
[Detaching after fork from child process 23596]
zypper>
Thread 1 "Zypp-main" received signal SIGINT, Interrupt.
0x00007ffff74a7821 in pselect () from /lib64/libc.so.6
Missing separate debuginfos, use: zypper install krb5-debuginfo-1.21.2-5.1.x86_64 libabsl_lite_2401_0_0-debuginfo-20240116.2-2.1.x86_64 libacl1-debuginfo-2.3.2-2.1.x86_64 libassuan0-debuginfo-2.5.7-1.1.x86_64 libaugeas0-debuginfo-1.14.1-1.3.x86_64 libboost_thread1_85_0-debuginfo-1.85.0-1.2.x86_64 libbrotlicommon1-debuginfo-1.1.0-1.3.x86_64 libbrotlidec1-debuginfo-1.1.0-1.3.x86_64 libcap2-debuginfo-2.70-1.1.x86_64 libcom_err2-debuginfo-1.47.0-4.2.x86_64 libcurl4-debuginfo-8.8.0-1.1.x86_64 libfa1-debuginfo-1.14.1-1.3.x86_64 libgcc_s1-debuginfo-14.1.0+git10173-1.1.x86_64 libgcrypt20-debuginfo-1.10.3-3.3.x86_64 libglib-2_0-0-debuginfo-2.80.3-1.1.x86_64 libgpg-error0-debuginfo-1.49-1.1.x86_64 libidn2-0-debuginfo-2.3.7-1.2.x86_64 libkeyutils1-debuginfo-1.6.3-7.2.x86_64 libldap2-debuginfo-2.6.7-2.1.x86_64 liblua5_4-5-debuginfo-5.4.6-3.3.x86_64 liblzma5-debuginfo-5.6.2-1.1.x86_64 libncurses6-debuginfo-6.5.20240608-39.1.x86_64 libnghttp2-14-debuginfo-1.61.0-1.1.x86_64 libopenssl3-debuginfo-3.1.4-9.1.x86_64 libpcre2-8-0-debuginfo-10.43-3.1.x86_64 libpopt0-debuginfo-1.19-1.8.x86_64 libprotobuf-lite25_3_0-debuginfo-25.3-11.2.x86_64 libreadline8-debuginfo-8.2.10-1.3.x86_64 libsasl2-3-debuginfo-2.1.28-8.1.x86_64 libselinux1-debuginfo-3.6-1.3.x86_64 libsigc-2_0-0-debuginfo-2.12.1-2.3.x86_64 libssh4-debuginfo-0.10.6-2.1.x86_64 libstdc++6-debuginfo-14.1.0+git10173-1.1.x86_64 libudev1-debuginfo-255.7-2.1.x86_64 libunistring5-debuginfo-1.2-1.1.x86_64 libxml2-2-debuginfo-2.12.8-1.1.x86_64 libyaml-cpp0_8-debuginfo-0.8.0-1.3.x86_64 libz1-debuginfo-1.3.1-1.1.x86_64 libzck1-debuginfo-1.4.0-2.1.x86_64 libzstd1-debuginfo-1.5.6-1.1.x86_64 libzypp-debuginfo-17.34.1-1.1.x86_64 rpm-debuginfo-4.19.1.1-3.2.x86_64
(gdb) bt
#0  0x00007ffff74a7821 in pselect () from /lib64/libc.so.6
#1  0x00007ffff7a1823c in _rl_timeout_select () from /lib64/libreadline.so.8
#2  0x00007ffff7a1bbaa in rl_getc () from /lib64/libreadline.so.8
#3  0x00007ffff7a1b4fd in rl_read_key () from /lib64/libreadline.so.8
#4  0x00007ffff79fff63 in readline_internal_char () from /lib64/libreadline.so.8
#5  0x00007ffff7a08f75 in readline () from /lib64/libreadline.so.8
#6  0x000055555570a0cc in ztui::readline_getline[abi:cxx11]() ()
    at /usr/src/debug/libzypp-17.34.0/zypp-tui/utils/console.cc:32
#7  0x00005555555f692a in Zypper::commandShell (this=0x555555782780 <Zypper::instance(bool)::_instance>)
    at /usr/src/debug/zypper-1.14.73/src/Zypper.cc:405
#8  0x0000555555675e98 in ShellCmd::execute (this=<optimized out>, zypper=...)
    at /usr/src/debug/zypper-1.14.73/src/commands/shell.cc:42
#9  0x000055555562d5b8 in ZypperBaseCommand::run (this=0x5555557fd7a0, zypper=...)
    at /usr/src/debug/zypper-1.14.73/src/commands/basecommand.cc:253
#10 0x00005555555f63cb in Zypper::doCommand (this=0x555555782780 <Zypper::instance(bool)::_instance>, cmdArgc=2,
    cmdArgv=<optimized out>, firstFlag=<optimized out>) at /usr/src/debug/zypper-1.14.73/src/Zypper.cc:688
#11 0x00005555555c41a5 in Zypper::main (argv=0x7fffffffe198, argc=2,
    this=0x555555782780 <Zypper::instance(bool)::_instance>) at /usr/src/debug/zypper-1.14.73/src/Zypper.cc:213
#12 main (argc=2, argv=0x7fffffffe198) at /usr/src/debug/zypper-1.14.73/src/main.cc:163
(gdb)
Comment 1 Felix Miata 2024-06-19 05:34:33 UTC
I've been known to press the reset button rather than allow zypper proceed in spite of Ctrl-C X2, but might not this depend on rpm behavior on attempt to interrupt it?
Comment 2 Michael Andres 2024-06-19 08:25:08 UTC
(In reply to Felix Miata from comment #1)
> I've been known to press the reset button rather than allow zypper proceed
> in spite of Ctrl-C X2, but might not this depend on rpm behavior on attempt
> to interrupt it?

No, there's no rpm transaction in progress.
(which should not be interrupted, neither by Ctrl-C nor a reset)

It appears to be the shell prompt which does not respond.
Comment 3 Michael Andres 2024-06-19 14:25:46 UTC
Workaround AFAICS is to press ENTER.
Comment 4 Michael Andres 2024-06-24 12:08:29 UTC
https://github.com/openSUSE/zypper/pull/554
Comment 5 Michael Andres 2024-06-25 08:30:53 UTC
fixed in zypper-1.14.74