tdlib / td

Cross-platform library for building Telegram clients
https://core.telegram.org/tdlib
Boost Software License 1.0
7.23k stars 1.47k forks source link

Crash td_json_client_destroy #55

Closed isopen closed 6 years ago

isopen commented 6 years ago

I do not understand what's the matter. Other methods work. I'm submitting a pointer to the input. Example https://github.com/isopen/tdlib/blob/master/index.rb Such an implementation(ffi): attach_function :td_json_client_destroy, [:pointer], :void https://github.com/ffi/ffi/wiki/types

ruby index.rb {"@type"=>"textEntities", "entities"=>[{"@type"=>"textEntity", "offset"=>0, "length"=>9, "type"=>{"@type"=>"textEntityTypeMention"}}, {"@type"=>"textEntity", "offset"=>10, "length"=>13, "type"=>{"@type"=>"textEntityTypeBotCommand"}}, {"@type"=>"textEntity", "offset"=>24, "length"=>20, "type"=>{"@type"=>"textEntityTypeUrl"}}, {"@type"=>"textEntity", "offset"=>45, "length"=>11, "type"=>{"@type"=>"textEntityTypeUrl"}}], "@extra"=>["5", 7.0]} [ 2][t 4][1518105093.368179083][Td.cpp:4038][!Td] Close [destroy:false] index.rb:47: [BUG] Segmentation fault at 0x00000000000089 ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-linux]

-- Control frame information ----------------------------------------------- c:0003 p:---- s:0008 e:000007 CFUNC :td_json_client_destroy c:0002 p:0133 s:0004 E:002320 EVAL index.rb:47 [FINISH] c:0001 p:0000 s:0002 E:001520 (none) [FINISH]

-- Ruby level backtrace information ---------------------------------------- index.rb:47:in <main>' index.rb:47:intd_json_client_destroy'

-- Machine register context ------------------------------------------------ RIP: 0x00007f7cba29557c RBP: 0x00007f7cb37fd710 RSP: 0x00007f7cb37fd700 RAX: 0x0000000000000021 RBX: 0x0000000000000021 RCX: 0x00007f7cb37fd570 RDX: 0x0000000000000002 RDI: 0x0000000000000021 RSI: 0x000055c859fe2ce0 R8: 0x0000000000000009 R9: 0x0000000000000021 R10: 0x00007f7cb2efd058 R11: 0x0000000000000000 R12: 0x0000000000000000 R13: 0x00007f7cb37fd7b0 R14: 0x0000000000000000 R15: 0x0000000000000000 EFL: 0x0000000000010206

-- C level backtrace information ------------------------------------------- /usr/local/rvm/rubies/ruby-2.3.3/lib/libruby.so.2.3(rb_vm_bugreport+0x4e8) [0x7f7cbd9cdd68] vm_dump.c:692 /usr/local/rvm/rubies/ruby-2.3.3/lib/libruby.so.2.3(rb_bug_context+0xd4) [0x7f7cbd85f534] error.c:435 /usr/local/rvm/rubies/ruby-2.3.3/lib/libruby.so.2.3(sigsegv+0x3e) [0x7f7cbd93bdce] signal.c:890 /lib/x86_64-linux-gnu/libpthread.so.0 [0x7f7cbd5d50c0] /home/user/prog/build/libtdjson.so(_ZN2td4TdDb9flush_allEv+0xc) [0x7f7cba29557c] /home/user/prog/build/libtdjson.so [0x7f7cba1f41f6] /home/user/prog/build/libtdjson.so [0x7f7cba1f4341] /home/user/prog/build/libtdjson.so [0x7f7cba7e8a24] /home/user/prog/build/libtdjson.so [0x7f7cba1a4c58] /home/user/prog/build/libtdjson.so [0x7f7cba1a54a9] /home/user/prog/build/libtdjson.so [0x7f7cba1a5787] /home/user/prog/build/libtdjson.so [0x7f7cba7e870d] /home/user/prog/build/libtdjson.so [0x7f7cba7edc93] /home/user/prog/build/libtdjson.so [0x7f7cba7ee01a] /home/user/prog/build/libtdjson.so [0x7f7cba7ee528] /home/user/prog/build/libtdjson.so [0x7f7cba7e5ac8] /home/user/prog/build/libtdjson.so [0x7f7cba19fd01] /usr/lib/x86_64-linux-gnu/libstdc++.so.6 [0x7f7cb946ee6f] /lib/x86_64-linux-gnu/libpthread.so.0 [0x7f7cbd5cb494] /lib/x86_64-linux-gnu/libc.so.6(__clone+0x3f) [0x7f7cbc94aaff]

-- Other runtime information -----------------------------------------------

55c85799f000-55c8579a0000 r-xp 00000000 08:01 934726 /usr/local/rvm/rubies/ruby-2.3.3/bin/ruby 55c857b9f000-55c857ba0000 r--p 00000000 08:01 934726 /usr/local/rvm/rubies/ruby-2.3.3/bin/ruby 55c857ba0000-55c857ba1000 rw-p 00001000 08:01 934726 /usr/local/rvm/rubies/ruby-2.3.3/bin/ruby 55c859b83000-55c85a085000 rw-p 00000000 00:00 0 [heap] 7f7c9c000000-7f7c9c021000 rw-p 00000000 00:00 0 7f7c9c021000-7f7ca0000000 ---p 00000000 00:00 0 7f7ca4000000-7f7ca4021000 rw-p 00000000 00:00 0 7f7ca4021000-7f7ca8000000 ---p 00000000 00:00 0 7f7cac000000-7f7cac021000 rw-p 00000000 00:00 0 7f7cac021000-7f7cb0000000 ---p 00000000 00:00 0 7f7cb0f68000-7f7cb1105000 r--s 00000000 08:01 1572872 /lib/x86_64-linux-gnu/libc-2.24.so 7f7cb1105000-7f7cb1284000 r--s 00000000 08:01 5641598 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.22 7f7cb1284000-7f7cb2128000 r--s 00000000 08:01 3024634 /home/user/prog/build/libtdjson.so 7f7cb2128000-7f7cb2efd000 r--s 00000000 08:01 934728 /usr/local/rvm/rubies/ruby-2.3.3/lib/libruby.so.2.3.0 7f7cb2efd000-7f7cb2ffe000 rw-p 00000000 00:00 0 7f7cb2ffe000-7f7cb2fff000 ---p 00000000 00:00 0 7f7cb2fff000-7f7cb37ff000 rw-p 00000000 00:00 0 7f7cb37ff000-7f7cb3800000 ---p 00000000 00:00 0 7f7cb3800000-7f7cb4000000 rw-p 00000000 00:00 0 7f7cb4000000-7f7cb4021000 rw-p 00000000 00:00 0 7f7cb4021000-7f7cb8000000 ---p 00000000 00:00 0 7f7cb809b000-7f7cb819c000 rw-p 00000000 00:00 0 7f7cb819c000-7f7cb819d000 ---p 00000000 00:00 0 7f7cb819d000-7f7cb899d000 rw-p 00000000 00:00 0 7f7cb899d000-7f7cb899e000 ---p 00000000 00:00 0 7f7cb899e000-7f7cb919e000 rw-p 00000000 00:00 0 7f7cb919e000-7f7cb91b4000 r-xp 00000000 08:01 1572868 /lib/x86_64-linux-gnu/libgcc_s.so.1 7f7cb91b4000-7f7cb93b3000 ---p 00016000 08:01 1572868 /lib/x86_64-linux-gnu/libgcc_s.so.1 7f7cb93b3000-7f7cb93b4000 r--p 00015000 08:01 1572868 /lib/x86_64-linux-gnu/libgcc_s.so.1 7f7cb93b4000-7f7cb93b5000 rw-p 00016000 08:01 1572868 /lib/x86_64-linux-gnu/libgcc_s.so.1 7f7cb93b5000-7f7cb9527000 r-xp 00000000 08:01 5641598 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.22 7f7cb9527000-7f7cb9727000 ---p 00172000 08:01 5641598 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.22 7f7cb9727000-7f7cb9731000 r--p 00172000 08:01 5641598 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.22 7f7cb9731000-7f7cb9733000 rw-p 0017c000 08:01 5641598 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.22 7f7cb9733000-7f7cb9737000 rw-p 00000000 00:00 0 7f7cb9737000-7f7cb9750000 r-xp 00000000 08:01 4083 /usr/local/lib/libz.so.1.2.7 7f7cb9750000-7f7cb994f000 ---p 00019000 08:01 4083 /usr/local/lib/libz.so.1.2.7 7f7cb994f000-7f7cb9950000 r--p 00018000 08:01 4083 /usr/local/lib/libz.so.1.2.7 7f7cb9950000-7f7cb9951000 rw-p 00019000 08:01 4083 /usr/local/lib/libz.so.1.2.7 7f7cb9951000-7f7cb9bb6000 r-xp 00000000 08:01 5641720 /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1 7f7cb9bb6000-7f7cb9db5000 ---p 00265000 08:01 5641720 /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1 7f7cb9db5000-7f7cb9dd3000 r--p 00264000 08:01 5641720 /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1 7f7cb9dd3000-7f7cb9de1000 rw-p 00282000 08:01 5641720 /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1 7f7cb9de1000-7f7cb9de4000 rw-p 00000000 00:00 0 7f7cb9de4000-7f7cb9e46000 r-xp 00000000 08:01 5641722 /usr/lib/x86_64-linux-gnu/libssl.so.1.1 7f7cb9e46000-7f7cba046000 ---p 00062000 08:01 5641722 /usr/lib/x86_64-linux-gnu/libssl.so.1.1 7f7cba046000-7f7cba04a000 r--p 00062000 08:01 5641722 /usr/lib/x86_64-linux-gnu/libssl.so.1.1 7f7cba04a000-7f7cba050000 rw-p 00066000 08:01 5641722 /usr/lib/x86_64-linux-gnu/libssl.so.1.1 7f7cba050000-7f7cbaaa4000 r-xp 00000000 08:01 3024634 /home/user/prog/build/libtdjson.so 7f7cbaaa4000-7f7cbaca3000 ---p 00a54000 08:01 3024634 /home/user/prog/build/libtdjson.so 7f7cbaca3000-7f7cbad02000 r--p 00a53000 08:01 3024634 /home/user/prog/build/libtdjson.so 7f7cbad02000-7f7cbad05000 rw-p 00ab2000 08:01 3024634 /home/user/prog/build/libtdjson.so 7f7cbad05000-7f7cbb106000 rw-p 00000000 00:00 0 7f7cbb106000-7f7cbb110000 r-xp 00000000 08:01 1071930 /usr/local/rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/x86_64-linux/json/ext/generator.so 7f7cbb110000-7f7cbb30f000 ---p 0000a000 08:01 1071930 /usr/local/rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/x86_64-linux/json/ext/generator.so 7f7cbb30f000-7f7cbb310000 r--p 00009000 08:01 1071930 /usr/local/rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/x86_64-linux/json/ext/generator.so 7f7cbb310000-7f7cbb311000 rw-p 0000a000 08:01 1071930 /usr/local/rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/x86_64-linux/json/ext/generator.so 7f7cbb311000-7f7cbb312000 r-xp 00000000 08:01 1071980 /usr/local/rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/x86_64-linux/enc/utf_32le.so 7f7cbb312000-7f7cbb512000 ---p 00001000 08:01 1071980 /usr/local/rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/x86_64-linux/enc/utf_32le.so 7f7cbb512000-7f7cbb513000 r--p 00001000 08:01 1071980 /usr/local/rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/x86_64-linux/enc/utf_32le.so 7f7cbb513000-7f7cbb514000 rw-p 00002000 08:01 1071980 /usr/local/rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/x86_64-linux/enc/utf_32le.so 7f7cbb514000-7f7cbb515000 r-xp 00000000 08:01 1071981 /usr/local/rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/x86_64-linux/enc/utf_32be.so 7f7cbb515000-7f7cbb715000 ---p 00001000 08:01 1071981 /usr/local/rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/x86_64-linux/enc/utf_32be.so 7f7cbb715000-7f7cbb716000 r--p 00001000 08:01 1071981 /usr/local/rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/x86_64-linux/enc/utf_32be.so 7f7cbb716000-7f7cbb717000 rw-p 00002000 08:01 1071981 /usr/local/rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/x86_64-linux/enc/utf_32be.so 7f7cbb717000-7f7cbb718000 r-xp 00000000 08:01 1071948 /usr/local/rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/x86_64-linux/enc/utf_16le.so 7f7cbb718000-7f7cbb918000 ---p 00001000 08:01 1071948 /usr/local/rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/x86_64-linux/enc/utf_16le.so 7f7cbb918000-7f7cbb919000 r--p 00001000 08:01 1071948 /usr/local/rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/x86_64-linux/enc/utf_16le.so 7f7cbb919000-7f7cbb91a000 rw-p 00002000 08:01 1071948 /usr/local/rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/x86_64-linux/enc/utf_16le.so 7f7cbb91a000-7f7cbb91b000 r-xp 00000000 08:01 1071954 /usr/local/rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/x86_64-linux/enc/utf_16be.so 7f7cbb91b000-7f7cbbb1b000 ---p 00001000 08:01 1071954 /usr/local/rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/x86_64-linux/enc/utf_16be.so 7f7cbbb1b000-7f7cbbb1c000 r--p 00001000 08:01 1071954 /usr/local/rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/x86_64-linux/enc/utf_16be.so 7f7cbbb1c000-7f7cbbb1d000 rw-p 00002000 08:01 1071954 /usr/local/rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/x86_64-linux/enc/utf_16be.so 7f7cbbb1d000-7f7cbbb23000 r-xp 00000000 08:01 1071931 /usr/local/rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/x86_64-linux/json/ext/parser.so 7f7cbbb23000-7f7cbbd22000 ---p 00006000 08:01 1071931 /usr/local/rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/x86_64-linux/json/ext/parser.so 7f7cbbd22000-7f7cbbd23000 r--p 00005000 08:01 1071931 /usr/local/rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/x86_64-linux/json/ext/parser.so 7f7cbbd23000-7f7cbbd24000 rw-p 00006000 08:01 1071931 /usr/local/rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/x86_64-linux/json/ext/parser.so 7f7cbbd24000-7f7cbbd2b000 r-xp 00000000 08:01 5640465 /usr/lib/x86_64-linux-gnu/libffi.so.6.0.4 7f7cbbd2b000-7f7cbbf2b000 ---p 00007000 08:01 5640465 /usr/lib/x86_64-linux-gnu/libffi.so.6.0.4 7f7cbbf2b000-7f7cbbf2c000 r--p 00007000 08:01 5640465 /usr/lib/x86_64-linux-gnu/libffi.so.6.0.4 7f7cbbf2c000-7f7cbbf2d000 rw-p 00008000 08:01 5640465 /usr/lib/x86_64-linux-gnu/libffi.so.6.0.4 7f7cbbf2d000-7f7cbbf4f000 r-xp 00000000 08:01 1073734 /usr/local/rvm/gems/ruby-2.3.3/gems/ffi-1.9.21/lib/ffi_c.so 7f7cbbf4f000-7f7cbc14f000 ---p 00022000 08:01 1073734 /usr/local/rvm/gems/ruby-2.3.3/gems/ffi-1.9.21/lib/ffi_c.so 7f7cbc14f000-7f7cbc150000 r--p 00022000 08:01 1073734 /usr/local/rvm/gems/ruby-2.3.3/gems/ffi-1.9.21/lib/ffi_c.so 7f7cbc150000-7f7cbc151000 rw-p 00023000 08:01 1073734 /usr/local/rvm/gems/ruby-2.3.3/gems/ffi-1.9.21/lib/ffi_c.so 7f7cbc151000-7f7cbc159000 r-xp 00000000 08:01 934965 /usr/local/rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/x86_64-linux/stringio.so 7f7cbc159000-7f7cbc358000 ---p 00008000 08:01 934965 /usr/local/rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/x86_64-linux/stringio.so 7f7cbc358000-7f7cbc359000 r--p 00007000 08:01 934965 /usr/local/rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/x86_64-linux/stringio.so 7f7cbc359000-7f7cbc35a000 rw-p 00008000 08:01 934965 /usr/local/rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/x86_64-linux/stringio.so 7f7cbc35a000-7f7cbc35d000 r-xp 00000000 08:01 1071963 /usr/local/rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/x86_64-linux/enc/trans/transdb.so 7f7cbc35d000-7f7cbc55c000 ---p 00003000 08:01 1071963 /usr/local/rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/x86_64-linux/enc/trans/transdb.so 7f7cbc55c000-7f7cbc55d000 r--p 00002000 08:01 1071963 /usr/local/rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/x86_64-linux/enc/trans/transdb.so 7f7cbc55d000-7f7cbc55e000 rw-p 00003000 08:01 1071963 /usr/local/rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/x86_64-linux/enc/trans/transdb.so 7f7cbc55e000-7f7cbc560000 r-xp 00000000 08:01 1071938 /usr/local/rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/x86_64-linux/enc/encdb.so 7f7cbc560000-7f7cbc75f000 ---p 00002000 08:01 1071938 /usr/local/rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/x86_64-linux/enc/encdb.so 7f7cbc75f000-7f7cbc760000 r--p 00001000 08:01 1071938 /usr/local/rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/x86_64-linux/enc/encdb.so 7f7cbc760000-7f7cbc761000 rw-p 00002000 08:01 1071938 /usr/local/rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/x86_64-linux/enc/encdb.so 7f7cbc761000-7f7cbc862000 rw-p 00000000 00:00 0 7f7cbc862000-7f7cbc9f7000 r-xp 00000000 08:01 1572872 /lib/x86_64-linux-gnu/libc-2.24.so 7f7cbc9f7000-7f7cbcbf7000 ---p 00195000 08:01 1572872 /lib/x86_64-linux-gnu/libc-2.24.so 7f7cbcbf7000-7f7cbcbfb000 r--p 00195000 08:01 1572872 /lib/x86_64-linux-gnu/libc-2.24.so 7f7cbcbfb000-7f7cbcbfd000 rw-p 00199000 08:01 1572872 /lib/x86_64-linux-gnu/libc-2.24.so 7f7cbcbfd000-7f7cbcc01000 rw-p 00000000 00:00 0 7f7cbcc01000-7f7cbcd04000 r-xp 00000000 08:01 1572876 /lib/x86_64-linux-gnu/libm-2.24.so 7f7cbcd04000-7f7cbcf03000 ---p 00103000 08:01 1572876 /lib/x86_64-linux-gnu/libm-2.24.so 7f7cbcf03000-7f7cbcf04000 r--p 00102000 08:01 1572876 /lib/x86_64-linux-gnu/libm-2.24.so 7f7cbcf04000-7f7cbcf05000 rw-p 00103000 08:01 1572876 /lib/x86_64-linux-gnu/libm-2.24.so 7f7cbcf05000-7f7cbcf0d000 r-xp 00000000 08:01 1572874 /lib/x86_64-linux-gnu/libcrypt-2.24.so 7f7cbcf0d000-7f7cbd10d000 ---p 00008000 08:01 1572874 /lib/x86_64-linux-gnu/libcrypt-2.24.so 7f7cbd10d000-7f7cbd10e000 r--p 00008000 08:01 1572874 /lib/x86_64-linux-gnu/libcrypt-2.24.so 7f7cbd10e000-7f7cbd10f000 rw-p 00009000 08:01 1572874 /lib/x86_64-linux-gnu/libcrypt-2.24.so 7f7cbd10f000-7f7cbd13d000 rw-p 00000000 00:00 0 7f7cbd13d000-7f7cbd140000 r-xp 00000000 08:01 1572875 /lib/x86_64-linux-gnu/libdl-2.24.so 7f7cbd140000-7f7cbd33f000 ---p 00003000 08:01 1572875 /lib/x86_64-linux-gnu/libdl-2.24.so 7f7cbd33f000-7f7cbd340000 r--p 00002000 08:01 1572875 /lib/x86_64-linux-gnu/libdl-2.24.so 7f7cbd340000-7f7cbd341000 rw-p 00003000 08:01 1572875 /lib/x86_64-linux-gnu/libdl-2.24.so 7f7cbd341000-7f7cbd3c2000 r-xp 00000000 08:01 5640458 /usr/lib/x86_64-linux-gnu/libgmp.so.10.3.2 7f7cbd3c2000-7f7cbd5c2000 ---p 00081000 08:01 5640458 /usr/lib/x86_64-linux-gnu/libgmp.so.10.3.2 7f7cbd5c2000-7f7cbd5c3000 r--p 00081000 08:01 5640458 /usr/lib/x86_64-linux-gnu/libgmp.so.10.3.2 7f7cbd5c3000-7f7cbd5c4000 rw-p 00082000 08:01 5640458 /usr/lib/x86_64-linux-gnu/libgmp.so.10.3.2 7f7cbd5c4000-7f7cbd5dc000 r-xp 00000000 08:01 1572887 /lib/x86_64-linux-gnu/libpthread-2.24.so 7f7cbd5dc000-7f7cbd7db000 ---p 00018000 08:01 1572887 /lib/x86_64-linux-gnu/libpthread-2.24.so 7f7cbd7db000-7f7cbd7dc000 r--p 00017000 08:01 1572887 /lib/x86_64-linux-gnu/libpthread-2.24.so 7f7cbd7dc000-7f7cbd7dd000 rw-p 00018000 08:01 1572887 /lib/x86_64-linux-gnu/libpthread-2.24.so 7f7cbd7dd000-7f7cbd7e1000 rw-p 00000000 00:00 0 7f7cbd7e1000-7f7cbdab4000 r-xp 00000000 08:01 934728 /usr/local/rvm/rubies/ruby-2.3.3/lib/libruby.so.2.3.0 7f7cbdab4000-7f7cbdcb3000 ---p 002d3000 08:01 934728 /usr/local/rvm/rubies/ruby-2.3.3/lib/libruby.so.2.3.0 7f7cbdcb3000-7f7cbdcb9000 r--p 002d2000 08:01 934728 /usr/local/rvm/rubies/ruby-2.3.3/lib/libruby.so.2.3.0 7f7cbdcb9000-7f7cbdcbc000 rw-p 002d8000 08:01 934728 /usr/local/rvm/rubies/ruby-2.3.3/lib/libruby.so.2.3.0 7f7cbdcbc000-7f7cbdccd000 rw-p 00000000 00:00 0 7f7cbdccd000-7f7cbdcf0000 r-xp 00000000 08:01 1572867 /lib/x86_64-linux-gnu/ld-2.24.so 7f7cbdcf3000-7f7cbdd15000 r--s 00000000 08:01 1572887 /lib/x86_64-linux-gnu/libpthread-2.24.so 7f7cbdd15000-7f7cbdd38000 r--s 00000000 08:01 934726 /usr/local/rvm/rubies/ruby-2.3.3/bin/ruby 7f7cbdd38000-7f7cbded3000 r--p 00000000 08:01 5636390 /usr/lib/locale/locale-archive 7f7cbded3000-7f7cbded7000 rw-p 00000000 00:00 0 7f7cbdee8000-7f7cbdee9000 r-xp 00000000 00:00 0 7f7cbdee9000-7f7cbdeea000 ---p 00000000 00:00 0 7f7cbdeea000-7f7cbdef0000 rw-p 00000000 00:00 0 7f7cbdef0000-7f7cbdef1000 r--p 00023000 08:01 1572867 /lib/x86_64-linux-gnu/ld-2.24.so 7f7cbdef1000-7f7cbdef2000 rw-p 00024000 08:01 1572867 /lib/x86_64-linux-gnu/ld-2.24.so 7f7cbdef2000-7f7cbdef3000 rw-p 00000000 00:00 0 7ffd77e2d000-7ffd7862c000 rw-p 00000000 00:00 0 [stack] 7ffd786f2000-7ffd786f4000 r--p 00000000 00:00 0 [vvar] 7ffd786f4000-7ffd786f6000 r-xp 00000000 00:00 0 [vdso] ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]

[NOTE] You may have encountered a bug in the Ruby interpreter or extension libraries. Bug reports are welcome.

isopen commented 6 years ago

I am reading. Td.cpp:4038:closeflag = 4;

void Td::close_impl(bool destroy_flag) {
  destroy_flag_ |= destroy_flag;
  if (close_flag_) {
    return;
  }
  if (state_ == State::Decrypt) {
    if (destroy_flag) {
      TdDb::destroy(parameters_);
    }
    state_ = State::Close;
    close_flag_ = 4;
    return dec_actor_refcnt();
  }
  state_ = State::Close;
  close_flag_ = 1;
  G()->set_close_flag();
  send_closure(auth_manager_actor_, &AuthManager::on_closing);
  LOG(WARNING) << "Close " << tag("destroy", destroy_flag);

  // wait till all request_actors will stop.
  request_actors_.clear();
  G()->td_db()->flush_all();
  send_closure_later(actor_id(this), &Td::dec_request_actor_refcnt);  // remove guard
}
levlam commented 6 years ago

What databases are enabled in setTdlibParameters?

When td_json_client_destroy is called? Before or after logging? What is authorization state when it is called?

isopen commented 6 years ago

For a couple of seconds I sketched another script. https://github.com/isopen/tdlib/blob/master/fiddle_index.rb falls on the method

test0: {"@type"=>"textEntities", "entities"=>[{"@type"=>"textEntity", "offset"=>0, "length"=>9, "type"=>{"@type"=>"textEntityTypeMention"}}, {"@type"=>"textEntity", "offset"=>10, "length"=>13, "type"=>{"@type"=>"textEntityTypeBotCommand"}}, {"@type"=>"textEntity", "offset"=>24, "length"=>20, "type"=>{"@type"=>"textEntityTypeUrl"}}, {"@type"=>"textEntity", "offset"=>45, "length"=>11, "type"=>{"@type"=>"textEntityTypeUrl"}}], "@extra"=>["5", 7.0]} {"@type"=>"updateAuthorizationState", "authorization_state"=>{"@type"=>"authorizationStateWaitTdlibParameters"}} {"@type"=>"authorizationStateWaitTdlibParameters", "@extra"=>1.01234} waiting for authorization (this is normal)

td_json_client_destroy

test1(crash): td_json_client_create

I delete the loop.

td_json_client_destroy

levlam commented 6 years ago

Thanks. The crash will be fixed in next update.

levlam commented 6 years ago

Fixed in TDLib 1.2.0.