Bug 1883982 - hexchat crashes on fedora 33 beta
Summary: hexchat crashes on fedora 33 beta
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: hexchat
Version: 33
Hardware: Unspecified
OS: Unspecified
unspecified
urgent
Target Milestone: ---
Assignee: Patrick Griffis
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-09-30 16:37 UTC by Simon Putt
Modified: 2021-01-03 01:11 UTC (History)
11 users (show)

Fixed In Version: hexchat-2.14.3-7.fc33
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-01-03 01:11:29 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Script causing the crash (17.61 KB, text/x-matlab)
2020-10-01 06:38 UTC, Simon Putt
no flags Details
hexchat.spec.diff (1.46 KB, patch)
2020-11-01 22:54 UTC, Viktor Ashirov
no flags Details | Diff
2.14.3_from_master.patch (119.31 KB, patch)
2020-11-01 22:55 UTC, Viktor Ashirov
no flags Details | Diff

Description Simon Putt 2020-09-30 16:37:05 UTC
Description of problem:

hexchat does not run after upgrading to Fedora 33 Beta Workstation

Version-Release number of selected component (if applicable):

hexchat 2.14.3

How reproducible:

always

Steps to Reproduce:
1. Upgrade to Fedora 33 Beta Workstation
2. Attempt to run Hexchat
3. Crashes SIGSEGV


Actual results:

Crash

Expected results:

To be able to chat on IRC

Additional info:

Comment 1 Kevin Fenzi 2020-09-30 20:34:07 UTC
Thanks for the bug report. 

Can you run hexchat from a terminal and copy all the output back to this report?

also can you run 'coredumpctl' and find the line with the most recent hexchat crash and do 'coredumpctl info NNNN' where NNNN is the number in the PID col for that line and paste that output back here also?

Thanks.

Comment 2 Simon Putt 2020-10-01 02:33:01 UTC
I did a backtrace with gdb if its helpful

Reading symbols from hexchat...
Reading symbols from /usr/lib/debug/usr/bin/hexchat-2.14.3-6.fc33.x86_64.debug...
(gdb) run
Starting program: /usr/bin/hexchat 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Gtk-Message: 03:13:40.532: Failed to load module "pk-gtk-module"
[New Thread 0x7fffe60d8640 (LWP 206730)]
[New Thread 0x7fffe58d7640 (LWP 206731)]
[New Thread 0x7fffe50d6640 (LWP 206732)]
[New Thread 0x7fffe48d5640 (LWP 206733)]
[Detaching after fork from child process 206735]

Thread 1 "hexchat" received signal SIGSEGV, Segmentation fault.
0x00007fffd6be3f44 in PyEval_ReleaseLock () from /lib64/libpython3.9.so.1.0
(gdb) bt
#0  0x00007fffd6be3f44 in PyEval_ReleaseLock () from /lib64/libpython3.9.so.1.0
#1  0x00007fffe66d43f0 in Util_ReleaseThread (tstate=<optimized out>) at ../plugins/python/python.c:559
#2  0x00007fffe66d4663 in Callback_Print (word=<optimized out>, userdata=0x555556244690) at ../plugins/python/python.c:753
#3  0x00005555555e23c3 in plugin_hook_run (sess=0x55555647a410, name=0x555555604be9 "Focus Tab", word=word@entry=0x7fffffffc0e0, 
    word_eol=word_eol@entry=0x0, attrs=attrs@entry=0x0, type=type@entry=8) at ../src/common/plugin.c:575
#4  0x00005555555e24ef in plugin_emit_dummy_print (sess=<optimized out>, name=<optimized out>) at ../src/common/plugin.c:667
#5  0x00005555555a8fb9 in mg_populate (sess=0x55555647a410) at ../src/fe-gtk/maingui.c:954
#6  0x000055555558b193 in cv_tree_sel_cb (sel=<optimized out>, cv=0x5555561b99f0) at ../src/fe-gtk/chanview-tree.c:52
#7  0x00007ffff7d9b632 in g_closure_invoke () from /lib64/libgobject-2.0.so.0
#8  0x00007ffff7dc4023 in signal_emit_unlocked_R.isra.0 () from /lib64/libgobject-2.0.so.0
#9  0x00007ffff7db8162 in g_signal_emit_valist () from /lib64/libgobject-2.0.so.0
#10 0x00007ffff7db837f in g_signal_emit () from /lib64/libgobject-2.0.so.0
#11 0x00007ffff7a16cda in gtk_tree_view_real_set_cursor.lto_priv () from /lib64/libgtk-x11-2.0.so.0
#12 0x00007ffff7a1b715 in gtk_tree_view_set_cursor_on_cell () from /lib64/libgtk-x11-2.0.so.0
#13 0x000055555558d790 in cv_tree_focus (ch=<optimized out>) at ../src/fe-gtk/chanview-tree.c:270
#14 0x000055555559bf7a in fe_new_window (sess=0x55555647a410, focus=<optimized out>) at ../src/fe-gtk/fe-gtk.c:444
#15 0x00005555555d2ded in session_new (serv=0x555556479800, from=0x0, type=1, focus=1) at ../src/common/hexchat.c:515
#16 0x00005555555d39c9 in new_ircwindow (serv=0x555556479800, name=0x0, type=1, focus=1) at ../src/common/hexchat.c:530
#17 0x00005555555f202b in servlist_connect (sess=0x0, net=0x555555753cb0, join=1) at ../src/common/servlist.c:390
#18 0x00005555555d2f06 in servlist_auto_connect (sess=0x0) at ../src/common/servlist.c:533
#19 xchat_auto_connect (userdata=<optimized out>) at ../src/common/hexchat.c:805
#20 0x00007ffff7caa0f7 in g_idle_dispatch () from /lib64/libglib-2.0.so.0
#21 0x00007ffff7caafd7 in g_main_context_dispatch () from /lib64/libglib-2.0.so.0
#22 0x00007ffff7cfbab8 in g_main_context_iterate.constprop () from /lib64/libglib-2.0.so.0
#23 0x00007ffff7caa6ab in g_main_loop_run () from /lib64/libglib-2.0.so.0
#24 0x00007ffff78f029a in gtk_main () from /lib64/libgtk-x11-2.0.so.0
#25 0x000055555559723d in fe_main () at ../src/fe-gtk/fe-gtk.c:347
#26 0x00005555555899e7 in main (argc=<optimized out>, argv=0x7fffffffcc50) at ../src/common/hexchat.c:1141
(gdb)

Comment 3 Simon Putt 2020-10-01 06:38:52 UTC
Created attachment 1718052 [details]
Script causing the crash

Comment 4 Simon Putt 2020-10-01 06:40:17 UTC
With it saying python was causing the crash, I renamed it so it would not get loaded and HexChat seems to work fine now, the script used to work no problems with Fedora 32.

Comment 5 Marc Muehlfeld 2020-10-05 10:05:54 UTC
I can confirm the problem. I can start Hexchat 2.14.3-6 on Fedora 33 beta. However, as soon as I run a /py command, Hexchat crashes.


Steps to reporduce:
1) Start Hexchat on Fedora 33 beta
2) Enter:
   /py exec import hexchat


Actual results:
Hexchat crashes


Expected results:
Hexchat should be able to run Python commands on F33, which uses Python 3.9.

Comment 6 Marc Muehlfeld 2020-10-05 12:41:25 UTC
I compiled Hexchat from upstream master on Fedora 33 beta, and this build works.
It seems the issue in 2.14.3 is fixed in master.

Can you create a new release and build the F33 RPM on it?

Comment 7 Kevin Fenzi 2020-10-05 17:12:45 UTC
Can you try the python plugin with this scratch build: http://koji.fedoraproject.org/koji/taskinfo?taskID=52817132 ?

Comment 8 Marc Muehlfeld 2020-10-06 06:54:24 UTC
(In reply to Kevin Fenzi from comment #7)
> Can you try the python plugin with this scratch build:
> http://koji.fedoraproject.org/koji/taskinfo?taskID=52817132 ?

Kevin, I tried your build, but same problem: Hexchat crashes right after you execute a Python command (see #5).

Isn't creating a new build from master an option? There the problem doesn't exist.

Comment 9 Kevin Fenzi 2020-11-01 17:24:07 UTC
(In reply to Marc Muehlfeld from comment #8)
> (In reply to Kevin Fenzi from comment #7)
> > Can you try the python plugin with this scratch build:
> > http://koji.fedoraproject.org/koji/taskinfo?taskID=52817132 ?
> 
> Kevin, I tried your build, but same problem: Hexchat crashes right after you
> execute a Python command (see #5).
> 
> Isn't creating a new build from master an option? There the problem doesn't
> exist.

That is what that scratch build is. Both f33 and f34 have the exact same version... so it has to be something in the env between them. 

I'll try and track it down. :(

Comment 10 Viktor Ashirov 2020-11-01 22:54:38 UTC
Created attachment 1725617 [details]
hexchat.spec.diff

There is a commit in master branch [1] that implements python plugin with CFFI. It is not present in 2.14 branch. That's why a build from hexchat's master branch doesn't crash as it doesn't use PyEval_ReleaseLock (deprecated since Python 3.2 [2]) anymore. 

I'm attaching a diff for the spec file + a diff between 2.14 branch and version 2.14.3 in master (bfd6eea98f16a5f2bcea19e01cc372ea576b7db0), that can be generated using 
git diff 2.14..bfd6eea98f16a5f2bcea19e01cc372ea576b7db0  > 2.14.3_from_master.patch


[1] https://github.com/hexchat/hexchat/commit/706f9bca82d463f6f1bd17d5dc609807e4a1e8a9
[2] https://docs.python.org/3/c-api/init.html#c.PyEval_ReleaseLock

Comment 11 Viktor Ashirov 2020-11-01 22:55:24 UTC
Created attachment 1725618 [details]
2.14.3_from_master.patch

Comment 12 Kevin Fenzi 2020-11-02 01:16:46 UTC
Ah, I see.. you had me confused. I thought you meant the master/f33 branches on src.fedoraproject.org :) 

Yes, I can definitely backport that. Will do so tomorrow.

Comment 13 Brandon Sawyers 2020-11-05 18:44:55 UTC
Kevin,

If you need help testing that RPM let me know and I'll be glad to help.

Thanks,
Brandon

Comment 14 Marc Muehlfeld 2020-11-24 15:24:48 UTC
Viktor provided a patch that seems to solve the issue.
Is there anything we can do to get this fixed and shipped soon?

Comment 15 Stanislav Kontar 2020-11-27 19:18:59 UTC
Hello! It seems that I am also affected. Looks like the Fedora 33 version of Hexchat is crashing when first callback is called from a Python plugin.

Comment 16 Pablo Caruana 2020-12-11 11:50:04 UTC
let us know if you need any help with the patch,rpm testing. Confirmed with  as Today updated one of my laptop to fedora 33 (hexchat-2.14.3-6.fc33.x86_64).

Comment 17 Kevin Fenzi 2020-12-30 22:35:20 UTC
So sorry this dropped off my radar. ;( 

I talked with upstream and reluctantly I think we should ship the devel branch python plugin (since the current one completely fails to work).

I did not want to pull in anything else from master branch than the python plugin tho. 

Can folks try: 

https://koji.fedoraproject.org/koji/taskinfo?taskID=58624077

and confirm it works for their python plugins? Thats just the new python plugin backported against the stable hexchat. 

If it passes some testing here I'll push to rawhide/f33. Thanks and sorry for the delay.

Comment 18 Brandon Sawyers 2020-12-31 02:00:14 UTC
Hey Kevin,

No worries on the wait!

I had to test using the 12/18 rawhide live image, but it works there. I was able to load my plugin and reload.

If there is anything more than that you'd like to see, just let me know.

Thanks,
Brandon

Comment 19 Fedora Update System 2020-12-31 21:51:30 UTC
FEDORA-2020-e71797480a has been submitted as an update to Fedora 33. https://bodhi.fedoraproject.org/updates/FEDORA-2020-e71797480a

Comment 20 Fedora Update System 2021-01-01 01:21:02 UTC
FEDORA-2020-e71797480a has been pushed to the Fedora 33 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-e71797480a`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-e71797480a

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

Comment 21 Stanislav Kontar 2021-01-02 14:19:19 UTC
Works for me! Thanks for the update!

Comment 22 Fedora Update System 2021-01-03 01:11:29 UTC
FEDORA-2020-e71797480a has been pushed to the Fedora 33 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.