-
-
Notifications
You must be signed in to change notification settings - Fork 178
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
Segfault when running Profanity 0.9.0 #1357
Comments
Now that was quick haha :-) |
Thanks :) let me know if I can do anything to help debug! |
Maybe try using |
Here's the backtrace with debug enabled: Click to show(gdb) bt full
#0 0x00007ffff78920d2 in g_string_new () at /usr/lib/libglib-2.0.so.0
#1 0x00005555555f8a69 in files_create_directories () at src/config/files.c:57
xdg_config = 0xfffffffff7b287e0 <error: Cannot access memory at address 0xfffffffff7b287e0>
xdg_data = 0xfffffffff7b287a0 <error: Cannot access memory at address 0xfffffffff7b287a0>
themes_dir = 0x0
icons_dir = 0x0
chatlogs_dir = 0x0
logs_dir = 0x10000000
plugins_dir = 0x0
#2 0x000055555558b714 in _init (log_level=0x5555556455a6 "INFO", config_file=0x0, log_file=0x0, theme_name=0x0)
at src/profanity.c:175
prof_log_level = 67108865
#3 0x000055555558b520 in prof_run
(log_level=0x5555556455a6 "INFO", account_name=0x0, config_file=0x0, log_file=0x0, theme_name=0x0) at src/profanity.c:100
line = 0x7fffffffe6d8 "\335\351\377\377\377\177"
#4 0x000055555561b8b2 in main (argc=1, argv=0x7fffffffe6c8) at src/main.c:180
entries =
{{long_name = 0x5555556455ab "version", short_name = 118 'v', flags = 0, arg = G_OPTION_ARG_NONE, arg_data = 0x5555556c6d60 <version>, description = 0x5555556455b3 "Show version information", arg_description = 0x0}, {long_name = 0x5555556455cc "account", short_name = 97 'a', flags = 0, arg = G_OPTION_ARG_STRING, arg_data = 0x5555556c6d78 <account_name>, description = 0x5555556455d8 "Auto connect to an account on startup", arg_description = 0x0}, {long_name = 0x5555556455fe "log", short_name = 108 'l', flags = 0, arg = G_OPTION_ARG_STRING, arg_data = 0x5555556c6d68 <log>, description = 0x555555645608 "Set logging levels, DEBUG, INFO (default), WARN, ERROR", arg_description = 0x55555564563f "LEVEL"}, {long_name = 0x555555645645 "config", short_name = 99 'c', flags = 0, arg = G_OPTION_ARG_STRING, arg_data = 0x5555556c6d80 <config_file>, description = 0x555555645650 "Use an alternative configuration file", arg_description = 0x0}, {long_name = 0x555555645676 "logfile", short_name = 102 'f', flags = 0, arg = G_OPTION_ARG_STRING, arg_data = 0x5555556c6d70 <log_file>, description = 0x55555564567e "Specify log filename", arg_description = 0x0}, {long_name = 0x555555645693 "theme", short_name = 116 't', flags = 0, arg = G_OPTION_ARG_STRING, arg_data = 0x5555556c6d88 <theme_name>, description = 0x555555645699 "Specify theme name", arg_description = 0x0}, {long_name = 0x0, short_name = 0 '\000', flags = 0, arg = G_OPTION_ARG_NONE, arg_data = 0x0, description = 0x0, arg_description = 0x0}}
error = 0x0
context = 0x7ffff7b28640 |
Is |
|
Thank you for checking. Do you know how to use gdb?
Then use Are you in our MUC? You could ping me there and we could do it together. |
I tried with and without the XDG variables set. Works both times for me. |
Hmm...with In
In
Which OS are you running? I suspect this is an issue with Alpine. |
Which Version of glibc? |
None :P |
Debian GNU/Linux is a nice OS :-D ;-) |
Maybe the feature_test_macros? "If no feature test macros are defined, musl's headers operate in "default features" mode, exposing the equivalent of the _BSD_SOURCE option below." |
Maybe this is the issue. Do you know Alpine folks who might have encountered this? I heard that in the past there were similar things if I remember correctly. Maybe some Alpine maintainer knows more? |
I'll check in the IRC channel; what's weird is that it works fine with version 0.8.1 (running it as we speak), but the code for loading the config directory hasn't changed between those versions. |
Yeah a very weird bug. |
We changed configure.ac to compile with c99, not sure this could affect it? |
Your guess is as good as mine :P |
@gjabell would you mind creating a PR for our website so that we have a one liner to install the dependencies on Alpine? For example: |
Removed this from milestone 0.9.1 since I think this is Alpine specific and I wanted to get the latest changes out. We can still do a 0.9.2 if we fix this soon :) |
So I did some more digging with |
@gjabell can you for now patch the Alpine package to remove #1351 ? Does it work then? @pasis any idea why c99 with musl can cause this? The PR mentioned above was only created because of our use of It was added due to some messed up UI reported here: #1220 I'm not sure if it was the best solution. It might mean that there are hundreds of UTF-8 characters that we need to filter out so as to not mess up the UI. It was an issue where I did not know much but wanted to fix it for the users. Maybe now is a good time to review it. Let's hear your thoughts :-) |
@jubalh That seems to do the trick! I'll do some research and see if I can't find why enable c99 causes an issue with Musl. |
Found this when looking to fix bug #1357 Not sure if it is related. man 3 getenv sais: ``` As typically implemented, getenv() returns a pointer to a string within the environment list. The caller must take care not to modify this string, since that would change the environment of the process. ```
@gjabell can you try whether it works with c99 if you apply https://github.com/profanity-im/profanity/commit/f1141932fc45fa4bcc87984241b524381c0ab2b3.patch ? |
@jubalh Looks like the issue persists, unfortunately :/ |
That seems to have fixed it! 🎉 Thanks so much for your help @jubalh! |
Cool! So it was just that alpine/musl were more pedantic than what we tried so far, and not "alpines fault" :) |
Great :) I'll go ahead and make an Alpine release to 0.9.1 with that patch and the keep an eye out for 0.9.2 |
With recent changes to c99 and -D_POSIX_C_SOURCE=200809L we get the following: openSUSE TW CI sais: ``` Now you can run `make' to build profanity In file included from /usr/include/python2.7/Python.h:8, from src/plugins/python_plugins.c:37: /usr/include/python2.7/pyconfig.h:1226: error: "_POSIX_C_SOURCE" redefined [-Werror] 1226 | #define _POSIX_C_SOURCE 200112L | <command-line>: note: this is the location of the previous definition In file included from /usr/include/python2.7/Python.h:8, from src/plugins/python_api.c:37: /usr/include/python2.7/pyconfig.h:1226: error: "_POSIX_C_SOURCE" redefined [-Werror] 1226 | #define _POSIX_C_SOURCE 200112L | <command-line>: note: this is the location of the previous definition cc1: all warnings being treated as errors ``` OpenBSD CI sais: ``` cc1: warnings being treated as errors src/database.c: In function 'log_database_get_previous_chat': src/database.c:226: warning: implicit declaration of function 'asprintf' gmake[1]: *** [Makefile:1924: src/database.o] Error 1 gmake[1]: Leaving directory '/home/build/profanity' gmake: *** [Makefile:1211: all] Error 2 ``` Let us use gnu99. Has been proposed before already and is fine. Regards #1357 Regards #1351
Expected Behavior
Current Behavior
g_string_new
fromsrc/config/files.c:57
(related toXDG_CONFIG_HOME
).Full backtrace
Possible Solution
Seems to be related to failing to find the configuration directory, even when
XDG_CONFIG_HOME
is set properly. Note that this still occurs after moving my current configuration to start with a fresh slate.This wasn't an issue in 0.8.1, so it must be something that changed between 0.8.1 and 0.9.0.
Steps to Reproduce (for bugs)
profanity
Environment
OS: Alpine Linux Edge
glib: 2.64.3
The text was updated successfully, but these errors were encountered: