我在我的项目中使用libpqxx-4.0
C++ 库来处理远程 Postgresql 数据库。一切正常,但我尝试使用 valgrind 运行我的项目并收到近百万条错误消息
Conditional jump or move depends on uninitialised value(s)
说
Use of uninitialised value of size 8
它似乎直接发生在库内的某个地方,因为 valgrind 跟踪说(例如):
==24073== Conditional jump or move depends on uninitialised value(s)
==24073== at 0x5C2CCEF: PQconnectPoll (in /usr/lib/libpq.so.5.6)
==24073== by 0x5C2DB8D: ??? (in /usr/lib/libpq.so.5.6)
==24073== by 0x5C2E496: PQconnectdb (in /usr/lib/libpq.so.5.6)
==24073== by 0x59EE190: pqxx::connectionpolicy::normalconnect(pg_conn*) (in /usr/lib/x86_64-linux-gnu/libpqxx-4.0.so)
==24073== by 0x59EE2A3: pqxx::connect_direct::do_startconnect(pg_conn*) (in /usr/lib/x86_64-linux-gnu/libpqxx-4.0.so)
==24073== by 0x59E8BA0: pqxx::connection_base::init() (in /usr/lib/x86_64-linux-gnu/libpqxx-4.0.so)
==24073== by 0x448453: pqxx::basic_connection<pqxx::connect_direct>::basic_connection(std::string const&) (basic_connection.hxx:65)
==24073== by 0x4263BC: ServerData::load_from_db() (serverdata.cpp:43)
==24073== by 0x40CBD2: main (server.cpp:231)
在我这边,导致此错误的代码是
pqxx::connection c(get_conn_string()); // connects to the database
get_conn_string 方法原型在哪里
std::string ServerData::get_conn_string() const
请问您知道我可能做错了什么还是图书馆本身有问题?