Bug 41039 - wocky tries to allocate too much memory
Summary: wocky tries to allocate too much memory
Status: RESOLVED NOTOURBUG
Alias: None
Product: Wocky
Classification: Unclassified
Component: General (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Telepathy bugs list
QA Contact: Telepathy bugs list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-20 07:01 UTC by Vincent Untz
Modified: 2011-09-26 06:32 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Vincent Untz 2011-09-20 07:01:46 UTC
This is with the wocky version from gabble 0.13.5.

I can't connect to jabber in empathy because telepathy-gabble crashes with
this:
GLib-ERROR **: gmem.c:170: failed to allocate 4294967269 bytes

(gdb) bt
#0  g_logv (log_domain=0xb77fa1a6 "GLib", log_level=<optimized out>, format=
    0xb7801ae4 "%s: failed to allocate %u bytes", args1=
    0xbfffe66c "\241\034\200\267\345\377\377\377\340\274#\b\364\237Է\311\367B\b\207y{\267\364O\206\267") at gmessages.c:577
#1  0xb77b9d43 in g_log (log_domain=0xb77fa1a6 "GLib", log_level=G_LOG_LEVEL_ERROR, format=
    0xb7801ae4 "%s: failed to allocate %u bytes") at gmessages.c:591
#2  0xb77b79ee in g_malloc (n_bytes=4294967269) at gmem.c:169
#3  0xb77cfcd4 in g_memdup (mem=0x842e3c4, byte_size=4294967269) at gstrfuncs.c:128
#4  0x08125b9a in wocky_tls_session_push_func (user_data=0x824c020, buffer=0x842e3c4, count=
    4294967269) at wocky-tls.c:1262
#5  0xb7c87d67 in _gnutls_writev_emu (giovec_cnt=<optimized out>, giovec=<optimized out>, 
    fd=<optimized out>, session=<optimized out>) at gnutls_buffers.c:322
#6  _gnutls_writev (giovec_cnt=3, giovec=0xbfffe778, session=0x825a0b8) at gnutls_buffers.c:349
#7  _gnutls_io_write_flush (session=0x825a0b8) at gnutls_buffers.c:564
#8  0xb7c8828c in _gnutls_handshake_io_write_flush (session=0x825a0b8) at gnutls_buffers.c:679
#9  0xb7c8a0cd in _gnutls_send_handshake (session=0x825a0b8, bufel=0x83e1cd0, type=
    GNUTLS_HANDSHAKE_FINISHED) at gnutls_handshake.c:1133
#10 0xb7c8a56d in _gnutls_send_finished (again=<optimized out>, session=0x825a0b8)
    at gnutls_handshake.c:667
#11 _gnutls_send_handshake_final (session=0x825a0b8, init=<optimized out>)
    at gnutls_handshake.c:2600
#12 0xb7c8c6a0 in _gnutls_handshake_common (session=0x825a0b8) at gnutls_handshake.c:2822
#13 0xb7c8dfb9 in gnutls_handshake (session=0x825a0b8) at gnutls_handshake.c:2342
#14 0x08123eeb in wocky_tls_session_try_operation (session=0x824c020 [WockyTLSSession], 
    operation=<optimized out>) at wocky-tls.c:405
#15 0xb7949488 in async_ready_callback_wrapper (source_object=0x824a870 [GSocketInputStream], 
    res=0x824acf0, user_data=0x824c020) at ginputstream.c:470
#16 0xb795b8c0 in g_simple_async_result_complete (simple=0x824acf0 [GSimpleAsyncResult])
    at gsimpleasyncresult.c:749
#17 0xb796485f in g_socket_input_stream_read_ready (socket=0x8216330 [GSocket], condition=
    G_IO_IN, stream=0x824a870 [GSocketInputStream]) at gsocketinputstream.c:155
#18 0xb795c0fb in socket_source_dispatch (source=0x8244710, callback=
---Type <return> to continue, or q <return> to quit---
    0xb7964790 <g_socket_input_stream_read_ready>, user_data=0x824a870) at gsocket.c:2504
#19 0xb77b0e7f in g_main_dispatch (context=0x81ee390) at gmain.c:2441
#20 g_main_context_dispatch (context=0x81ee390) at gmain.c:3011
#21 0xb77b15b0 in g_main_context_iterate (context=0x81ee390, block=-1216610336, dispatch=1, 
    self=<optimized out>) at gmain.c:3089
#22 0xb77b1bbb in g_main_loop_run (loop=0x81f94d8) at gmain.c:3297
#23 0xb7bc4f60 in tp_run_connection_manager () from /usr/lib/libtelepathy-glib.so.0
#24 0x08074b20 in gabble_main (argc=1, argv=0xbfffed54) at gabble.c:177
#25 0x080746d0 in main (argc=1, argv=0xbfffed54) at main.c:28
Comment 1 Vincent Untz 2011-09-20 07:03:01 UTC
I have gnutls 3.0.0, fwiw.
Comment 2 Simon McVittie 2011-09-20 08:27:04 UTC
> #4  0x08125b9a in wocky_tls_session_push_func (user_data=0x824c020,
> buffer=0x842e3c4, count=
>     4294967269) at wocky-tls.c:1262

It looks as though the ridiculously large count came from the caller (gnutls), so this is probably a gnutls bug?
Comment 3 Dan Winship 2011-09-20 08:49:45 UTC
(In reply to comment #1)
> I have gnutls 3.0.0, fwiw.

that may be your problem. 3.0 is not 100% API compatible with 2.x. I already had to make one change in glib-networking (though it wouldn't affect this case).

try building wocky from source and running "make check"?
Comment 4 Vincent Untz 2011-09-20 14:37:06 UTC
I built gnutls 3.0.3, and the issue is not there anymore. However, I get a GNUTLS_E_COMPRESSION_FAILED error now -- no idea what this means, but this makes me believe this change in gnutls 3.0.2 is the fix:

 ** libgnutls: Corrected issue in gnutls_record_recv() triggered on encryption or compression error.
Comment 5 Vincent Untz 2011-09-26 06:32:37 UTC
Re my last issue related to compression, this gnutls patch fixes it: http://git.savannah.gnu.org/gitweb/?p=gnutls.git;a=commit;h=f3abb3c8e37dfdb0881c23499abf4fe3aa779e14


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.