baedert / corebird

Native Gtk+ Twitter Client
https://corebird.baedert.org
GNU General Public License v3.0
789 stars 78 forks source link

failed to allocate 18446744073709551594 bytes Trace/breakpoint trap #627

Closed arthurzenika closed 8 years ago

arthurzenika commented 8 years ago
$ corebird 

(corebird:31425): Gtk-WARNING **: Theme parsing error: style.css:158:12: 'min-height' is not a valid property name

(corebird:31425): Gtk-WARNING **: Theme parsing error: style.css:232:12: 'min-height' is not a valid property name

(corebird:31425): Gtk-WARNING **: Theme parsing error: style.css:233:11: 'min-width' is not a valid property name

(corebird:31425): GLib-ERROR **: /build/glib2.0-7IO_Yw/glib2.0-2.48.1/./glib/gmem.c:100: failed to allocate 18446744073709551594 bytes
Trace/breakpoint trap

corebird from PPA :

$ apt-cache policy corebird
corebird:
  Installed: 1.3.2-0build1~ubuntu16.04
  Candidate: 1.3.2-0build1~ubuntu16.04
  Version table:
 *** 1.3.2-0build1~ubuntu16.04 500
        500 http://ppa.launchpad.net/ubuntuhandbook1/corebird/ubuntu xenial/main amd64 Packages
        100 /var/lib/dpkg/status
     1.1-1 500
        500 http://fr.archive.ubuntu.com/ubuntu xenial/universe amd64 Packages

Here are some info about the dependencies:

$ dpkg -l libglib*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                         Version             Architecture        Description
+++-============================-===================-===================-==============================================================
ii  libglib-perl                 3:1.320-2           amd64               interface to the GLib and GObject libraries
ii  libglib2.0-0:amd64           2.48.1-1~ubuntu16.0 amd64               GLib library of C routines
ii  libglib2.0-0:i386            2.48.1-1~ubuntu16.0 i386                GLib library of C routines
ii  libglib2.0-bin               2.48.1-1~ubuntu16.0 amd64               Programs for the GLib library
ii  libglib2.0-cil               2.12.10-6           amd64               CLI binding for the GLib utility library 2.12
ii  libglib2.0-cil-dev           2.12.10-6           amd64               CLI binding for the GLib utility library 2.12
ii  libglib2.0-data              2.48.1-1~ubuntu16.0 all                 Common files for GLib library
ii  libglib2.0-dev               2.48.1-1~ubuntu16.0 amd64               Development files for the GLib library
un  libglib2.0-doc               <none>              <none>              (no description available)
ii  libglib3.0-cil               2.99.3-2            amd64               CLI binding for the GLib library of C routines
ii  libglib3.0-cil-dev           2.99.3-2            amd64               CLI binding for the GLib utility library 2.12
rc  libglibmm-2.4-1c2a:amd64     2.42.0-1            amd64               C++ wrapper for the GLib toolkit (shared libraries)
ii  libglibmm-2.4-1v5:amd64      2.46.3-1            amd64               C++ wrapper for the GLib toolkit (shared libraries)
baedert commented 8 years ago

Does that happen reliably? Can you install glib/gtk+/corebird debug symbols (if they exist...?) and get a backtrace from such a crash?

arthurzenika commented 8 years ago

@baedert has happend at least 3 times this morning. Can you give me more precise instructions for the debug packages and how to launch corebird to get a backtrace ?

loopset commented 8 years ago

Hello! I'm having the same problem also. Here is the output:

$ corebird

(corebird:1871): Gtk-WARNING **: Theme parsing error: style.css:14:13: The 'icon-shadow' property has been renamed to '-gtk-icon-shadow'

(corebird:1871): Gtk-WARNING **: Theme parsing error: style.css:231:16: The 'outline-radius' property has been renamed to '-gtk-outline-radius'

(corebird:1871): Gtk-WARNING **: Theme parsing error: style.css:237:19: The :insensitive pseudo-class is deprecated. Use :disabled instead.

(corebird:1871): GLib-ERROR **: gmem.c:100: failed to allocate 18446744073709551594 bytes
`trap' para punto de parada/seguimiento (`core' generado)

I can provide a backtrace, but i don't know the commands to run with gdb. I'm using the 1.3.2 version on KaOS. Bye

baedert commented 8 years ago

I can't help you with installing the debug symbols since that depends on your distro (but they mostly end with -debug or -dbg).

To get a backtrace, just run gdb corebird (maybe even G_MESSAGES_DEBUG=all gdb corebird to get more info), then type run and press return. Once the process crashes, you can the type bt to get a backtrace (or bt all or even thread apply all bt to get the backtrace of all threads). When that happens it might also be good if you didn't close that terminal so I can ask additional questions (but you can't use corebird then)

loopset commented 8 years ago

Here is the backtrace

The last lines of G_MESSAGES_DEBUG=all gdb corebird:
[New Thread 0x7fffd26b7700 (LWP 1800)]
[New Thread 0x7fffd1ab6700 (LWP 1801)]

(corebird:1301): GLib-ERROR **: gmem.c:100: failed to allocate 18446744073709551594 bytes
[New Thread 0x7fffb3fff700 (LWP 1802)]

Thread 1 "corebird" received signal SIGTRAP, Trace/breakpoint trap.
0x00007ffff52b486b in g_logv () from /usr/lib/libglib-2.0.so.0

(gdb) thread apply all bt

Thread 72 (Thread 0x7fffb3fff700 (LWP 1802)):
#0  0x00007ffff4d8a7e9 in syscall () from /lib/libc.so.6
#1  0x00007ffff52f0e2c in ?? () from /usr/lib/libglib-2.0.so.0
#2  0x00007ffff52d4084 in ?? () from /usr/lib/libglib-2.0.so.0
#3  0x00007ffff504f424 in start_thread () from /lib/libpthread.so.0
#4  0x00007ffff4d8ecad in clone () from /lib/libc.so.6

Thread 71 (Thread 0x7fffd1ab6700 (LWP 1801)):
#0  0x00007ffff4d8ec71 in clone () from /lib/libc.so.6
#1  0x00007ffff504e17a in create_thread () from /lib/libpthread.so.0
#2  0x00007ffff504fbec in pthread_create@@GLIBC_2.2.5 () from /lib/libpthread.so.0
#3  0x00007ffff52f1450 in ?? () from /usr/lib/libglib-2.0.so.0
#4  0x00007ffff52d438f in ?? () from /usr/lib/libglib-2.0.so.0
#5  0x00007ffff52d46ed in ?? () from /usr/lib/libglib-2.0.so.0
#6  0x00007ffff52d4cdd in g_thread_pool_push () from /usr/lib/libglib-2.0.so.0
#7  0x00007ffff5e6b164 in g_task_run_in_thread_sync () from /usr/lib/libgio-2.0.so.0
#8  0x00007fffd996a75d in ?? () from /usr/lib/gio/modules/libgiolibproxy.so
#9  0x00007ffff5e55541 in ?? () from /usr/lib/libgio-2.0.so.0
#10 0x00007ffff5e62723 in g_socket_client_connect () from /usr/lib/libgio-2.0.so.0
---Type <return> to continue, or q <return> to quit---
#11 0x00007ffff6409b53 in ?? () from /usr/lib/libsoup-2.4.so.1
#12 0x00007ffff63e26e3 in ?? () from /usr/lib/libsoup-2.4.so.1
#13 0x00007ffff6405a2a in ?? () from /usr/lib/libsoup-2.4.so.1
#14 0x00007ffff640602e in ?? () from /usr/lib/libsoup-2.4.so.1
#15 0x0000000000491fd7 in ?? ()
#16 0x00007ffff5e6b3dd in ?? () from /usr/lib/libgio-2.0.so.0
#17 0x00007ffff52d4a3e in ?? () from /usr/lib/libglib-2.0.so.0
#18 0x00007ffff52d40b5 in ?? () from /usr/lib/libglib-2.0.so.0
#19 0x00007ffff504f424 in start_thread () from /lib/libpthread.so.0
#20 0x00007ffff4d8ecad in clone () from /lib/libc.so.6

Thread 70 (Thread 0x7fffd26b7700 (LWP 1800)):
#0  0x00007ffff4d8a7e9 in syscall () from /lib/libc.so.6
#1  0x00007ffff52f0e2c in ?? () from /usr/lib/libglib-2.0.so.0
#2  0x00007ffff52d4c3c in g_thread_pool_push () from /usr/lib/libglib-2.0.so.0
#3  0x00007ffff5e6b164 in g_task_run_in_thread_sync () from /usr/lib/libgio-2.0.so.0
#4  0x00007fffd996a75d in ?? () from /usr/lib/gio/modules/libgiolibproxy.so
#5  0x00007ffff5e55541 in ?? () from /usr/lib/libgio-2.0.so.0
#6  0x00007ffff5e62723 in g_socket_client_connect () from /usr/lib/libgio-2.0.so.0
#7  0x00007ffff6409b53 in ?? () from /usr/lib/libsoup-2.4.so.1
---Type <return> to continue, or q <return> to quit---
#8  0x00007ffff63e26e3 in ?? () from /usr/lib/libsoup-2.4.so.1
#9  0x00007ffff6405a2a in ?? () from /usr/lib/libsoup-2.4.so.1
#10 0x00007ffff640602e in ?? () from /usr/lib/libsoup-2.4.so.1
#11 0x0000000000491fd7 in ?? ()
#12 0x00007ffff5e6b3dd in ?? () from /usr/lib/libgio-2.0.so.0
#13 0x00007ffff52d4a3e in ?? () from /usr/lib/libglib-2.0.so.0
#14 0x00007ffff52d40b5 in ?? () from /usr/lib/libglib-2.0.so.0
#15 0x00007ffff504f424 in start_thread () from /lib/libpthread.so.0
#16 0x00007ffff4d8ecad in clone () from /lib/libc.so.6

Thread 4 (Thread 0x7fffe9cd5700 (LWP 1307)):
#0  0x00007ffff4d85c2d in poll () from /lib/libc.so.6
#1  0x00007ffff52ae344 in ?? () from /usr/lib/libglib-2.0.so.0
#2  0x00007ffff52ae6c2 in g_main_loop_run () from /usr/lib/libglib-2.0.so.0
#3  0x00007ffff5ec4fb6 in ?? () from /usr/lib/libgio-2.0.so.0
#4  0x00007ffff52d40b5 in ?? () from /usr/lib/libglib-2.0.so.0
#5  0x00007ffff504f424 in start_thread () from /lib/libpthread.so.0
#6  0x00007ffff4d8ecad in clone () from /lib/libc.so.6

Thread 3 (Thread 0x7fffea4d6700 (LWP 1306)):
---Type <return> to continue, or q <return> to quit---
#0  0x00007ffff4d85c2d in poll () from /lib/libc.so.6
#1  0x00007ffff52ae344 in ?? () from /usr/lib/libglib-2.0.so.0
#2  0x00007ffff52ae44c in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#3  0x00007ffff52ae489 in ?? () from /usr/lib/libglib-2.0.so.0
#4  0x00007ffff52d40b5 in ?? () from /usr/lib/libglib-2.0.so.0
#5  0x00007ffff504f424 in start_thread () from /lib/libpthread.so.0
#6  0x00007ffff4d8ecad in clone () from /lib/libc.so.6

Thread 2 (Thread 0x7fffeacd7700 (LWP 1305)):
#0  0x00007ffff4d85c2d in poll () from /lib/libc.so.6
#1  0x00007ffff52ae344 in ?? () from /usr/lib/libglib-2.0.so.0
#2  0x00007ffff52ae44c in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#3  0x00007fffeacdf26d in ?? () from /usr/lib/gio/modules/libdconfsettings.so
#4  0x00007ffff52d40b5 in ?? () from /usr/lib/libglib-2.0.so.0
#5  0x00007ffff504f424 in start_thread () from /lib/libpthread.so.0
#6  0x00007ffff4d8ecad in clone () from /lib/libc.so.6

Thread 1 (Thread 0x7ffff7f14940 (LWP 1301)):
#0  0x00007ffff52b486b in g_logv () from /usr/lib/libglib-2.0.so.0
#1  0x00007ffff52b49d2 in g_log () from /usr/lib/libglib-2.0.so.0
---Type <return> to continue, or q <return> to quit---
#2  0x00007ffff52b3574 in g_malloc () from /usr/lib/libglib-2.0.so.0
#3  0x00007ffff52dc79f in g_utf8_substring () from /usr/lib/libglib-2.0.so.0
#4  0x0000000000489f86 in ?? ()
#5  0x000000000048b033 in ?? ()
#6  0x000000000041b967 in ?? ()
#7  0x000000000041fc9b in ?? ()
#8  0x0000000000427f0c in ?? ()
#9  0x00007ffff5586ade in g_cclosure_marshal_VOID__BOXEDv () from /usr/lib/libgobject-2.0.so.0
#10 0x00007ffff5584084 in ?? () from /usr/lib/libgobject-2.0.so.0
#11 0x00007ffff559e088 in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
#12 0x00007ffff559e762 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
#13 0x00007ffff63f59e2 in ?? () from /usr/lib/libsoup-2.4.so.1
#14 0x00007ffff63f5df5 in ?? () from /usr/lib/libsoup-2.4.so.1
#15 0x00007ffff63f6a4b in ?? () from /usr/lib/libsoup-2.4.so.1
#16 0x00007ffff63f6c7b in ?? () from /usr/lib/libsoup-2.4.so.1
#17 0x00007ffff52ae02a in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#18 0x00007ffff52ae3a8 in ?? () from /usr/lib/libglib-2.0.so.0
#19 0x00007ffff52ae44c in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#20 0x00007ffff5e8ff6d in g_application_run () from /usr/lib/libgio-2.0.so.0
#21 0x00000000004126e3 in ?? ()
---Type <return> to continue, or q <return> to quit---
#22 0x00007ffff4cc7710 in __libc_start_main () from /lib/libc.so.6
#23 0x00000000004125a9 in ?? ()
(gdb) 

And nothing more :)

baedert commented 8 years ago

Do you still have it open an can do a bt full instead? but only if the calls inside corebird contain the argument values that way, otherwise that's the same. Unfortunate that there don't seem to be any debugging symbols available for corebird in the ppa.

mads5408 commented 8 years ago

I too have this issue

kdave commented 8 years ago

I have a debugging info built, but can't reproduce it inside gdb with G_MESSAGES_DEBUG=all . Besides that, I found an old core file and the bt full command works there, see below. I can tweak the build or add logging if you need. And last thing, the insane value 18446744073709551594 is 0xffffffffffffffea which is -22 and could correspond to negative errno -EINVAL, but I'm not sure if this isn't a false trace.

(gdb) bt full
#0  0x00007f47495220e1 in  () at /usr/lib64/libglib-2.0.so.0
#1  0x00007f4749523137 in g_log_default_handler () at /usr/lib64/libglib-2.0.so.0
#2  0x00007f4749523444 in g_logv () at /usr/lib64/libglib-2.0.so.0
#3  0x00007f474952364f in g_log () at /usr/lib64/libglib-2.0.so.0
#4  0x00007f4749521cb4 in g_malloc () at /usr/lib64/libglib-2.0.so.0
#5  0x00007f474954c8df in g_utf8_substring () at /usr/lib64/libglib-2.0.so.0
#6  0x000000000048eba7 in cb_text_transform_text (text=0x405c550 "Caesar and Fiona are both highly disappointed at the lack of mice based recipes in #EveryDayCook. I told them to wait for the 2nd Edition. https://t.co/eZJ3y4rRaI", entities=0x19be370, n_entities=3, flags=4, n_medias=2, quote_id=0) at TextTransform.c:98
        btw = <optimized out>
        btw_length = <optimized out>
        str = 0x1a78420
        text_len = <optimized out>
        i = <optimized out>
        end_str = <optimized out>
        last_entity_was_trailing = 0
        last_end = 0
        cur_end = 139
#7  0x000000000048ef9c in cb_text_transform_tweet (tweet=<optimized out>, flags=<optimized out>, quote_id=<optimized out>) at TextTransform.c:12
#8  0x000000000048fc93 in cb_tweet_get_filter_text (tweet=0x3d43990) at CbTweet.c:380
        string = 0x1a784a0
        text = <optimized out>
        __func__ = "cb_tweet_get_filter_text"
#9  0x000000000041d9f6 in account_filter_matches (self=0x1a67060, t=t@entry=0x3d43990) at Account.c:2502
        result = 0
        _tmp0_ = 0x3d43990
        _tmp1_ = <optimized out>
        _tmp2_ = <optimized out>
        _tmp3_ = <optimized out>
        _tmp4_ = <optimized out>
        text = 0x0
        _tmp5_ = 0x3d43990
        _tmp6_ = 0x0
        __func__ = "account_filter_matches"
#10 0x0000000000421d8b in home_timeline_real_stream_message_received (obj=0x1a97120, self=0x33dff70) at HomeTimeline.c:784
        _tmp2_ = 0x3d43990
        _tmp88_ = 0x0
        _tmp97_ = 0x0
        _tmp119_ = 0
        _tmp3_ = 0x1a97120
        _tmp60_ = 0
        _tmp89_ = 0x0
        _tmp98_ = 0x0
        _tmp100_ = 0
        _tmp4_ = <optimized out>
        _tmp61_ = 0x0
        _tmp99_ = 0x0
        t = 0x3d43990
        _tmp5_ = <optimized out>
        _tmp62_ =
          {id = <optimized out>, created_at = <optimized out>, author = {id = 0, screen_name = <optimized out>, user_name = <optimized out>}, text = <optimized out>, entities = <optimized out>, n_entities = <optimized out>, medias = <optimized out>, n_medias = <optimized out>}
        _tmp6_ = 0x1a97160
---Type <return> to continue, or q <return> to quit---
        _tmp54_ = <optimized out>
        _tmp90_ = 0x0
        _tmp112_ = 0x0
        _tmp121_ = 0
        now = 0x1a97160
        _tmp7_ = 0x3d43990
        _tmp55_ = 0x3d43990
        _tmp64_ = 0
        _tmp91_ = 0
        _tmp113_ = 0
        _tmp122_ = 0
        _tmp8_ = <optimized out>
        _tmp56_ = 0
        auto_scroll = 0
        _tmp65_ = 0x0
        _tmp92_ = 0
        should_focus = 0
        _tmp114_ = 0
        _tmp66_ = 0
        _tmp93_ = 0
        _tmp115_ = 0
        _tmp58_ = 0
        _tmp116_ = 0x0
        _tmp0_ = 0x1a97160
        _tmp59_ = 0
        _tmp86_ = 0x0
        _tmp108_ = 0
        _tmp117_ = 0
        _tmp1_ = 0x3d43990
        _tmp87_ = 0
        _tmp96_ = 0x0
        stack_size = 0
        _tmp118_ = 0x0
        _tmp1_ = 0x1a97120
        self = 0x33dff70
        _tmp0_ = <optimized out>
        __func__ = "home_timeline_real_stream_message_received"
#11 0x0000000000421d8b in home_timeline_real_stream_message_received (base=<optimized out>, type=<optimized out>, root=0x1a97120) at HomeTimeline.c:436
        _tmp1_ = 0x1a97120
        self = 0x33dff70
        _tmp0_ = <optimized out>
        __func__ = "home_timeline_real_stream_message_received"
#12 0x000000000042a38c in user_stream_parse_data_cb (self=0x1b15210, call=<optimized out>, buf=<optimized out>, length=<optimized out>, _error_=<optimized out>) at UserStream.c:948
        _tmp71_ = <optimized out>
        _tmp74_ = <optimized out>
        _tmp77_ = STREAM_MESSAGE_TYPE_TWEET
        _tmp72_ = <optimized out>
        _tmp75_ = <optimized out>
        _tmp78_ = <optimized out>
        _tmp70_ = <optimized out>
        _tmp73_ = <optimized out>
        _tmp76_ = <optimized out>
---Type <return> to continue, or q <return> to quit---
        _tmp68_ = 0
        i = <optimized out>
        _tmp14_ = <optimized out>
        _tmp19_ = <optimized out>
        _tmp22_ = 0x0
        _tmp35_ = <optimized out>
        _tmp20_ = <optimized out>
        parser = 0x3f352e0
        _tmp25_ = 0x3f352e0
        _tmp38_ = <optimized out>
        _tmp41_ = <optimized out>
        _tmp23_ = <optimized out>
        _tmp36_ = <optimized out>
        type = STREAM_MESSAGE_TYPE_TWEET
        _tmp13_ = <optimized out>
        _tmp21_ = <optimized out>
        _tmp34_ = 0x3f352e0
        _tmp39_ = <optimized out>
        root_node = <optimized out>
        root = 0x1a5cf20
        _tmp37_ = <optimized out>
        _tmp40_ = 0x1a5cf20
        _tmp79_ = 0x0
        _tmp0_ = <optimized out>
        real = <optimized out>
        _tmp3_ = <optimized out>
        _tmp4_ = <optimized out>
        _tmp5_ = <optimized out>
        _tmp6_ = <optimized out>
        _tmp7_ = <optimized out>
        _tmp8_ = <optimized out>
        _tmp9_ = <optimized out>
        _tmp10_ = <optimized out>
        _inner_error_ = 0x0
        __func__ = "user_stream_parse_data_cb"
#13 0x00007f47497f7687 in g_cclosure_marshal_VOID__BOXEDv () at /usr/lib64/libgobject-2.0.so.0
#14 0x00007f47497f4b04 in  () at /usr/lib64/libgobject-2.0.so.0
#15 0x00007f474980f21d in g_signal_emit_valist () at /usr/lib64/libgobject-2.0.so.0
#16 0x00007f474980f90f in g_signal_emit () at /usr/lib64/libgobject-2.0.so.0
#17 0x00007f474a9a1b82 in  () at /usr/lib64/libsoup-2.4.so.1
#18 0x00007f474a9a1fad in  () at /usr/lib64/libsoup-2.4.so.1
#19 0x00007f474a9a2be5 in  () at /usr/lib64/libsoup-2.4.so.1
#20 0x00007f474a9a2e3b in  () at /usr/lib64/libsoup-2.4.so.1
#21 0x00007f474951c52a in g_main_context_dispatch () at /usr/lib64/libglib-2.0.so.0
#22 0x00007f474951c8e0 in  () at /usr/lib64/libglib-2.0.so.0
#23 0x00007f474951c98c in g_main_context_iteration () at /usr/lib64/libglib-2.0.so.0
#24 0x00007f474a41046d in g_application_run () at /usr/lib64/libgio-2.0.so.0
#25 0x0000000000414003 in _vala_main (args=<optimized out>, args_length1=<optimized out>) at main.c:49
        result = 0
        corebird = 0x1805150
        _tmp0_ = 0x1805150
        _tmp1_ = 0x7ffea8eb6618
---Type <return> to continue, or q <return> to quit---
        _tmp1__length1 = 1
        _tmp2_ = 0
#26 0x00007f4748f33291 in __libc_start_main () at /lib64/libc.so.6
#27 0x0000000000413eca in _start () at ../sysdeps/x86_64/start.S:120
baedert commented 8 years ago

Can you go to frame #6 and do...

p i
p entities[0]
p entities[1]
p entities[2]

? It shouldn't depend on the attached media at all so I hope that igives a reproducible test case. Meanwile, I'll debug another crash I just found when composing tweets...

nathanVader commented 8 years ago

Hello, I have same issue:

(corebird:5264): GLib-ERROR **: /build/glib2.0-7IO_Yw/glib2.0-2.48.1/./glib/gmem.c:100: failed to allocate 18446744073709551594 bytes «trap» para punto de parada/seguimiento

kdave commented 8 years ago

I've just caught a fresh one:

(gdb)
#6  0x000000000048eba7 in cb_text_transform_text (
    text=0x3b7dd20 "Okay folks! I've decided to donate all profits from the #400LBHACKER shirt to @Hak4Kidz and @EFF \n\nPlease RT!\n\nhttps://t.co/AP7qFSdYp0 https://t.co/WtprxUumEE", entities=0x3b99c50,
    n_entities=6, flags=1, n_medias=2, quote_id=0) at TextTransform.c:98
98            char *btw = g_utf8_substring (text,
(gdb) l
93
94        str = g_string_new (NULL);
95
96        for (i = (int)n_entities - 1; i >= 0; i --)
97          {
98            char *btw = g_utf8_substring (text,
99                                          entities[i].to,
100                                         cur_end);
101           gsize btw_length = cur_end - entities[i].to;
102
(gdb) p i
$1 = <optimized out>
(gdb) p entities[0]
$2 = {from = 56, to = 68, info = 0, display_text = 0x3b806a0 "#400LBHACKER", tooltip_text = 0x33d1e50 "#400LBHACKER", target = 0x0}
(gdb) p entities[1]
$3 = {from = 78, to = 87, info = 0, display_text = 0x3c323c0 "@Hak4Kidz", tooltip_text = 0x3b80660 "Hak4Kidz", target = 0x3b80680 "@2262322964/@Hak4Kidz"}
(gdb) p entities[2]
$4 = {from = 92, to = 96, info = 0, display_text = 0x3c32270 "@EFF", tooltip_text = 0x3a98de0 "EFF", target = 0x3c32400 "@4816/@EFF"}
(gdb) p text
$5 = 0x3b7dd20 "Okay folks! I've decided to donate all profits from the #400LBHACKER shirt to @Hak4Kidz and @EFF \n\nPlease RT!\n\nhttps://t.co/AP7qFSdYp0 https://t.co/WtprxUumEE"
(gdb) p cur_end
$6 = 135
(gdb) p btw
$7 = <optimized out>
(gdb) i reg
rax            0x0      0
rbx            0x87     135
rcx            0x7fb511e66a80   140415666121344
rdx            0x1      1
rsi            0x0      0
rdi            0x1      1
rbp            0x0      0x0
rsp            0x7ffd395d4630   0x7ffd395d4630
r8             0x7fb511e66a80   140415666121344
r9             0x66     102
r10            0x73     115
r11            0x0      0
r12            0x3b99cf0        62495984
r13            0x3b7dd20        62381344
r14            0x3a2b650        60995152
r15            0x3b99c28        62495784
rip            0x48eba7 0x48eba7 <cb_text_transform_text+167>
eflags         0x202    [ IF ]
cs             0x33     51
ss             0x2b     43
ds             0x0      0
es             0x0      0
fs             0x0      0
gs             0x0      0
(gdb) p n_entities
$8 = 6

I'm keeping it in the gdb state, feel free to ask for more info. I can also build it without -O2 so the variables are not optimized out.

baedert commented 8 years ago

That one has 6 entities attached and not just 3 like the earlier one, can you also print entities[3], entities[4] and entities[5]? I should be able to get a test case from that and look at it later today. Thanks for all the help!

kdave commented 8 years ago
(gdb) p entities[3]
$9 = {from = 111, to = 134, info = 0, display_text = 0x39e3150 "teespring.com/400lbhacker#pi…", tooltip_text = 0x33d1e00 "https://teespring.com/400lbhacker#pid=2&amp;cid=2397&amp;sid=front",
  target = 0x36a7260 "https://teespring.com/400lbhacker#pid=2&amp;cid=2397&amp;sid=front"}
(gdb) p entities[4]
$10 = {from = 135, to = 158, info = 0, display_text = 0x3a5f940 "pic.twitter.com/WtprxUumEE", tooltip_text = 0x0, target = 0x32e9b90 "https://t.co/WtprxUumEE"}
(gdb) p entities[5]
$11 = {from = 135, to = 158, info = 1, display_text = 0x32e9bb0 "pic.twitter.com/WtprxUumEE", tooltip_text = 0x0, target = 0x32e9be0 "https://t.co/WtprxUumEE"}
baedert commented 8 years ago

That commit fixes it for me. Seems to be a problem on Twitter's side but let's check for duplicated entries anyway.

Also congrats to me for that commit message.

loopset commented 8 years ago

Thanks for solve it! :D Sorry, i can't help more with debug 'cause i didn't have time and i would need to compile that packages with debug options.... So, expect to have it solved in a future version, maybe 1.3.3? Bye

baedert commented 8 years ago

Yes, I'll do a 1.3.3 release soon, but I'd have liked someone to confirm that this crash does not happen anymore (since it didn't happen for me in the first place anyway).

kdave commented 8 years ago

Still crashes:

(gdb) bt full
#0  0x00007f40a023d0e1 in  () at /usr/lib64/libglib-2.0.so.0
#1  0x00007f40a023e137 in g_log_default_handler () at /usr/lib64/libglib-2.0.so.0
#2  0x00007f40a023e444 in g_logv () at /usr/lib64/libglib-2.0.so.0
#3  0x00007f40a023e64f in g_log () at /usr/lib64/libglib-2.0.so.0
#4  0x00007f40a023ccb4 in g_malloc () at /usr/lib64/libglib-2.0.so.0
#5  0x00007f40a02678df in g_utf8_substring () at /usr/lib64/libglib-2.0.so.0
#6  0x000000000048eba7 in cb_text_transform_text (text=0x3c40070 "Pleased to be working with top students from @EdinburghUni @AbertayUni  @gcutoday @RobertGordonUni @EdinburghNapier @UofGlasgow #ScotCyber https://t.co/Jnoc919dxn", entities=0x3c3eda0, n_entities=11, flags=4, n_medias=4, quote_id=0) at TextTransform.c:98
        btw = <optimized out>
        btw_length = <optimized out>
        str = 0x7f40680a5800
        text_len = <optimized out>
        i = <optimized out>
        end_str = <optimized out>
        last_entity_was_trailing = 0
        last_end = 0
        cur_end = 139
...
(gdb) i lo
btw = <optimized out>
btw_length = <optimized out>
str = 0x7f40680a5800
text_len = <optimized out>
i = <optimized out>
end_str = <optimized out>
last_entity_was_trailing = 0
last_end = 0
cur_end = 139
(gdb) l
93
94        str = g_string_new (NULL);
95
96        for (i = (int)n_entities - 1; i >= 0; i --)
97          {
98            char *btw = g_utf8_substring (text,
99                                          entities[i].to,
100                                         cur_end);
101           gsize btw_length = cur_end - entities[i].to;
102
(gdb) p n_entities
$1 = 11
(gdb) p *entities
$2 = {from = 45, to = 58, info = 0, display_text = 0x3c3fff0 "@EdinburghUni", tooltip_text = 0x3c40010 "Edinburgh University", target = 0x3c40030 "@23426889/@EdinburghUni"}
(gdb) p entities[1]
$3 = {from = 59, to = 70, info = 0, display_text = 0x3ad0400 "@AbertayUni", tooltip_text = 0x3c3fec0 "Abertay University", target = 0x3c3ffd0 "@20513214/@AbertayUni"}
(gdb) p entities[2]
$4 = {from = 72, to = 81, info = 0, display_text = 0x3c3efd0 "@gcutoday", tooltip_text = 0x3c3ff00 "GlasgowCaledonianUni", target = 0x3ad0440 "@210818073/@gcutoday"}
(gdb) p entities[3]
$5 = {from = 82, to = 98, info = 0, display_text = 0x3c3f010 "@RobertGordonUni", tooltip_text = 0x3c40210 "RobertGordonUni", target = 0x3c3f120 "@111259322/@RobertGordonUni"}
(gdb) p entities[4]
$6 = {from = 99, to = 115, info = 0, display_text = 0x3c3f050 "@EdinburghNapier", tooltip_text = 0x3c3eff0 "Edinburgh Napier Uni", target = 0x3c3f3d0 "@21848274/@EdinburghNapier"}
(gdb) p entities[5]
$7 = {from = 116, to = 127, info = 0, display_text = 0x3c3f0e0 "@UofGlasgow", tooltip_text = 0x3c3f0c0 "Uni of Glasgow", target = 0x3c3f070 "@19760151/@UofGlasgow"}
(gdb) p entities[6]
$8 = {from = 128, to = 138, info = 0, display_text = 0x3c40050 "#ScotCyber", tooltip_text = 0x3c3f150 "#ScotCyber", target = 0x0}
(gdb) p entities[7]
$9 = {from = 139, to = 162, info = 0, display_text = 0x3ad0460 "pic.twitter.com/Jnoc919dxn", tooltip_text = 0x0, target = 0x3c40230 "https://t.co/Jnoc919dxn"}
(gdb) p entities[8]
$10 = {from = 139, to = 162, info = 0, display_text = 0x3c3f170 "pic.twitter.com/Jnoc919dxn", tooltip_text = 0x0, target = 0x3c3f1a0 "https://t.co/Jnoc919dxn"}
(gdb) p entities[9]
$11 = {from = 139, to = 162, info = 0, display_text = 0x3c3f1c0 "pic.twitter.com/Jnoc919dxn", tooltip_text = 0x0, target = 0x3c3f1f0 "https://t.co/Jnoc919dxn"}
(gdb) p entities[10]
$12 = {from = 139, to = 162, info = 1, display_text = 0x3c3f210 "pic.twitter.com/Jnoc919dxn", tooltip_text = 0x0, target = 0x3c3f240 "https://t.co/Jnoc919dxn"}
(gdb) p entities[11]
$13 = {from = 65, to = 0, info = 0, display_text = 0x6d6977742e736270 <error: Cannot access memory at address 0x6d6977742e736270>,
  tooltip_text = 0x656d2f6d6f632e67 <error: Cannot access memory at address 0x656d2f6d6f632e67>, target = 0x537274432f616964 <error: Cannot access memory at address 0x537274432f616964>}
baedert commented 8 years ago

Are you sure you are running a recompiled version with the commit above? I can view, load and receive that tweet on the stream here just fine.

kdave commented 8 years ago

I've double checked, patch is applied and I've uninstalled the previous version completely. One more try.

baedert commented 8 years ago

Did you build it with --enable-debug? One problem that could be is that the json on the streaming connection is different than it is on the rest api (which was also the case before) but that the problem just doesn't exist with retweets (the only way I have right now to make that tweet appear on the stream...). If you configured corebird with --enable-debug, it'll print the tweet json on the console (and you can access it in gdb), among a lot of other spam.

kdave commented 8 years ago

Ok I'll rebuild with --enable-debug.

kdave commented 8 years ago

Built from git 86e580c63ba65bdef8, --enable-debug. I got a different crash:

(gdb) bt full
#0  0x00007f2ff7d2ce85 in g_mutex_lock () at /usr/lib64/libglib-2.0.so.0
#1  0x00007f2ff7ce5191 in g_source_attach () at /usr/lib64/libglib-2.0.so.0
#2  0x00007f2ff8e6b0e8 in soup_add_timeout () at /usr/lib64/libsoup-2.4.so.1
#3  0x00007f2ff8e54150 in  () at /usr/lib64/libsoup-2.4.so.1
#4  0x00007f2ff8e54f23 in  () at /usr/lib64/libsoup-2.4.so.1
#5  0x00007f2ff8e7919f in  () at /usr/lib64/libsoup-2.4.so.1
#6  0x00007f2ff8e797ee in  () at /usr/lib64/libsoup-2.4.so.1
#7  0x0000000000537fa0 in cb_media_downloader_load_threaded (downloader=0x3395760, media=0x51375e0) at MediaDownloader.c:324
        url = 0x551e8f8 "pbs.twimg.com/tweet_video/Ctr-OUOUMAAduDB.mp4"
        msg = 0x7f2fd417cd70
        input_stream = 0x7f2f940039c0
        __func__ = "cb_media_downloader_load_threaded"
#8  0x00000000005380c2 in load_in_thread (task=0x7f2f940039c0, source_object=0x3395760, task_data=0x51375e0, cancellable=0x0) at MediaDownloader.c:356
        downloader = 0x3395760
        media = 0x51375e0
#9  0x00007f2ff88c2a1d in  () at /usr/lib64/libgio-2.0.so.0
#10 0x00007f2ff7d0fb9e in  () at /usr/lib64/libglib-2.0.so.0
#11 0x00007f2ff7d0f1a5 in  () at /usr/lib64/libglib-2.0.so.0
#12 0x00007f2ff7a84454 in start_thread () at /lib64/libpthread.so.0
#13 0x00007f2ff77c73ff in clone () at /lib64/libc.so.6

Last lines in the log output:

** (corebird:6240): DEBUG: UserStream.vala:235: HEARTBEAT(NAME)
Message with type STREAM_MESSAGE_TYPE_TWEET on stream @NAME
{"created_at":"Sat Oct 01 13:54:05 +0000 2016","id":782217022608281601,"id_str":"782217022608281601","text":"Installing Kali appVM. Firewall is applying updates at midnight. COMON APT YOU CAN DO THIS! https:\/\/t.co\/NEvEAGtfRU","display_text_range":[0,91],"source":"\u003ca href=\"http:\/\/twitter.com\/download\/android\" rel=\"nofollow\"\u003eTwitter for Android\u003c\/a\u003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":{"id":3023308260,"id_str":"3023308260","name":"(buffy\u00b2)","screen_name":"errbufferoverfl","location":"00:10:5A:44:12:B5","url":null,"description":"Cyber magician & security sleuth hacking my way towards the robot uprising. Internal Threat Actor & #cakesec thought leader. Views expressed are my own #upright","protected":false,"verified":false,"followers_count":578,"friends_count":389,"listed_count":67,"favourites_count":2497,"statuses_count":3143,"created_at":"Tue Feb 17 05:29:17 +0000 2015","utc_offset":36000,"time_zone":"Melbourne","geo_enabled":false,"lang":"en","contributors_enabled":false,"is_translator":false,"profile_background_color":"77216F","profile_background_image_url":"http:\/\/pbs.twimg.com\/profile_background_images\/689399839734439938\/V4cnXG0s.jpg","profile_background_image_url_https":"https:\/\/pbs.twimg.com\/profile_background_images\/689399839734439938\/V4cnXG0s.jpg","profile_background_tile":false,"profile_link_color":"5E2750","profile_sidebar_border_color":"000000","profile_sidebar_fill_color":"000000","profile_text_color":"000000","profile_use_background_image":true,"profile_image_url":"http:\/\/pbs.twimg.com\/profile_images\/776570154888990721\/QQni0WUX_normal.jpg","profile_image_url_https":"https:\/\/pbs.twimg.com\/profile_images\/776570154888990721\/QQni0WUX_normal.jpg","profile_banner_url":"https:\/\/pbs.twimg.com\/profile_banners\/3023308260\/1474852306","default_profile":false,"default_profile_image":false,"following":null,"follow_request_sent":null,"notifications":null},"geo":null,"coordinates":null,"place":null,"contributors":null,"is_quote_status":false,"retweet_count":0,"favorite_count":0,"entities":{"hashtags":[],"urls":[],"user_mentions":[],"symbols":[],"media":[{"id":782217007202578432,"id_str":"782217007202578432","indices":[92,115],"media_url":"http:\/\/pbs.twimg.com\/tweet_video_thumb\/Ctr-OUOUMAAduDB.jpg","media_url_https":"https:\/\/pbs.twimg.com\/tweet_video_thumb\/Ctr-OUOUMAAduDB.jpg","url":"https:\/\/t.co\/NEvEAGtfRU","display_url":"pic.twitter.com\/NEvEAGtfRU","expanded_url":"https:\/\/twitter.com\/errbufferoverfl\/status\/782217022608281601\/photo\/1","type":"photo","sizes":{"medium":{"w":500,"h":308,"resize":"fit"},"small":{"w":340,"h":209,"resize":"fit"},"large":{"w":500,"h":308,"resize":"fit"},"thumb":{"w":150,"h":150,"resize":"crop"}}}]},"extended_entities":{"media":[{"id":782217007202578432,"id_str":"782217007202578432","indices":[92,115],"media_url":"http:\/\/pbs.twimg.com\/tweet_video_thumb\/Ctr-OUOUMAAduDB.jpg","media_url_https":"https:\/\/pbs.twimg.com\/tweet_video_thumb\/Ctr-OUOUMAAduDB.jpg","url":"https:\/\/t.co\/NEvEAGtfRU","display_url":"pic.twitter.com\/NEvEAGtfRU","expanded_url":"https:\/\/twitter.com\/errbufferoverfl\/status\/782217022608281601\/photo\/1","type":"animated_gif","sizes":{"medium":{"w":500,"h":308,"resize":"fit"},"small":{"w":340,"h":209,"resize":"fit"},"large":{"w":500,"h":308,"resize":"fit"},"thumb":{"w":150,"h":150,"resize":"crop"}},"video_info":{"aspect_ratio":[125,77],"variants":[{"bitrate":0,"content_type":"video\/mp4","url":"https:\/\/pbs.twimg.com\/tweet_video\/Ctr-OUOUMAAduDB.mp4"}]}}]},"favorited":false,"retweeted":false,"possibly_sensitive":false,"filter_level":"low","lang":"en","timestamp_ms":"1475330045736"}

(corebird:6240): GLib-CRITICAL **: g_main_context_ref: assertion 'g_atomic_int_get (&context->ref_count) > 0' failed
** (corebird:6240): DEBUG: DefaultTimeline.vala:25: Unread count for @NAME from 43 to 44
** (corebird:6240): DEBUG: DefaultTimeline.vala:27: New unread count for @NAME: 44
** (corebird:6240): DEBUG: BadgeRadioButton.vala:23: New show_badge value: true
baedert commented 8 years ago

Did that by any chance happen while you were closing the application?

kdave commented 8 years ago

No, I just left it running in the background, occasionally scrolling.

kdave commented 8 years ago

No other crash, quitting the application was ok.

baedert commented 8 years ago

I have no idea what's going on with that last backtrace but a new release with the current fixes seems overdue anyway.

kdave commented 8 years ago

I think the original problem has been fixed, so feel free to close this. I'll see if I can reproduce the strange crash agian.

baedert commented 8 years ago

Okay, thanks again for all the help!