g_string_new from src/config/files.c:57 (related to XDG_CONFIG_HOME).
Full backtrace
(gdb) bt full
#0 0x00007ffff78920d2 in g_string_new () at /usr/lib/libglib-2.0.so.0
#1 0x00005555555dc166 in files_create_directories () at src/config/files.c:57
xdg_config = 0x55698f20 <error: Cannot access memory at address 0x55698f20>
xdg_data = 0xfffffffff774e920 <error: Cannot access memory at address 0xfffffffff774e920>
themes_dir = <optimized out>
icons_dir = <optimized out>
chatlogs_dir = <optimized out>
logs_dir = <optimized out>
plugins_dir = <optimized out>
#2 0x000055555558a4ae in _init (theme_name=0x0, log_file=0x0, config_file=0x0, log_level=0x5555555f7172 "INFO")
at src/profanity.c:175
prof_log_level = <optimized out>
line = <optimized out>
#3 prof_run (log_level=0x5555555f7172 "INFO", account_name=0x0, config_file=0x0, log_file=0x0, theme_name=0x0)
at src/profanity.c:100
line = <optimized out>
#4 0x000055555558631d in main (argc=<optimized out>, argv=<optimized out>) at src/main.c:180
entries =
{{long_name = 0x5555555f7f39 "version", short_name = 118 'v', flags = 0, arg = G_OPTION_ARG_NONE, arg_data = 0x55555568fd70 <version>, description = 0x55555561be6e "Show version information", arg_description = 0x0}, {long_name = 0x555555605c56 "account", short_name = 97 'a', flags = 0, arg = G_OPTION_ARG_STRING, arg_data = 0x55555568fd58 <account_name>, description = 0x55555561c0b8 "Auto connect to an account on startup", arg_description = 0x0}, {long_name = 0x55555561b3d7 "log", short_name = 108 'l', flags = 0, arg = G_OPTION_ARG_STRING, arg_data = 0x55555568fd68 <log>, description = 0x55555561c0e0 "Set logging levels, DEBUG, INFO (default), WARN, ERROR", arg_description = 0x55555561be87 "LEVEL"}, {long_name = 0x555555616798 "config", short_name = 99 'c', flags = 0, arg = G_OPTION_ARG_STRING, arg_data = 0x55555568fd50 <config_file>, description = 0x55555561c118 "Use an alternative configuration file", arg_description = 0x0}, {long_name = 0x55555561be8d "logfile", short_name = 102 'f', flags = 0, arg = G_OPTION_ARG_STRING, arg_data = 0x55555568fd60 <log_file>, description = 0x55555561be95 "Specify log filename", arg_description = 0x0}, {long_name = 0x555555605fde "theme", short_name = 116 't', flags = 0, arg = G_OPTION_ARG_STRING, arg_data = 0x55555568fd48 <theme_name>, description = 0x55555561beaa "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 = 0x555555698f20
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.
profanityProfanity, version 0.9.0
Build information:
XMPP library: libmesode
Desktop notification support: Enabled
OTR support: Enabled (libotr 4.1.1)
PGP support: Enabled (libgpgme 1.13.1)
OMEMO support: Enabled
C plugins: Enabled
Python plugins: Disabled
GTK icons: Enabled
OS: Alpine Linux Edge
glib: 2.64.3
Now that was quick haha :-)
I give it a look tomorrow. Thanks for the report!
Thanks :) let me know if I can do anything to help debug!
Maybe try using ./configure-debug then the variables in the backtrace shouldn't be optimized out.
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 XDG_CONFIG_HOME set on your system? If yes, to what?
Is HOME set on your system? If yes, to what?
Does $HOME/.config exist?
HOME: /home/gjabell
XDG_CONFIG_HOME: /home/gjabell/.config
$HOME/.config does exist
Thank you for checking. Do you know how to use gdb?
gdb ./profanity
b files_create_directories
r
Then use n to step to the next line or s to step into a function.
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 XDG_CONFIG_HOME set, it looks like it correctly reads the config directory in _files_get_xdg_config_home, but the returned strdup yields an invalid pointer:
In _files_get_xdg_config_home:
(gdb) p xdg_config_home
$1 = (gchar *) 0x7fffffffefa6 "/home/gjabell/.config"
In files_create_directories:
(gdb) p xdg_config
$1 = (gchar *) 0xfffffffff7b287a0 <error: Cannot access memory at address 0xfffffffff7b287a0>
Which OS are you running? I suspect this is an issue with Alpine.
Which Version of glibc?
None :P
Alpine uses Musl
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."
(https://musl.libc.org/doc/1.1.24/manual.html)
Alpine uses Musl
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?
And the code that causes this could also be written in another way. I would like to send you a patch (probably tomorrow) to find out whether this also causes the problem. Just out of curiosity.
Your guess is as good as mine :P
That would be great, no hurry though :-) I really appreciate all the help!
@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:
https://github.com/profanity-im/profanity-im.github.io/blob/master/guide/latest/build.html
https://profanity-im.github.io/guide/latest/build.html
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 git bisect and it looks like it's probably related to the C99 change - profanity builds and runs fine up until 26cda6b5, and then fails to build with errors until tag 0.9.0 at which point it builds with warnings but fails to run.
@gjabell can you for now patch the Alpine package to remove https://github.com/profanity-im/profanity/pull/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 "\u200E".
This is the commit that added it https://github.com/profanity-im/profanity/commit/87f9bacffa32ac199cffd5f80d4bf8e73dcb1c4c
It was added due to some messed up UI reported here: https://github.com/profanity-im/profanity/issues/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.
I also thought about using utf8proc.
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.
@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! :tada:
Thanks so much for your help @jubalh!
Cool!
It will be in 0.9.2 (coming the next days/week).
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