Package: bluez Version: 5.43-2+deb9u1 Several crashes while working with gatttool in stretch kernel 4.9.0-6-amd64 #1 SMP Debian 4.9.88-1+deb9u1 (2018-05-07) x86_64 GNU/Linux libglib2 version 2.50.3-2
Here's some output from gdb session (using bliez-dbg) Starting program: /usr/bin/gatttool -b 4C:65:A8:D5:40:CA -I [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". [4C:65:A8:D5:40:CA][LE]> connect Attempting to connect to 4C:65:A8:D5:40:CA Error: connect error: Transport endpoint is not connected (107) [4C:65:A8:D5:40:CA][LE]> char-read-hnd 0x18 Command Failed: Disconnected [4C:65:A8:D5:40:CA][LE]> connect Attempting to connect to 4C:65:A8:D5:40:CA Connection successful [4C:65:A8:D5:40:CA][LE]> char-read-hnd 0x18 Error: Characteristic value/descriptor read failed: Request attribute has encountered an unlikely error [4C:65:A8:D5:40:CA][LE]> (gatttool:6617): GLib-WARNING **: Invalid file descriptor. Program received signal SIGSEGV, Segmentation fault. malloc_consolidate (av=av@entry=0x7ffff7453b00 <main_arena>) at malloc.c:4205 4205 malloc.c: No such file or directory. (gdb) bt #0 malloc_consolidate (av=av@entry=0x7ffff7453b00 <main_arena>) at malloc.c:4205 #1 0x00007ffff7131ed8 in _int_free (av=0x7ffff7453b00 <main_arena>, p=0x5555557bddb0, have_lock=0) at malloc.c:4113 #2 0x00007ffff79157d2 in g_log_writer_standard_streams () from /lib/x86_64-linux-gnu/libglib-2.0.so.0 #3 0x00007ffff79158b7 in g_log_writer_default () from /lib/x86_64-linux-gnu/libglib-2.0.so.0 #4 0x00007ffff7913dfc in g_log_structured_array () from /lib/x86_64-linux-gnu/libglib-2.0.so.0 #5 0x00007ffff79142b7 in g_log_default_handler () from /lib/x86_64-linux-gnu/libglib-2.0.so.0 #6 0x00007ffff79145c4 in g_logv () from /lib/x86_64-linux-gnu/libglib-2.0.so.0 #7 0x00007ffff79147cf in g_log () from /lib/x86_64-linux-gnu/libglib-2.0.so.0 #8 0x00007ffff78ff7e2 in g_io_channel_error_from_errno () from /lib/x86_64-linux-gnu/libglib-2.0.so.0 #9 0x00007ffff795375f in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0 #10 0x00007ffff78fffc2 in g_io_channel_shutdown () from /lib/x86_64-linux-gnu/libglib-2.0.so.0 #11 0x00007ffff7900167 in g_io_channel_unref () from /lib/x86_64-linux-gnu/libglib-2.0.so.0 #12 0x00007ffff790a7c6 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0 #13 0x00007ffff790d820 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0 #14 0x00007ffff790da60 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0 #15 0x00007ffff790dd82 in g_main_loop_run () from /lib/x86_64-linux-gnu/libglib-2.0.so.0 #16 0x0000555555564898 in interactive (src=0x0, dst=<optimized out>, dst_type=<optimized out>, psm=<optimized out>) at attrib/interactive.c:1017 #17 0x000055555555a942 in main (argc=<optimized out>, argv=<optimized out>) at attrib/gatttool.c:568 and Starting program: /usr/bin/gatttool -b 4C:65:A8:D5:40:CA -I [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". [4C:65:A8:D5:40:CA][LE]> connect Attempting to connect to 4C:65:A8:D5:40:CA Connection successful [4C:65:A8:D5:40:CA][LE]> connect (gatttool:6800): GLib-WARNING **: Invalid file descriptor. [4C:65:A8:D5:40:CA][LE]> connect Attempting to connect to 4C:65:A8:D5:40:CA Error: connect error: Transport endpoint is not connected (107) [4C:65:A8:D5:40:CA][LE]> char-read-hnd 0x18 Command Failed: Disconnected [4C:65:A8:D5:40:CA][LE]> connect Attempting to connect to 4C:65:A8:D5:40:CA Error: connect error: Transport endpoint is not connected (107) [4C:65:A8:D5:40:CA][LE]> char-read-hnd 0x18 Command Failed: Disconnected [4C:65:A8:D5:40:CA][LE]> connect Attempting to connect to 4C:65:A8:D5:40:CA Connection successful [4C:65:A8:D5:40:CA][LE]> char-read-hnd 0x18 Error: Characteristic value/descriptor read failed: Request attribute has encountered an unlikely error [4C:65:A8:D5:40:CA][LE]> (gatttool:6800): GLib-WARNING **: Invalid file descriptor. char-read-hnd 0x18 Program received signal SIGSEGV, Segmentation fault. _int_malloc (av=av@entry=0x7ffff7453b00 <main_arena>, bytes=bytes@entry=14) at malloc.c:3416 3416 malloc.c: No such file or directory. (gdb) bt #0 _int_malloc (av=av@entry=0x7ffff7453b00 <main_arena>, bytes=bytes@entry=14) at malloc.c:3416 #1 0x00007ffff7134f64 in __GI___libc_malloc (bytes=14) at malloc.c:2928 #2 0x00007ffff7912e09 in g_malloc () from /lib/x86_64-linux-gnu/libglib-2.0.so.0 #3 0x00007ffff792ceaf in g_strdup () from /lib/x86_64-linux-gnu/libglib-2.0.so.0 #4 0x00007ffff7929906 in g_shell_unquote () from /lib/x86_64-linux-gnu/libglib-2.0.so.0 #5 0x00007ffff792a0a4 in g_shell_parse_argv () from /lib/x86_64-linux-gnu/libglib-2.0.so.0 #6 0x00005555555636cc in parse_line (line_read=0x5555557bdf60 "") at attrib/interactive.c:842 #7 0x00007ffff76a5ac3 in rl_callback_read_char () from /lib/x86_64-linux-gnu/libreadline.so.7 #8 0x000055555556386e in prompt_read (chan=<optimized out>, cond=<optimized out>, user_data=<optimized out>) at attrib/interactive.c:868 #9 0x00007ffff790d6aa in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0 #10 0x00007ffff790da60 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0 #11 0x00007ffff790dd82 in g_main_loop_run () from /lib/x86_64-linux-gnu/libglib-2.0.so.0 #12 0x0000555555564898 in interactive (src=0x0, dst=<optimized out>, dst_type=<optimized out>, psm=<optimized out>) at attrib/interactive.c:1017 #13 0x000055555555a942 in main (argc=<optimized out>, argv=<optimized out>) at attrib/gatttool.c:568 also looks like there's file handles leak in gatttool.