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

whatsapp purple crashes when trying to send file #280

Open
shirishag75 opened this issue Jun 11, 2015 · 3 comments · May be fixed by #330
Open

whatsapp purple crashes when trying to send file #280

shirishag75 opened this issue Jun 11, 2015 · 3 comments · May be fixed by #330

Comments

@shirishag75
Copy link

Hi all,
This is what happens :-

[$] gdb pidgin

GNU gdb (Debian 7.7.1+dfsg-5) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/.
Find the GDB manual and other documentation resources online at:
http://www.gnu.org/software/gdb/documentation/.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from pidgin...Reading symbols from /usr/lib/debug//usr/bin/pidgin...done.
done.
(gdb) handle SIGPIPE nostop noprint pass
Signal Stop Print Pass to program Description
SIGPIPE No No Yes Broken pipe
(gdb) set logging on
Copying output to gdb.txt.
(gdb) run
Starting program: /usr/bin/pidgin
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffd865d700 (LWP 483)]
[New Thread 0x7fffd7e5c700 (LWP 484)]
[New Thread 0x7fffd718f700 (LWP 585)]
[New Thread 0x7fffd698e700 (LWP 586)]
[New Thread 0x7fffd618d700 (LWP 587)]
[New Thread 0x7fffd598c700 (LWP 588)]
[New Thread 0x7fffd518b700 (LWP 589)]
[New Thread 0x7fffd498a700 (LWP 590)]
[New Thread 0x7fffb7fff700 (LWP 591)]
[New Thread 0x7fffb77fe700 (LWP 592)]
[New Thread 0x7fffb6ffd700 (LWP 593)]
[New Thread 0x7fffb67fc700 (LWP 594)]
[Thread 0x7fffd698e700 (LWP 586) exited]
[Thread 0x7fffd518b700 (LWP 589) exited]
[Thread 0x7fffb67fc700 (LWP 594) exited]
[Thread 0x7fffd598c700 (LWP 588) exited]
[Thread 0x7fffb6ffd700 (LWP 593) exited]
[Thread 0x7fffd718f700 (LWP 585) exited]
[Thread 0x7fffb77fe700 (LWP 592) exited]
[Thread 0x7fffd498a700 (LWP 590) exited]
[Thread 0x7fffb7fff700 (LWP 591) exited]
[New Thread 0x7fffb7fff700 (LWP 653)]
[Thread 0x7fffb7fff700 (LWP 653) exited]
[Thread 0x7fffd618d700 (LWP 587) exited]
[New Thread 0x7fffd618d700 (LWP 738)]
[New Thread 0x7fffb7fff700 (LWP 739)]
[New Thread 0x7fffd498a700 (LWP 740)]
[Thread 0x7fffd618d700 (LWP 738) exited]
[Thread 0x7fffb7fff700 (LWP 739) exited]
terminate called after throwing an instance of 'std::invalid_argument'
what(): stoi

Program received signal SIGABRT, Aborted.
0x00007ffff494d107 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0 0x00007ffff494d107 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1 0x00007ffff494e4e8 in __GI_abort () at abort.c:89
#2 0x00007fffeb5c35ed in __gnu_cxx::__verbose_terminate_handler() () at /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#3 0x00007fffeb5c1646 in () at /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4 0x00007fffeb5c1691 in () at /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#5 0x00007fffeb5c18a9 in () at /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#6 0x00007fffeb5e479f in std::__throw_invalid_argument(char const*) () at /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#7 0x00007fffe74e5e67 in () at /usr/lib/purple-2/libwhatsapp.so
#8 0x00007fffe74d8ef5 in WhatsappConnection::updateFileUpload(std::string) () at /usr/lib/purple-2/libwhatsapp.so
#9 0x00007fffe74de71e in WhatsappConnection::processIncomingData() () at /usr/lib/purple-2/libwhatsapp.so
#10 0x00007fffe74c3b8a in () at /usr/lib/purple-2/libwhatsapp.so
#11 0x00005555555c930e in pidgin_io_invoke (source=, condition=, data=0x555555ce8c20) at /tmp/buildd/pidgin-2.10.11/./pidgin/gtkeventloop.c:73
#12 0x00007ffff5563bcd in g_main_context_dispatch (context=0x555555899a50) at /build/glib2.0-b3wpTa/glib2.0-2.45.2/./glib/gmain.c:3122
#13 0x00007ffff5563bcd in g_main_context_dispatch (context=context@entry=0x555555899a50) at /build/glib2.0-b3wpTa/glib2.0-2.45.2/./glib/gmain.c:3737
#14 0x00007ffff5563fa0 in g_main_context_iterate (context=0x555555899a50, block=block@entry=1, dispatch=dispatch@entry=1, self=) at /build/glib2.0-b3wpTa/glib2.0-2.45.2/./glib/gmain.c:3808
#15 0x00007ffff55642c2 in g_main_loop_run (loop=0x55555635dc10) at /build/glib2.0-b3wpTa/glib2.0-2.45.2/./glib/gmain.c:4002
#16 0x00007ffff680e5d7 in gtk_main () at /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#17 0x000055555558f557 in main (argc=1, argv=0x7fffffffe958) at /tmp/buildd/pidgin-2.10.11/./pidgin/gtkmain.c:937

(gdb) bt full
#0 0x00007ffff494d107 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56

    resultvar = 0
    pid = 446
    selftid = 446

#1 0x00007ffff494e4e8 in __GI_abort () at abort.c:89

    save_stage = 2
    act = {__sigaction_handler = {sa_handler = 0x7ffff4950f70 <__GI_strtol>, sa_sigaction = 0x7ffff4950f70 <__GI_strtol>}, sa_mask = {__val = {10, 140737300383496, 140737351949831, 5, 0, 93825011594792, 140737296592168, 93825011594792, 140737300383496, 93825007619488, 140737351975717, 140737353512624, 140737353512624, 1, 140737353515856, 93825011156848}}, sa_flags = -134839472, sa_restorer = 0x7ffff7f67a40}
    sigs = {__val = {32, 0 <repeats 15 times>}}

#2 0x00007fffeb5c35ed in __gnu_cxx::__verbose_terminate_handler() () at /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#3 0x00007fffeb5c1646 in () at /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4 0x00007fffeb5c1691 in () at /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#5 0x00007fffeb5c18a9 in () at /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#6 0x00007fffeb5e479f in std::__throw_invalid_argument(char const*) () at /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#7 0x00007fffe74e5e67 in () at /usr/lib/purple-2/libwhatsapp.so
#8 0x00007fffe74d8ef5 in WhatsappConnection::updateFileUpload(std::string) () at /usr/lib/purple-2/libwhatsapp.so
#9 0x00007fffe74de71e in WhatsappConnection::processIncomingData() () at /usr/lib/purple-2/libwhatsapp.so
#10 0x00007fffe74c3b8a in () at /usr/lib/purple-2/libwhatsapp.so
#11 0x00005555555c930e in pidgin_io_invoke (source=, condition=, data=0x555555ce8c20) at /tmp/buildd/pidgin-2.10.11/./pidgin/gtkeventloop.c:73

    closure = 0x555555ce8c20
    purple_cond = PURPLE_INPUT_READ

#12 0x00007ffff5563bcd in g_main_context_dispatch (context=0x555555899a50) at /build/glib2.0-b3wpTa/glib2.0-2.45.2/./glib/gmain.c:3122

    dispatch = 0x7ffff55a8da0 <g_io_unix_dispatch>
    prev_source = 0x0
    was_in_call = 0
    user_data = 0x555555ce8c20
    callback = 0x5555555c92e0 <pidgin_io_invoke>
    cb_funcs = <optimized out>
    cb_data = 0x555556307640
    need_destroy = <optimized out>
    source = 0x5555563659b0
    current = 0x555555c6e510
    i = 1

#13 0x00007ffff5563bcd in g_main_context_dispatch (context=context@entry=0x555555899a50) at /build/glib2.0-b3wpTa/glib2.0-2.45.2/./glib/gmain.c:3737
#14 0x00007ffff5563fa0 in g_main_context_iterate (context=0x555555899a50, block=block@entry=1, dispatch=dispatch@entry=1, self=) at /build/glib2.0-b3wpTa/glib2.0-2.45.2/./glib/gmain.c:3808

    max_priority = 0
    timeout = 0
    some_ready = 1
    nfds = <optimized out>
    allocated_nfds = 9
    fds = 0x5555563607c0

#15 0x00007ffff55642c2 in g_main_loop_run (loop=0x55555635dc10) at /build/glib2.0-b3wpTa/glib2.0-2.45.2/./glib/gmain.c:4002

    __FUNCTION__ = "g_main_loop_run"

#16 0x00007ffff680e5d7 in gtk_main () at /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#17 0x000055555558f557 in main (argc=1, argv=0x7fffffffe958) at /tmp/buildd/pidgin-2.10.11/./pidgin/gtkmain.c:937

    opt_help = -14880
    opt_version = 1438786976
    opt_config_dir_arg = 0x0
    accounts = 0x0
    sigset = {__val = {82950, 0 <repeats 15 times>}}
    errmsg = '\000' <repeats 152 times>, "\374\"\336\367\377\177", '\000' <repeats 42 times>...
    signal_channel = 0x0
    signal_status = G_IO_STATUS_ERROR
    error = 0x0
    opt = 0
    debug_enabled = 80
    active_accounts = 0x0
    long_options = {{name = 0x55555562c2e7 "config", has_arg = 1, flag = 0x0, val = 99}, {name = 0x55555561a779 "debug", has_arg = 0, flag = 0x0, val = 100}, {name = 0x5555556282d1 "force-online", has_arg = 0, flag = 0x0, val = 102}, {name = 0x55555561c2fa "help", has_arg = 0, flag = 0x0, val = 104}, {name = 0x55555562817d "login", has_arg = 2, flag = 0x0, val = 108}, {name = 0x5555556282de "multiple", has_arg = 0, flag = 0x0, val = 109}, {name = 0x5555556282e7 "nologin", has_arg = 0, flag = 0x0, val = 110}, {name = 0x55555562c2fa "session", has_arg = 1, flag = 0x0, val = 115}, {name = 0x55555561eb7a "version", has_arg = 0, flag = 0x0, val = 118}, {name = 0x55555562c2f0 "display", has_arg = 1, flag = 0x0, val = 68}, {name = 0x555555628e53 "sync", has_arg = 0, flag = 0x0, val = 83}, {name = 0x0, has_arg = 0, flag = 0x0, val = 0}}

(gdb)
#0 0x00007ffff494d107 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56

    resultvar = 0
    pid = 446
    selftid = 446

#1 0x00007ffff494e4e8 in __GI_abort () at abort.c:89

    save_stage = 2
    act = {__sigaction_handler = {sa_handler = 0x7ffff4950f70 <__GI_strtol>, sa_sigaction = 0x7ffff4950f70 <__GI_strtol>}, sa_mask = {__val = {10, 140737300383496, 140737351949831, 5, 0, 93825011594792, 140737296592168, 93825011594792, 140737300383496, 93825007619488, 140737351975717, 140737353512624, 140737353512624, 1, 140737353515856, 93825011156848}}, sa_flags = -134839472, sa_restorer = 0x7ffff7f67a40}
    sigs = {__val = {32, 0 <repeats 15 times>}}

#2 0x00007fffeb5c35ed in __gnu_cxx::__verbose_terminate_handler() () at /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#3 0x00007fffeb5c1646 in () at /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4 0x00007fffeb5c1691 in () at /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#5 0x00007fffeb5c18a9 in () at /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#6 0x00007fffeb5e479f in std::__throw_invalid_argument(char const*) () at /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#7 0x00007fffe74e5e67 in () at /usr/lib/purple-2/libwhatsapp.so
#8 0x00007fffe74d8ef5 in WhatsappConnection::updateFileUpload(std::string) () at /usr/lib/purple-2/libwhatsapp.so
#9 0x00007fffe74de71e in WhatsappConnection::processIncomingData() () at /usr/lib/purple-2/libwhatsapp.so
#10 0x00007fffe74c3b8a in () at /usr/lib/purple-2/libwhatsapp.so
#11 0x00005555555c930e in pidgin_io_invoke (source=, condition=, data=0x555555ce8c20) at /tmp/buildd/pidgin-2.10.11/./pidgin/gtkeventloop.c:73

    closure = 0x555555ce8c20
    purple_cond = PURPLE_INPUT_READ

#12 0x00007ffff5563bcd in g_main_context_dispatch (context=0x555555899a50) at /build/glib2.0-b3wpTa/glib2.0-2.45.2/./glib/gmain.c:3122

    dispatch = 0x7ffff55a8da0 <g_io_unix_dispatch>
    prev_source = 0x0
    was_in_call = 0
    user_data = 0x555555ce8c20
    callback = 0x5555555c92e0 <pidgin_io_invoke>
    cb_funcs = <optimized out>
    cb_data = 0x555556307640
    need_destroy = <optimized out>
    source = 0x5555563659b0
    current = 0x555555c6e510
    i = 1

#13 0x00007ffff5563bcd in g_main_context_dispatch (context=context@entry=0x555555899a50) at /build/glib2.0-b3wpTa/glib2.0-2.45.2/./glib/gmain.c:3737
#14 0x00007ffff5563fa0 in g_main_context_iterate (context=0x555555899a50, block=block@entry=1, dispatch=dispatch@entry=1, self=) at /build/glib2.0-b3wpTa/glib2.0-2.45.2/./glib/gmain.c:3808

    max_priority = 0
    timeout = 0
    some_ready = 1
    nfds = <optimized out>
    allocated_nfds = 9
    fds = 0x5555563607c0

#15 0x00007ffff55642c2 in g_main_loop_run (loop=0x55555635dc10) at /build/glib2.0-b3wpTa/glib2.0-2.45.2/./glib/gmain.c:4002

    __FUNCTION__ = "g_main_loop_run"

#16 0x00007ffff680e5d7 in gtk_main () at /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#17 0x000055555558f557 in main (argc=1, argv=0x7fffffffe958) at /tmp/buildd/pidgin-2.10.11/./pidgin/gtkmain.c:937

    opt_help = -14880
    opt_version = 1438786976
    opt_config_dir_arg = 0x0
    accounts = 0x0
    sigset = {__val = {82950, 0 <repeats 15 times>}}
    errmsg = '\000' <repeats 152 times>, "\374\"\336\367\377\177", '\000' <repeats 42 times>...
    signal_channel = 0x0
    signal_status = G_IO_STATUS_ERROR
    error = 0x0
    opt = 0
    debug_enabled = 80
    active_accounts = 0x0
    long_options = {{name = 0x55555562c2e7 "config", has_arg = 1, flag = 0x0, val = 99}, {name = 0x55555561a779 "debug", has_arg = 0, flag = 0x0, val = 100}, {name = 0x5555556282d1 "force-online", has_arg = 0, flag = 0x0, val = 102}, {name = 0x55555561c2fa "help", has_arg = 0, flag = 0x0, val = 104}, {name = 0x55555562817d "login", has_arg = 2, flag = 0x0, val = 108}, {name = 0x5555556282de "multiple", has_arg = 0, flag = 0x0, val = 109}, {name = 0x5555556282e7 "nologin", has_arg = 0, flag = 0x0, val = 110}, {name = 0x55555562c2fa "session", has_arg = 1, flag = 0x0, val = 115}, {name = 0x55555561eb7a "version", has_arg = 0, flag = 0x0, val = 118}, {name = 0x55555562c2f0 "display", has_arg = 1, flag = 0x0, val = 68}, {name = 0x555555628e53 "sync", has_arg = 0, flag = 0x0, val = 83}, {name = 0x0, has_arg = 0, flag = 0x0, val = 0}}

(gdb) quit
A debugging session is active.

Inferior 1 [process 446] will be killed.

Quit anyway? (y or n) y

@davidgfnet
Copy link
Owner

I'm pretty sure it crashes because of the std::stoi calls. Can you comopile it as debug and get the same trace again please?
Just "make clean" and then "make debug".
Thanks!!!

@paulrames paulrames linked a pull request Oct 13, 2015 that will close this issue
@paulrames
Copy link

Hi,

I ran into this issue when trying to send an audio file. And yes, the problem are those stoi calls, because there's no width or height for this kind of files.

I've made some changes to fix this and be able to send aac files. I also created a PR for review.

@hoehermann
Copy link

Does this help? Produced by debug build of whatsapp-purple as found on git here today.
Debug output right after audio file upload request:

Tag: iq
at[from]=s.whatsapp.net
at[id]=f1
at[type]=result
Data:  ...
 Tag: duplicate
 at[abitrate]=33
 at[acodec]=aac
 at[asampfreq]=22050
 at[duration]=10
 at[filehash]=REDACTED
 at[mimetype]=audio/aac
 at[size]=40637
 at[type]=audio
 at[url]=https://mmi102.whatsapp.net/d/REDACTED.aac
 Data:  ...

FILE UPLOAD:

{"name":"REDACTED.aac","url":"https://mmi102.whatsapp.net/d/REDACTED.aac","size":"40637","mimetype":"audio/aac","filehash":"REDACTED","type":"audio","width":"","height":""}
terminate called after throwing an instance of 'std::invalid_argument'
  what():  stoi

Program received signal SIGABRT, Aborted.

Backtrace:

#0  0x00007ffff4779cc9 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ffff477d0d8 in __GI_abort () at abort.c:89
#2  0x00007fffec83e6dd in __gnu_cxx::__verbose_terminate_handler() ()
   from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#3  0x00007fffec83c746 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4  0x00007fffec83c791 in std::terminate() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#5  0x00007fffec83c9a8 in __cxa_throw () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#6  0x00007fffec85fcff in std::__throw_invalid_argument(char const*) ()
   from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#7  0x00007fffecdeea4a in __gnu_cxx::__stoa<long, int, char, int> (__convf=0x7ffff4780490 <__GI_strtol>, 
    __name=0x7fffece11481 "stoi", __str=0x7fffecae1bd8 <std::string::_Rep::_S_empty_rep_storage+24> "", 
    __idx=0x0) at /usr/include/c++/4.9/ext/string_conversions.h:65
#8  0x00007fffecded6fd in std::stoi (__str="", __idx=0x0, __base=10)
    at /usr/include/c++/4.9/bits/basic_string.h:2859
#9  0x00007fffecddb97f in WhatsappConnection::updateFileUpload (this=0x5555561196c0, 
    json="\"name\":\"REDACTED.aac\",\"url\":\"https://mmi102.whatsapp.net/d/REDACTED.aac\",\"size\":\"40637\",\"mimetype\":\"audio/aac\",\"filehash\":\REDACTED"...) at whatsapp-protocol.cc:702
#10 0x00007fffecde2eda in WhatsappConnection::processIncomingData (this=0x5555561196c0)
    at whatsapp-protocol.cc:1043
#11 0x00007fffecdd5b08 in WhatsappConnection::receiveCallback (this=0x5555561196c0, data=0x7fffffff7aa0 "\200", 
    len=197) at whatsapp-protocol.cc:258
#12 0x00007fffece0d280 in waprpl_input_cb (data=0x555556119520, source=29, cond=PURPLE_INPUT_READ)
    at wa_purple.cc:733
#13 0x00005555555c84ce in ?? ()
#14 0x00007ffff53a8ce5 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#15 0x00007ffff53a9048 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#16 0x00007ffff53a930a in g_main_loop_run () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#17 0x00007ffff6632447 in gtk_main () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#18 0x000055555558f369 in main ()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants