You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "geyungjen (via GitHub)" <gi...@apache.org> on 2023/08/07 00:01:06 UTC

[GitHub] [arrow] geyungjen opened a new issue, #37033: arrow::flight::FlightClient::AuthenticateBasicToken C++ Segmentation fault (core dumped)

geyungjen opened a new issue, #37033:
URL: https://github.com/apache/arrow/issues/37033

   ### Describe the bug, including details regarding any error messages, version, and platform.
   
   My Arrow version is just installed on 8/6/2023:
   
   https://github.com/apache/arrow
   
   
   Here are some lines of my code for the client in C++:
   
   _ARROW_ASSIGN_OR_RAISE(auto location, Location::ForGrpcTcp("10.0.0.103", 8904));
   std::cout << "location " << location.ToString() <<  std::endl;
   
   // Setup the Flight SQL Client
      std::unique_ptr<flight::FlightClient> client;
      ARROW_ASSIGN_OR_RAISE(client, flight::FlightClient::Connect(location));
      std::unique_ptr<arrow::flight::sql::FlightSqlClient> sql_client(
      new arrow::flight::sql::FlightSqlClient(std::move(client)));
   
      FlightCallOptions call_options;
      call_options.headers.emplace_back("authorization", "Basic");
      call_options.headers.emplace_back("database", "public");
   
      auto user = "sysdba";
      auto password = "passw0rd";
   
     **auto auth = client->AuthenticateBasicToken(call_options,user,password );
    //Segmentation Fault at the Above AuthenticateBasicToken call.**_
   
   Valgrind shows below:
   
   ==5046== Invalid read of size 1
   ==5046==    at 0x4ABF7E1: arrow::flight::FlightClient::CheckOpen() const (client.cc:716)
   ==5046==    by 0x4ABDC12: arrow::flight::FlightClient::AuthenticateBasicToken(arrow::flight::FlightCallOptions const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (client.cc:555)
   ==5046==    by 0x1159B9: main::{lambda()#1}::operator()() const (in /home/alice/arrow_notes/flightsql/build/arrow_flight_cpp)
   ==5046==    by 0x1163C8: main (in /home/alice/arrow_notes/flightsql/build/arrow_flight_cpp)
   ==5046==  Address 0x8 is not stack'd, malloc'd or (recently) free'd
   
   It points to [OpenCheck() in client.cc](arrow::flight::FlightClient::CheckOpen() const (client.cc:716))
   from arrow::flight::FlightClient::AuthenticateBasicToken(arrow::flight::FlightCallOptions const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (client.cc:555)
   
   At the line 716 in client.cc:
   
   Status FlightClient::CheckOpen() const {
     if (closed_) {
       return Status::Invalid("FlightClient is closed");
     }
     return Status::OK();
   }
   
   Segmentation Fault occurred at: line 555 in same client.cc:
   
   arrow::Result<std::pair<std::string, std::string>> FlightClient::AuthenticateBasicToken(
       const FlightCallOptions& options, const std::string& username,
       const std::string& password) {
     RETURN_NOT_OK(CheckOpen());  //Here is line 555, core dump starts here.
     return transport_->AuthenticateBasicToken(options, username, password);
   }
    
   
   Wondering why it is an invalid read?
   
   ==5046== Invalid read of size 1
   ==5046==    at 0x4ABF7E1: arrow::flight::FlightClient::CheckOpen() const (client.cc:716)
   ==5046==    by 0x4ABDC12: arrow::flight::FlightClient::AuthenticateBasicToken(arrow::flight::FlightCallOptions const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (client.cc:555)
   ==5046==    by 0x1159B9: main::{lambda()#1}::operator()() const (in /home/alice/arrow_notes/flightsql/build/arrow_flight_cpp)
   ==5046==    by 0x1163C8: main (in /home/alice/arrow_notes/flightsql/build/arrow_flight_cpp)
   ==5046==  Address 0x8 is not stack'd, malloc'd or (recently) free'd
   
   Thanks
   
   George Jen
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   ### Component(s)
   
   C, C++, FlightRPC


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] geyungjen commented on issue #37033: arrow::flight::FlightClient::AuthenticateBasicToken C++ Segmentation fault (core dumped)

Posted by "geyungjen (via GitHub)" <gi...@apache.org>.
geyungjen commented on issue #37033:
URL: https://github.com/apache/arrow/issues/37033#issuecomment-1667012300

   By the way, I have tested the Ubuntu and MacOS, same segmentation fault.
   
   George


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] kou commented on issue #37033: arrow::flight::FlightClient::AuthenticateBasicToken C++ Segmentation fault (core dumped)

Posted by "kou (via GitHub)" <gi...@apache.org>.
kou commented on issue #37033:
URL: https://github.com/apache/arrow/issues/37033#issuecomment-1667021243

   You can't use `client` after you call `std::move(client)`.
   `client` is invalid after `std::move(client)`.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] geyungjen commented on issue #37033: arrow::flight::FlightClient::AuthenticateBasicToken C++ Segmentation fault (core dumped)

Posted by "geyungjen (via GitHub)" <gi...@apache.org>.
geyungjen commented on issue #37033:
URL: https://github.com/apache/arrow/issues/37033#issuecomment-1667062477

   Thanks!
   
   I just moved 
   
   auto auth = client->AuthenticateBasicToken(call_options,user,password );
   
   to before moving client, problem solved!
   
   I will close this ticket.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] kou closed issue #37033: arrow::flight::FlightClient::AuthenticateBasicToken C++ Segmentation fault (core dumped)

Posted by "kou (via GitHub)" <gi...@apache.org>.
kou closed issue #37033: arrow::flight::FlightClient::AuthenticateBasicToken C++ Segmentation fault (core dumped)
URL: https://github.com/apache/arrow/issues/37033


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org