Bug 929826

Summary: zypper hangs on double Ctrl-C
Product: [openSUSE] openSUSE Tumbleweed Reporter: Bernhard Wiedemann <bwiedemann>
Component: libzyppAssignee: E-mail List <zypp-maintainers>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: jhura
Version: 201503*   
Target Milestone: ---   
Hardware: Other   
OS: openSUSE 13.2   
Whiteboard:
Found By: Development Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: backtraces from 2015-05-06 Factory zypper hangups
reproducer script
more hangup backtraces from current libzypp-15.2+zypper

Description Bernhard Wiedemann 2015-05-06 08:00:36 UTC
Created attachment 633369 [details]
backtraces from 2015-05-06 Factory zypper hangups

I ran a stress-test script on zypper
that started a package download+install
and at a random time hit Ctrl-C twice (sent SIGINT)
with a random delay between the two.

This sometimes caused zypper to get stuck.
Then it needed a killall -9 zypper
to end it.
Comment 1 Bernhard Wiedemann 2015-05-06 08:01:22 UTC
Created attachment 633370 [details]
reproducer script
Comment 2 Michael Andres 2015-05-06 09:48:17 UTC
*** Bug 929827 has been marked as a duplicate of this bug. ***
Comment 3 Bernhard Wiedemann 2015-05-19 13:08:06 UTC
Created attachment 634719 [details]
more hangup backtraces from current libzypp-15.2+zypper


https://github.com/openSUSE/zypper/pull/69 seems to fix the hangups and segfaults
Comment 4 Bernhard Wiedemann 2015-11-07 20:04:44 UTC
I can still trigger these hangups on current Tumbleweed with
zypper-1.12.22-1.1.x86_64
libzypp-15.19.3-1.1.x86_64

Happens e.g. with a wait of 0.9 seconds before the 2nd Ctrl-C
(on my fast laptop)
Comment 5 Michael Andres 2017-02-22 13:10:18 UTC
zypper-1.13.19 will leave the sighandler on the 2nd Ctrl-C. 
Back in the normal workflow, it tries to exit ASAP.

(More Ctrl-C however will exit immediately from within the handler).
Comment 6 Michael Andres 2017-04-21 08:00:30 UTC
Fixed in zypper-1.13.23

After rewriting the tmpdir and temp repo related stuff, there should be no more need for a complex cleanup. Now always using _exit(2) from within the signal handler. This should fix the sporadic crashes on double Ctrl-C.
Comment 7 Michael Andres 2017-04-21 08:00:58 UTC
*** Bug 1012597 has been marked as a duplicate of this bug. ***