FS#67691 - [rxvt-unicode] urxvt segmentation fault (core dumped)

Attached to Project: Community Packages
Opened by John (graysky) - Sunday, 23 August 2020, 19:28 GMT
Last edited by Antonio Rojas (arojas) - Saturday, 15 May 2021, 17:47 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Levente Polyak (anthraxx)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 19
Private No

Details

I am getting consistent core dumps. Verified on two different machines. I attach an strace of the below command. Is this consistent for others as well?

% urxvt --geometry 120x30 -e bash -c "sleep 1s"
[1] 164344 segmentation fault (core dumped) urxvt --geometry 120x30 -e bash -c "sleep 1s"
This task depends upon

Closed by  Antonio Rojas (arojas)
Saturday, 15 May 2021, 17:47 GMT
Reason for closing:  Fixed
Comment by Ciriaco Garcia de Celis (cgarcia) - Monday, 24 August 2020, 19:07 GMT
I have reproduced it by upgrading only the following two packages:

glibc-2.32-2
lib32-glibc-2.32-2

The core stack trace reports the crash in rxvt_perl_interp::~rxvt_perl_interp() ()

A workaround which works for me is to disable the perl extensions with the wiki recipe, by adding the following to .Xdefaults:

URxvt.perl-ext:
URxvt.perl-ext-common:
Comment by John (graysky) - Monday, 24 August 2020, 20:24 GMT
@cgarcia - Works for me, thank you for sharing it. Not sure that work around addresses the actual error or if the error is with something in our packaging or upstream.

@anthraxx - Please let me know if I need to report upstream.
Comment by Dmytro Bagrii (dimich) - Monday, 24 August 2020, 23:34 GMT
I get following backtrace in core dump on urxvt exit:

Stack trace of thread 48784:
#0 0x00007fd345c4a4ed getenv (libc.so.6 + 0x3f4ed)
#1 0x00007fd345e695c6 perl_destruct (libperl.so + 0x735c6)
#2 0x0000563f4916e336 _ZN16rxvt_perl_interpD1Ev (urxvt + 0x4d336)
#3 0x00007fd345c4adb7 __run_exit_handlers (libc.so.6 + 0x3fdb7)
#4 0x00007fd345c4af5e exit (libc.so.6 + 0x3ff5e)
#5 0x00007fd345c33159 __libc_start_main (libc.so.6 + 0x28159)
#6 0x0000563f4914fcfe _start (urxvt + 0x2ecfe)

Workaround with .Xdefaults works for me too, thanks.
Comment by Nikolaos Bezirgiannis (bezirg) - Wednesday, 26 August 2020, 17:16 GMT
I also get crashes with dumped-core for urxvt consistently. I don't know if it is related to this bug, but since some days I started getting crashes with dumped core on even larger programs (e.g. Xorg, polkitd, emacs)
Comment by Dave Reisner (falconindy) - Wednesday, 26 August 2020, 17:33 GMT
This is already fixed upstream, but there's not been a release made.
Comment by Nikolaos Bezirgiannis (bezirg) - Wednesday, 26 August 2020, 18:09 GMT
@falconindy - is it related to the  FS#67715  bug? https://bugs.archlinux.org/task/67715
Comment by Dave Reisner (falconindy) - Wednesday, 26 August 2020, 18:26 GMT Comment by Victor Bistak (vicbis) - Monday, 31 August 2020, 00:18 GMT

This is really odd.
If PERL_DESTRUCT_LEVEL is set and OLDPWD is set then it does not crash.

vicb@emily [ ~ ]$ env | grep OLD
vicb@emily [ ~ ]$ env | grep PERL_DESTRUCT_LEVEL
PERL_DESTRUCT_LEVEL=2
vicb@emily [ ~ ]$ urxvt --geometry 120x30 -e bash -c "sleep 1s"
Segmentation fault (core dumped)
vicb@emily [ ~ ]$ cd
vicb@emily [ ~ ]$ env | grep OLD
OLDPWD=/home/vicb
vicb@emily [ ~ ]$ urxvt --geometry 120x30 -e bash -c "sleep 1s"
vicb@emily [ ~ ]$ unset PERL_DESTRUCT_LEVEL
vicb@emily [ ~ ]$ env | grep OLD
OLDPWD=/home/vicb
vicb@emily [ ~ ]$ urxvt --geometry 120x30 -e bash -c "sleep 1s"
Segmentation fault (core dumped)
vicb@emily [ ~ ]$
Comment by Daniele (vbextreme) - Wednesday, 13 January 2021, 10:16 GMT
in the perl code: https://github.com/Perl/perl5/blob/6009d3e4b52c5c4f38ca24a89be6e74482ba6af9/miniperlmain.c#L138 it is said that it cannot be called atexit if there is not at least one perl environment
one enviroment must be set to avoid segfault
$ man perlrun
find section ENVIROMENT.
for example can set PERL5SHELL that used only on windows and not have effect on linux
PERL5SHELL="blahwindows" urxvt
this run ok
Comment by Daniel (archsoft) - Wednesday, 20 January 2021, 14:52 GMT
For me it didn't help.

$ export PERL5SHELL="blahwindows"
$ gdb urxvt
(gdb) run
Starting program: /usr/bin/urxvt
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[Detaching after fork from child process 4155]

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff77534ed in getenv () from /usr/lib/libc.so.6
(gdb) bt
#0 0x00007ffff77534ed in getenv () from /usr/lib/libc.so.6
#1 0x00007ffff79725c6 in perl_destruct () from /usr/lib/perl5/5.32/core_perl/CORE/libperl.so
#2 0x00005555555a1336 in rxvt_perl_interp::~rxvt_perl_interp() ()
#3 0x00007ffff7753db7 in __run_exit_handlers () from /usr/lib/libc.so.6
#4 0x00007ffff7753f5e in exit () from /usr/lib/libc.so.6
#5 0x00007ffff773c159 in __libc_start_main () from /usr/lib/libc.so.6
#6 0x0000555555582cfe in _start ()


PERL_DESTRUCT_LEVEL and OLDPWD didn't work for me, too.
Comment by kmille (kmille) - Thursday, 28 January 2021, 20:50 GMT
More information about the bug
- https://bugzilla.redhat.com/show_bug.cgi?id=1894917
- http://lists.schmorp.de/pipermail/rxvt-unicode/2020q2/002583.html


This should fix the issue. We can add the patch the the PKGBUILD.
asp checkout rxvt-unicode
cd rxvt-unicode/repos/community-x86_64
makepkg --nobuild
patch -p1 < /tmp/urxvt.diff
makepkg -i --noextract


kmille@linbox:~ cat /tmp/urxvt.diff
diff --git a/src/rxvt-unicode-9.22/src/rxvtperl.xs b/src/rxvt-unicode-9.22/src/rxvtperl.xs
index 9c75aad..77449e9 100644
--- a/src/rxvt-unicode-9.22/src/rxvtperl.xs
+++ b/src/rxvt-unicode-9.22/src/rxvtperl.xs
@@ -374,12 +374,6 @@ static PerlInterpreter *perl;

rxvt_perl_interp::~rxvt_perl_interp ()
{
- if (perl)
- {
- perl_destruct (perl);
- perl_free (perl);
- PERL_SYS_TERM ();
- }
}

void
Comment by kmille (kmille) - Tuesday, 02 February 2021, 09:33 GMT
Any willingness to apply the patch @anthraxx?
Comment by Vyaas (cable) - Wednesday, 31 March 2021, 15:59 GMT
@kmille
Thanks for the quick-fix. I can confirm that it works with my perl extensions.
Comment by . (-_-) - Saturday, 15 May 2021, 17:15 GMT
this can be closed now

Loading...