tgl icon indicating copy to clipboard operation
tgl copied to clipboard

Sending messages during update events not possible.

Open majn opened this issue 10 years ago • 0 comments

Sending messages will call add_log_event for the second time, while it is already called when the update callback is exected. This will alter the global rptr and wptrs and fail an assertion once the execution returns to the first add_log_event call.

This can be especially hurtful when you try to create automatic responses or chat bots.

bildschirmfoto 2015-04-02 um 21 08 30

Here is a stacktrace of the crash:

Assertion failed: (rptr == wptr), function add_log_event, file binlog.c, line 1589.
(lldb) bt
* thread #1: tid = 0x68faf2, 0x00007fff85abf286 libsystem_kernel.dylib`__pthread_kill + 10, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
    frame #0: 0x00007fff85abf286 libsystem_kernel.dylib`__pthread_kill + 10
    frame #1: 0x00007fff87a9e42f libsystem_pthread.dylib`pthread_kill + 90
    frame #2: 0x00007fff8ce01b53 libsystem_c.dylib`abort + 129
    frame #3: 0x00007fff8cdc9c39 libsystem_c.dylib`__assert_rtn + 321
  * frame #4: 0x000000010aa546d3 telegram-adium`add_log_event(TLS=0x000000010391d400, data=0x000000010ada0b50, len=12) + 435 at binlog.c:1589
    frame #5: 0x000000010aa579ab telegram-adium`bl_do_msg_update(TLS=0x000000010391d400, id=1141) + 91 at binlog.c:2345
    frame #6: 0x000000010aa40c15 telegram-adium`get_difference_on_answer(TLS=0x000000010391d400, q=0x00006080002c33a0) + 1429 at queries.c:3490
    frame #7: 0x000000010aa33c0e telegram-adium`tglq_query_result(TLS=0x000000010391d400, id=6133225873747958784) + 1038 at queries.c:400
    frame #8: 0x000000010aa2f746 telegram-adium`work_rpc_result(TLS=0x000000010391d400, c=0x00006080001484b0, msg_id=6133225874300560385) + 214 at mtproto-client.c:856
    frame #9: 0x000000010aa2efae telegram-adium`rpc_execute_answer(TLS=0x000000010391d400, c=0x00006080001484b0, msg_id=6133225874300560385) + 734 at mtproto-client.c:952
    frame #10: 0x000000010aa2ea5d telegram-adium`process_rpc_message(TLS=0x000000010391d400, c=0x00006080001484b0, enc=0x000000010b7e1e10, len=952) + 3037 at mtproto-client.c:1136
    frame #11: 0x000000010aa2c52f telegram-adium`rpc_execute(TLS=0x000000010391d400, c=0x00006080001484b0, op=-1705492338, len=952) + 911 at mtproto-client.c:1191
    frame #12: 0x000000010aa0844a telegram-adium`try_rpc_read(c=0x00006080001484b0) + 1082 at tgp-net.c:428
    frame #13: 0x000000010aa08009 telegram-adium`try_read(c=0x00006080001484b0) + 585 at tgp-net.c:474
    frame #14: 0x000000010aa077c9 telegram-adium`conn_try_read(arg=0x00006080001484b0, source=33, cond=PURPLE_INPUT_READ) + 105 at tgp-net.c:244
    frame #15: 0x00000001006ca3ba AdiumLibpurple`__adium_input_add_block_invoke + 106
    frame #16: 0x0000000102813d43 libdispatch.dylib`_dispatch_client_callout + 8
    frame #17: 0x0000000102821054 libdispatch.dylib`_dispatch_source_latch_and_call + 1239
    frame #18: 0x0000000102818348 libdispatch.dylib`_dispatch_source_invoke + 425
    frame #19: 0x0000000102822a82 libdispatch.dylib`_dispatch_main_queue_callback_4CF + 573
    frame #20: 0x00007fff84d0cc79 CoreFoundation`__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
    frame #21: 0x00007fff84cc930f CoreFoundation`__CFRunLoopRun + 2159
    frame #22: 0x00007fff84cc8858 CoreFoundation`CFRunLoopRunSpecific + 296
    frame #23: 0x00007fff8b9bbaef HIToolbox`RunCurrentEventLoopInMode + 235
    frame #24: 0x00007fff8b9bb86a HIToolbox`ReceiveNextEventCommon + 431
    frame #25: 0x00007fff8b9bb6ab HIToolbox`_BlockUntilNextEventMatchingListInModeWithFilter + 71
    frame #26: 0x00007fff8908af81 AppKit`_DPSNextEvent + 964
    frame #27: 0x00007fff8908a730 AppKit`-[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 194
    frame #28: 0x00007fff8907e593 AppKit`-[NSApplication run] + 594
    frame #29: 0x00007fff89069a14 AppKit`NSApplicationMain + 1832
    frame #30: 0x0000000100044a12 Adium`main + 34
    frame #31: 0x0000000100001f84 Adium`start + 52

majn avatar Apr 03 '15 13:04 majn