- 
                Notifications
    
You must be signed in to change notification settings  - Fork 190
 
Closed
Labels
bugSomething isn't workingSomething isn't workingpriority-highPretty important bug or issuePretty important bug or issue
Description
It appears that the output stream is getting set to a nullptr. Was running v2.5.0 of the client. When I rolled-back to v2.4.0 of the client, the issue is no longer present. This issue shows up the first time I call Client::Insert() for each client instance. It's not clear what I am doing on the application side to cause this. Any thoughts as to how I can debug this?
My client is configured in the following manner:
m_client = std::make_shared<clickhouse::Client>(
    clickhouse::ClientOptions().SetHost(host)                                                                           // a hostname
                               .SetPingBeforeQuery(client_config.ping_before_query)                                     // true
                               .SetSendRetries(client_config.send_retries)                                              // 0
                               .SetCompressionMethod(compression_method)                                                // None
                               .SetRetryTimeout(std::chrono::seconds(client_config.retry_timeout_sec))                  // 0
                               .TcpKeepAlive(client_config.tcp_keep_alive)                                              // true
                               .SetConnectionConnectTimeout(std::chrono::seconds(client_config.connect_timeout_sec))    // 5
                               .SetConnectionRecvTimeout(std::chrono::milliseconds(client_config.recv_timeout_ms))      // 1000000
                               .SetConnectionSendTimeout(std::chrono::milliseconds(client_config.send_timeout_ms))      //  60000
                               );
Stack trace and gdb debugging
Thread 5 "rte-worker-8" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffc5c87000 (LWP 136)]
clickhouse::WireFormat::WriteAll (output=..., buf=<optimized out>, len=1) at /git/submodules/clickhouse-cpp/clickhouse/base/wire_format.cpp:36
36      /git/submodules/clickhouse-cpp/clickhouse/base/wire_format.cpp: No such file or directory.
(gdb) bt
#0  clickhouse::WireFormat::WriteAll (output=..., buf=<optimized out>, len=1) at /git/submodules/clickhouse-cpp/clickhouse/base/wire_format.cpp:36
#1  0x0000555559dce5c1 in clickhouse::WireFormat::WriteVarint64 (output=..., value=<optimized out>, value@entry=1) at /git/submodules/clickhouse-cpp/clickhouse/base/wire_format.cpp:86
#2  0x0000555559dc7fcf in clickhouse::WireFormat::WriteUInt64 (value=1, output=...) at /git/submodules/clickhouse-cpp/clickhouse/base/wire_format.h:74
#3  clickhouse::Client::Impl::SendQuery (this=0x7fffb8001460, query=...) at /git/submodules/clickhouse-cpp/clickhouse/client.cpp:720
#4  0x0000555559dc9477 in clickhouse::Client::Impl::Insert (this=0x7fffb8001460, table_name=..., query_id="", block=...) at /git/submodules/clickhouse-cpp/clickhouse/client.cpp:311
(gdb) frame 0
#0  clickhouse::WireFormat::WriteAll (output=..., buf=<optimized out>, len=1) at /git/submodules/clickhouse-cpp/clickhouse/base/wire_format.cpp:36
36      /git/submodules/clickhouse-cpp/clickhouse/base/wire_format.cpp: No such file or directory.
(gdb) info locals
original_len = 1
p = 0x7fffc5c2cb9e "\001"
written_previously = 1
(gdb) p output
$4 = (clickhouse::OutputStream &) <error reading variable>
(gdb) p &output
$5 = (clickhouse::OutputStream *) 0x0
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingpriority-highPretty important bug or issuePretty important bug or issue