Skip to content
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 in eval_password on Profanity 0.9.3 #1367

Closed
gjabell opened this issue Jun 20, 2020 · 2 comments
Closed

Segfault in eval_password on Profanity 0.9.3 #1367

gjabell opened this issue Jun 20, 2020 · 2 comments
Assignees
Labels
Milestone

Comments

@gjabell
Copy link

gjabell commented Jun 20, 2020

Profanity 0.9.3 segfaults in Alpine Linux Edge when using eval_password based on the recently added change in 448f7f0.

Expected Behavior

Profanity should start normally when a command is specified in eval_password.

Current Behavior

Profanity segfaults in Glib's g_strjoinv while trying to load a password from the command specified in eval_password. This happens both with a "complex" command like pass name-of-password-store-entry as well as something simple like cat path-to-password-file.

Full backtrace in debug mode
warning: Currently logging to /home/gjabell/profanity.log.  Turn the logging off and on to make the new setting effective.
Starting program: /home/gjabell/test/profanity/profanity 
[Detaching after fork from child process 27727]
[Detaching after fork from child process 27729]
[Detaching after fork from child process 27731]
[Detaching after fork from child process 27733]
[Detaching after fork from child process 27735]
[Detaching after fork from child process 27737]
[Detaching after fork from child process 27739]

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7889f7a in g_strjoinv () from /usr/lib/libglib-2.0.so.0
#0  0x00007ffff7889f7a in g_strjoinv () at /usr/lib/libglib-2.0.so.0
#1  0x000055555558a530 in call_external (argv=0x7fffffffe3f0, output_ptr=0x7fffffffe3e8, error_ptr=0x0) at src/common.c:518
        stdout_str = 0x0
        stdout_str_ptr = 0x7fffffffe388
        stderr_str = 0x0
        stderr_str_ptr = 0x7fffffffe390
        flags = G_SPAWN_SEARCH_PATH
        status = 0
        error = 0x0
        cmd = 0x0
#2  0x00005555555fd2b0 in account_eval_password (account=0x555555e48b00) at src/config/account.c:206
        __func__ = "account_eval_password"
        output = 0x0
        argv = {0x55555563e837 "sh", 0x55555563e83a "-c", 0x555555e48c80 "pass xmpp.gr4v.net/gjabell"}
#3  0x00005555555d1458 in cmd_connect (window=0x7ffff6363e60, command=0x555555e46720 "/connect", args=0x555555e48860) at src/command/cmd_funcs.c:428
        res = 0
        conn_status = JABBER_DISCONNECTED
        opt_keys = {0x555555636854 "server", 0x55555563685b "port", 0x555555636860 "tls", 0x555555636864 "auth", 0x0}
        parsed = 1
        options = Python Exception <class 'gdb.error'> There is no member named keys.: 
0x555555e398c0
        altdomain = 0x0
        tls_policy = 0x0
        auth_policy = 0x0
        port = 0
        user = 0x555555e48840 "gr4v"
        def = 0x555555e488e0 "gr4v"
        jid = 0x1555870be <error: Cannot access memory at address 0x1555870be>
        account = 0x555555e48b00
#4  0x00005555555e6575 in _cmd_execute (window=0x7ffff6363e60, command=0x555555e46720 "/connect", inp=0x555555e40d80 "/connect gr4v") at src/command/cmd_funcs.c:8094
        args = 0x555555e48860
        result = 21845
        cmd = 0x555555673c60 <command_defs+7232>
        result = 1
#5  0x00005555555d09b8 in cmd_process_input (window=0x7ffff6363e60, inp=0x555555e40d80 "/connect gr4v") at src/command/cmd_funcs.c:144
        inp_cpy = 0x555555e46720 "/connect"
        command = 0x555555e46720 "/connect"
        question_mark = 0x0
        result = 0
#6  0x00005555555d0a41 in cmd_execute_connect (window=0x7ffff6363e60, account=0x555555e40d60 "gr4v") at src/command/cmd_funcs.c:163
        command = 0x555555dce580
#7  0x000055555558b5d7 in _connect_default (account=0x0) at src/profanity.c:154
        pref_connect_account = 0x555555e40d60 "gr4v"
        window = 0x7ffff6363e60
#8  0x000055555558b4ae in prof_run (log_level=0x5555556445a6 "INFO", account_name=0x0, config_file=0x0, log_file=0x0, theme_name=0x0) at src/profanity.c:102
        line = 0x7fffffffe708 "\016\352\377\377\377\177"
#9  0x000055555561a739 in main (argc=1, argv=0x7fffffffe6f8) at src/main.c:180
        entries = 
            {{long_name = 0x5555556445ab "version", short_name = 118 'v', flags = 0, arg = G_OPTION_ARG_NONE, arg_data = 0x5555556c5d60 <version>, description = 0x5555556445b3 "Show version information", arg_description = 0x0}, {long_name = 0x5555556445cc "account", short_name = 97 'a', flags = 0, arg = G_OPTION_ARG_STRING, arg_data = 0x5555556c5d78 <account_name>, description = 0x5555556445d8 "Auto connect to an account on startup", arg_description = 0x0}, {long_name = 0x5555556445fe "log", short_name = 108 'l', flags = 0, arg = G_OPTION_ARG_STRING, arg_data = 0x5555556c5d68 <log>, description = 0x555555644608 "Set logging levels, DEBUG, INFO (default), WARN, ERROR", arg_description = 0x55555564463f "LEVEL"}, {long_name = 0x555555644645 "config", short_name = 99 'c', flags = 0, arg = G_OPTION_ARG_STRING, arg_data = 0x5555556c5d80 <config_file>, description = 0x555555644650 "Use an alternative configuration file", arg_description = 0x0}, {long_name = 0x555555644676 "logfile", short_name = 102 'f', flags = 0, arg = G_OPTION_ARG_STRING, arg_data = 0x5555556c5d70 <log_file>, description = 0x55555564467e "Specify log filename", arg_description = 0x0}, {long_name = 0x555555644693 "theme", short_name = 116 't', flags = 0, arg = G_OPTION_ARG_STRING, arg_data = 0x5555556c5d88 <theme_name>, description = 0x555555644699 "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 = 0x7ffff7b21640

Possible Solution

Guessing this is another issue with Musl (or at least a weird interaction), like in #1357

Steps to Reproduce (for bugs)

  1. Run profanity in Alpine Linux Edge

Environment

  • Give us the version and build information output generated by profanity -v
  • If you could not yet build profanity, mention the revision you try to build from
  • Operating System/Distribution
  • glib version
Profanity, version 0.9.3
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 version: 2.64.3

@jubalh jubalh self-assigned this Jun 23, 2020
@jubalh jubalh added the bug label Jun 23, 2020
@jubalh jubalh added this to the 0.9.4 milestone Jun 23, 2020
jubalh added a commit that referenced this issue Jun 23, 2020
@jubalh
Copy link
Member

jubalh commented Jun 23, 2020

@gjabell can you check whether b79d7e8 fixes this?

@gjabell
Copy link
Author

gjabell commented Jun 24, 2020

Hey @jubalh, that seems to fix it, thanks :)

@gjabell gjabell closed this as completed Jun 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants