Bug 1894917

Summary: urxvt-unicode crashes while exit.
Product: [Fedora] Fedora Reporter: olegon.ru <olegon>
Component: rxvt-unicodeAssignee: Robbie Harwood <rharwood>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 33CC: amurdaca, andreas.bierfert, caillon+fedoraproject, dcantrell, iarnell, jplesnik, kasal, mmaslano, muks, olegon, perl-devel, ppisar, psabata, rharwood, rhughes, sandmann, spotrh
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-12-03 13:46:03 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description olegon.ru 2020-11-05 12:33:54 UTC
Fedora 33 Gnome / Xorg
Every time, I exited from urxvt, it's crashed... 

ноя 05 15:30:59 oops.olegon.ru systemd[915]: Started Application launched by gsd-media-keys.
ноя 05 15:31:01 oops.olegon.ru kernel: urxvt[144153]: segfault at 558fcd0e8d2e ip 00007f18bf944abd sp 00007ffea8b5ea20 error 4 in libc-2.32.so[7f18bf92b000+14f000]
ноя 05 15:31:01 oops.olegon.ru kernel: Code: fe ff 49 83 c5 02 41 0f b7 6d fe 49 89 c6 4c 8d 78 fe 4d 85 e4 75 13 eb cc 0f 1f 40 00 4c 8b 63 08 48 83 c3 08 4d 85 e4 74 bb <66> 41 3b 2c 24 75 ec 49 8d 7c 24 02 4c 89 fa 4c 89 ee e8 ec 6a fe
ноя 05 15:31:01 oops.olegon.ru systemd[1]: Started Process Core Dump (PID 144193/UID 0).
ноя 05 15:31:01 oops.olegon.ru systemd[915]: app-gnome-urxvt-144153.scope: Succeeded.
ноя 05 15:31:01 oops.olegon.ru systemd-coredump[144194]: [🡕] Process 144153 (urxvt) of user 1000 dumped core.
                                                            
                                                            Stack trace of thread 144153:
                                                            #0  0x00007f18bf944abd getenv (libc.so.6 + 0x3fabd)
                                                            #1  0x00007f18bfe98a83 perl_destruct (libperl.so.5.32 + 0x77a83)
                                                            #2  0x0000558a93d47105 _ZN16rxvt_perl_interpD1Ev (urxvt + 0x46105)
                                                            #3  0x00007f18bf945427 __run_exit_handlers (libc.so.6 + 0x40427)
                                                            #4  0x00007f18bf9455d0 exit (libc.so.6 + 0x405d0)
                                                            #5  0x00007f18bf92d1a9 __libc_start_main (libc.so.6 + 0x281a9)
                                                            #6  0x0000558a93d238ce _start (urxvt + 0x228ce)
ноя 05 15:31:01 oops.olegon.ru systemd[1]: systemd-coredump: Succeeded.

Comment 1 Robbie Harwood 2020-11-06 17:27:45 UTC
Hmm, calling getenv() below exit() doesn't seem like a great idea.  Handing to the perl folks to take a look, but maybe we'll need input from libc folks too.

Comment 2 Petr Pisar 2020-11-09 10:57:38 UTC
What's wrong with getenv() in an atexit() callback? Shouldn't rather urxwt properly desctruct perl interpreter before calling exit()?

Comment 3 Petr Pisar 2020-11-09 11:24:23 UTC
I have:

# rpm -q rxvt-unicode perl-libs glibc
rxvt-unicode-9.22-25.fc33.x86_64
perl-libs-5.32.0-463.fc33.x86_64
glibc-2.32-1.fc33.x86_64

I cannot reproduce with executing "rxvt -e /bin/true" from an interactive shell. I can reproduce it when executing it from a non-interactive SSH session.

Comment 4 Petr Pisar 2020-11-09 11:52:06 UTC
It's a known bug in rxvt-unicode <http://lists.schmorp.de/pipermail/rxvt-unicode/2020q2/002583.html>. It initializes perl interpreter (PERL_SYS_INIT3() call) with a private environment copy (localise_env set_environ() call) in rxvt_perl_interp::init(), but then the private copy is deallocated before perl interpreter, which calls getenv() by accident, is destructed (perl_destruct() call in rxvt_perl_interp::~rxvt_perl_interp()). rxvt-unicode upstream is going to remove perl_destruct() call because any library, not only perl interpretr, can call getenv() at exit.

Comment 5 Robbie Harwood 2020-11-10 16:39:14 UTC
Thanks Petr.  Apologies for the noise.

Comment 6 Fedora Update System 2020-11-10 17:07:41 UTC
FEDORA-2020-6a8efe1256 has been submitted as an update to Fedora 33. https://bodhi.fedoraproject.org/updates/FEDORA-2020-6a8efe1256

Comment 7 Fedora Update System 2020-11-11 02:20:15 UTC
FEDORA-2020-6a8efe1256 has been pushed to the Fedora 33 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-6a8efe1256`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-6a8efe1256

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 8 Mukund Sivaraman 2020-11-29 16:54:18 UTC
Please can you push the package to stable now? It appears to be ready.

https://bodhi.fedoraproject.org/updates/FEDORA-2020-6a8efe1256

Comment 9 Fedora Update System 2020-12-02 01:37:44 UTC
FEDORA-2020-6a8efe1256 has been pushed to the Fedora 33 stable repository.
If problem still persists, please make note of it in this bug report.