-
-
Notifications
You must be signed in to change notification settings - Fork 332
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Weechat crashes with python 3.9 #1598
Comments
Hi, I'm running with Python 3.9 (3.9.1 on Debian Sid) as well, and no problems so far, even if I compile with the address sanitizer, which should crash immediately in case of problem. I see you are using 3 Python scripts, can you try without them and load them one by one to check if a specific script brings the crash? According to your backtrace, it seems the crash is in Python itself, in |
This seems to be causing the crash as soon as I load it: https://weechat.org/scripts/source/mpc.py.html/ |
This script does not even work with Python 3, I have this error displayed, but no crash:
Maybe the crash happens because other scripts are loaded before this one. |
How did you get that error? I always tried to load the script from inside a running weechat |
Just with this command: |
those scripts should be removed from the repo or make them at least inactive Sêbastien, see weechat/scripts#433 as well |
Thanks for the help so far, so maybe this issue should be opened in weechat/scripts instead? |
Anyway, even if there are problems in the script, it should not cause a crash (except if the script does really bad things, but I'm not sure that's the case). I wonder if it's a Python installation issue, did you install Python 3.9 manually or with your package manager? |
I installed it with the package manager. I even build weechat locally and installed it again. The crash keeps happening when I try to load that script |
Could you please try to compile with address sanitizer enabled and check if you have a different backtrace when it crashes? See the user's guide: https://weechat.org/files/doc/stable/weechat_user.en.html#report_crashes |
I did that and now weechat will crash and not even dump a core even with the plugin unloaded.
|
OK then you could try to run WeeChat like this:
In case of crash, you'll have backtrace in I'll update the docs accordingly. |
Thanks, that helped. When I first executed it and installed & loaded the script, nothing happened. I then restarted weechat with the same asan options - and it crashed on start. There was no asan.log but a backtrace which is more or less the same as before:
Then I removed mpc.py from the autoload and ran weechat again and loaded it from inside weechat - this time it crashed, with a slightly different stacktrace:
This time there was also an asan.log:
|
In all the traces you returned, it always crashes on this line: weechat/src/plugins/python/weechat-python-api.c Line 2648 in b95e91e
And then it's a crash in Python itself. Do you have a way to test WeeChat and same scripts on another machine, possibly with a different OS? I still think it's an issue with your Python installation. |
I have an ubuntu machine too. When I have time later this week, I can try to set up weechat there and see what happens. |
I'm also experiencing this problem on Arch linux with weechat 2.9 and python 3.9.1.
|
Can confirm the problem on Arch Linux x86-64, python 3.9.1, weechat-3.0-2. However I only have autosort.py loaded at startup and it works with weechat 2.9-3. Maybe the problem has to do with which version of python weechat was built. ======= WeeChat backtrace ======= |
I can confirm that too. Pretty much the same backtrace as ym1234. Python 3.9.1 and WeeChat 3.0. I can add to that: I did try it with weechat -s and it works. So, the problem seems to be somehow connected to the scripts. I'm not sure what I use. Since I did set this up some years ago and it has been working ever since. I know there is some notify_send related stuff in there though. Probably not the same though. I've never seen this problem before with my setup in years and on a number of devices. But I did run an upgrade today and it occurred afterwards. The scripts/plugins didn't change at all. The setup is the same that has been working for years. So, the problem definitely comes with an upgrade. I'm not sure when it started. But in my case it definitely came with the upgrade today. |
@ArchI3Chris: for now I'm still unable to reproduce the crash. |
Well, this couldn't come at a worse time and (don't get me wrong) I've really got more important things to do. But looking into it the problem presented itself to me. It is anotify.py. I had version 1.0.1 before and it worked just fine. Removing it, WeeChat started. So I took the time to try 1.0.2 (as is) from the repo too. Same problem. Doesn't work either and crashes too. Thanks for getting back btw. Let me add: I've got another script in there (lnotify 0.3.1, meanwhile tried 0.3.5 with same result) and while that could cause a problem, the really interesting question would be, why it didn't before. Because as mentioned before, I had those in there for years and it never gave me any problems or errors. And the scripts and the setup didn't change.
|
@ArchI3Chris: only Python version has changed, or WeeChat version? |
I honestly can't contribute to that, since I don't perform scheduled and frequent upgrades and don't know which version I've been using before and if it worked with that one. But if it all goes back to anotify in first place, my suggestion would be, to take a look at the creation time of the issue and maybe start there? If it is anotify in all cases, chances are, the problem started with some change in regards a bit before the time when the issue has been reported.
|
WeeChat 3.1-dev (git: v3.0-71-gdc8df133e) no crash with this config |
Hmm... I just played around a bit with it. First I upgraded from lnotify 0.3.1 to 0.3.5. Same problem. Then I edited the configuration, since I made minor changes (added two notify-send arguments). An oversight (curly bracket at the end) led to an error in the lnotify file, which led to WeeChat starting. The two together still crash WeeChat. But using only one at a time, after correcting the mistake, WeeChat would start in BOTH cases. BUT... while I don't get any errors with lnotify now, with anotify now I get an output inside WeeChat that says: in line 406 in the a_notify function the name notify2 (priority=notify2.URGENCY_LOW) is not defined. Pynotify is installed btw. |
Not able to reproduce, I close the issue. |
Bug summary
When you start weechat on the command line with python 3.9 installed it crashes immediately.
Steps to reproduce
1. Install Python 3.9
2. Start weechat 3.0/2.9
Current behavior
Crashes upon start.
Expected behavior
It shouldn't crash.
Suggested solutions
Additional information
#0 0x00007fab8d0fe615 in raise () from /usr/lib/libc.so.6
No symbol table info available.
#1 0x00007fab8d0e7862 in abort () from /usr/lib/libc.so.6
No symbol table info available.
#2 0x000055e50ac4f026 in weechat_shutdown (return_code=1, crash=1) at /home/nathan/Downloads/weechat/src/weechat-3.0/src/core/weechat.c:752
No locals.
#3
No symbol table info available.
#4 0x00007fab8b918f82 in PyLong_FromLong () from /usr/lib/libpython3.9.so.1.0
No symbol table info available.
#5 0x00007fab8bc29134 in weechat_python_api_hook_print_cb (pointer=0x55e50d18a3b0, data=, buffer=0x55e50cc32e80, date=1607517281, tags_count=, tags=0x0, displayed=1, highlight=0, prefix=0x55e50d3cdf00 "",
message=0x55e50d310250 "python scripts loaded: autosort, go, lnotify") at /home/nathan/Downloads/weechat/src/weechat-3.0/src/plugins/python/weechat-python-api.c:2648
script = 0x55e50d18a3b0
func_argv = {0x7fff6dad5237, 0x7fab8c1254c0 <str_pointer+512>, 0x7fab8bc3dce0 , 0x55e50d227610, 0x55e50ac88178 <utf8_charcasecmp+40>, 0x55e50cf6931e, 0x55e50cf5b5a0, 0x0}
empty_arg = ""
ptr_function = 0x55e50cf67d30 "@\245\210\f\345U"
ptr_data = 0x0
timebuffer = "1607517281", '\000' <repeats 53 times>
rc =
ret =
#6 0x000055e50ac8f3c2 in hook_print_exec (buffer=0x55e50cc32e80, line=0x55e50d3cdfa0) at /home/nathan/Downloads/weechat/src/weechat-3.0/src/core/hook/wee-hook-print.c:132
ptr_hook = 0x55e50d135c20
next_hook = 0x0
prefix_no_color =
message_no_color = 0x55e50d310250 "python scripts loaded: autosort, go, lnotify"
#7 0x000055e50acaa669 in gui_chat_printf_date_tags_internal (buffer=, date=, date_printed=, tags=, message=) at /home/nathan/Downloads/weechat/src/weechat-3.0/src/gui/gui-chat.c:864
display_time =
length_data =
length_str = 47
ptr_msg =
pos_prefix =
pos_tab =
modifier_data = 0x55e50cfc0280 "0x55e50cc32e80;"
string = 0x55e50d1b4620 " \tpython scripts loaded: autosort, go, lnotify"
new_string =
new_line = 0x55e50d3cdfa0
no_print =
#8 0x000055e50acaa947 in gui_chat_printf_date_tags (buffer=0x55e50cc32e80, date=1607517281, tags=0x0, message=) at /home/nathan/Downloads/weechat/src/weechat-3.0/src/gui/gui-chat.c:1001
date_printed = 1607517281
pos = 0x55e50d3b8dc0 "python scripts loaded: autosort, go, lnotify"
pos_end = 0x0
argptr = {{gp_offset = 40, fp_offset = 48, overflow_arg_area = 0x7fff6dad5450, reg_save_area = 0x7fff6dad5360}}
vaa_size =
vaa_num =
vbuffer = 0x55e50d3b8dc0 "python scripts loaded: autosort, go, lnotify"
vaa_buffer2 =
#9 0x00007fab8c112ef6 in plugin_script_display_short_list (weechat_plugin=0x55e50cd6e0a0, scripts=) at /home/nathan/Downloads/weechat/src/weechat-3.0/src/plugins/plugin-script.c:1629
scripts_loaded = 0x7fab8c118a64 "%s scripts loaded:"
buf = 0x55e50cf60230 "python scripts loaded: autosort, go, lnotify"
length = 49
ptr_script =
#10 0x00007fab8bc0de83 in weechat_plugin_init (plugin=, argc=0, argv=0x0) at /home/nathan/Downloads/weechat/src/weechat-3.0/src/plugins/python/weechat-python.c:1682
No locals.
#11 0x000055e50acd53ec in plugin_call_init (argv=, argc=, plugin=) at /home/nathan/Downloads/weechat/src/weechat-3.0/src/plugins/plugin.c:361
init_func = 0x7fab8bc0dcc0 <weechat_plugin_init>
plugin_argc = 0
no_connect = 0
old_auto_connect = 1
rc =
plugin_argv = 0x0
init_func =
plugin_argc =
no_connect =
rc =
old_auto_connect =
plugin_argv =
#12 plugin_call_init (plugin=0x55e50cd6e0a0, argc=, argv=) at /home/nathan/Downloads/weechat/src/weechat-3.0/src/plugins/plugin.c:332
init_func =
plugin_argc =
no_connect =
rc =
old_auto_connect =
plugin_argv =
#13 0x000055e50acd6efe in plugin_auto_load (force_plugin_autoload=force_plugin_autoload@entry=0x0, load_from_plugin_path=load_from_plugin_path@entry=1, load_from_extra_lib_dir=load_from_extra_lib_dir@entry=1, load_from_lib_dir=load_from_lib_dir@entry=1, argc=argc@entry=1,
argv=argv@entry=0x7fff6dad56e8) at /home/nathan/Downloads/weechat/src/weechat-3.0/src/plugins/plugin.c:1119
dir_name =
plugin_path =
plugin_path2 =
extra_libdir =
ptr_plugin_autoload =
ptr_plugin = 0x55e50cd6e0a0
plugin_args = {argc = 1, argv = 0x7fff6dad56e8}
arraylist = 0x55e50cd7cf80
length =
i = 12
#14 0x000055e50acd75df in plugin_init (force_plugin_autoload=0x0, argc=argc@entry=1, argv=argv@entry=0x7fff6dad56e8) at /home/nathan/Downloads/weechat/src/weechat-3.0/src/plugins/plugin.c:1384
No locals.
#15 0x000055e50ac502d8 in weechat_init (argc=argc@entry=1, argv=argv@entry=0x7fff6dad56e8, gui_init_cb=) at /home/nathan/Downloads/weechat/src/weechat-3.0/src/core/weechat.c:835
No locals.
#16 0x000055e50ac4f076 in main (argc=1, argv=0x7fff6dad56e8) at /home/nathan/Downloads/weechat/src/weechat-3.0/src/gui/curses/normal/main.c:42
No locals.
if you need further information, please tell me.
The text was updated successfully, but these errors were encountered: