Overview
Features
Download
Documentation
Community
Add-Ons & Services

odbc(postgresql) simple insert leaks 1k memory

Please post support and help requests here.

odbc(postgresql) simple insert leaks 1k memory

Postby Giovani » 12 Apr 2013, 17:55

Hi all,
Im executing a simple insert and 1,072 bytes of memory is leaking.

Poco version: 1.5.1
Postgresql odbc driver version: 09.00.0310-1
O.S: Ubuntu 32 bits 3.0.0-27-generic kernel

Code: Select all
ODBC::Connector::registerConnector();
Session ses(SessionFactory::instance().create("ODBC", "YOUR CONNECTION STRING"));
int value = 0;
std::string aa("aa");
ses << "insert into test(cod, cod_value) values(?, ?)", use(value), use(aa), now;
ODBC::Connector::unregisterConnector();


The table:
Code: Select all
CREATE TABLE test
(
  cod integer,
  cod_value character varying
)


Valgrind output:
==4243== HEAP SUMMARY:
==4243== in use at exit: 34,518 bytes in 1,104 blocks
==4243== total heap usage: 4,598 allocs, 3,494 frees, 3,031,710 bytes allocated
==4243==
==4243== 160 (40 direct, 120 indirect) bytes in 1 blocks are definitely lost in loss record 403 of 423
==4243== at 0x4028876: malloc (vg_replace_malloc.c:236)
==4243== by 0x4C5FA5C: nss_parse_service_list (nsswitch.c:626)
==4243== by 0x4C60069: __nss_database_lookup (nsswitch.c:167)
==4243== by 0x586B2F8: ???
==4243== by 0x586CCCC: ???
==4243== by 0x4C16FB6: getpwuid_r@@GLIBC_2.1.2 (getXXbyYY_r.c:256)
==4243== by 0x4C168FD: getpwuid (getXXbyYY.c:117)
==4243== by 0x5519E04: _odbcinst_UserINI (_odbcinst_UserINI.c:61)
==4243== by 0x55162A5: SQLGetPrivateProfileString (SQLGetPrivateProfileString.c:421)
==4243== by 0x5466AC8: getDriverNameFromDSN (in /usr/lib/odbc/psqlodbca.so)
==4243== by 0x54685D9: getDSNinfo (in /usr/lib/odbc/psqlodbca.so)
==4243== by 0x543F063: PGAPI_DriverConnect (in /usr/lib/odbc/psqlodbca.so)
==4243==
==4243== 180 (172 direct, 8 indirect) bytes in 1 blocks are definitely lost in loss record 404 of 423
==4243== at 0x4028876: malloc (vg_replace_malloc.c:236)
==4243== by 0x5449839: QR_Constructor (in /usr/lib/odbc/psqlodbca.so)
==4243== by 0x545F2D8: SC_pre_execute (in /usr/lib/odbc/psqlodbca.so)
==4243== by 0x544CCCF: ??? (in /usr/lib/odbc/psqlodbca.so)
==4243== by 0x544DDD3: PGAPI_NumResultCols (in /usr/lib/odbc/psqlodbca.so)
==4243== by 0x546B599: SQLNumResultCols (in /usr/lib/odbc/psqlodbca.so)
==4243== by 0x4FC98C1: _iodbcdm_NumResultCols (result.c:511)
==4243== by 0x4FC9A73: SQLNumResultCols (result.c:562)
==4243== by 0x463E11B: Poco::Data::ODBC::Preparator::resize() const (Preparator.cpp:137)
==4243== by 0x463E0CE: Poco::Data::ODBC::Preparator::columns() const (Preparator.cpp:129)
==4243== by 0x463651C: Poco::Data::ODBC::ODBCStatementImpl::columnsReturned() const (ODBCStatementImpl.h:203)
==4243== by 0x463653B: Poco::Data::ODBC::ODBCStatementImpl::hasData() const (ODBCStatementImpl.h:209)
==4243==
==4243== 180 (172 direct, 8 indirect) bytes in 1 blocks are definitely lost in loss record 405 of 423
==4243== at 0x4028876: malloc (vg_replace_malloc.c:236)
==4243== by 0x5449839: QR_Constructor (in /usr/lib/odbc/psqlodbca.so)
==4243== by 0x545F2E4: SC_pre_execute (in /usr/lib/odbc/psqlodbca.so)
==4243== by 0x544CCCF: ??? (in /usr/lib/odbc/psqlodbca.so)
==4243== by 0x544DDD3: PGAPI_NumResultCols (in /usr/lib/odbc/psqlodbca.so)
==4243== by 0x546B599: SQLNumResultCols (in /usr/lib/odbc/psqlodbca.so)
==4243== by 0x4FC98C1: _iodbcdm_NumResultCols (result.c:511)
==4243== by 0x4FC9A73: SQLNumResultCols (result.c:562)
==4243== by 0x463E11B: Poco::Data::ODBC::Preparator::resize() const (Preparator.cpp:137)
==4243== by 0x463E0CE: Poco::Data::ODBC::Preparator::columns() const (Preparator.cpp:129)
==4243== by 0x463651C: Poco::Data::ODBC::ODBCStatementImpl::columnsReturned() const (ODBCStatementImpl.h:203)
==4243== by 0x463653B: Poco::Data::ODBC::ODBCStatementImpl::hasData() const (ODBCStatementImpl.h:209)
==4243==
==4243== 180 (172 direct, 8 indirect) bytes in 1 blocks are definitely lost in loss record 406 of 423
==4243== at 0x4028876: malloc (vg_replace_malloc.c:236)
==4243== by 0x5449839: QR_Constructor (in /usr/lib/odbc/psqlodbca.so)
==4243== by 0x545F315: SC_pre_execute (in /usr/lib/odbc/psqlodbca.so)
==4243== by 0x544CCCF: ??? (in /usr/lib/odbc/psqlodbca.so)
==4243== by 0x544DDD3: PGAPI_NumResultCols (in /usr/lib/odbc/psqlodbca.so)
==4243== by 0x546B599: SQLNumResultCols (in /usr/lib/odbc/psqlodbca.so)
==4243== by 0x4FC98C1: _iodbcdm_NumResultCols (result.c:511)
==4243== by 0x4FC9A73: SQLNumResultCols (result.c:562)
==4243== by 0x463E11B: Poco::Data::ODBC::Preparator::resize() const (Preparator.cpp:137)
==4243== by 0x463E0CE: Poco::Data::ODBC::Preparator::columns() const (Preparator.cpp:129)
==4243== by 0x463651C: Poco::Data::ODBC::ODBCStatementImpl::columnsReturned() const (ODBCStatementImpl.h:203)
==4243== by 0x463653B: Poco::Data::ODBC::ODBCStatementImpl::hasData() const (ODBCStatementImpl.h:209)
==4243==
==4243== 180 (172 direct, 8 indirect) bytes in 1 blocks are definitely lost in loss record 407 of 423
==4243== at 0x4028876: malloc (vg_replace_malloc.c:236)
==4243== by 0x5449839: QR_Constructor (in /usr/lib/odbc/psqlodbca.so)
==4243== by 0x545F2D8: SC_pre_execute (in /usr/lib/odbc/psqlodbca.so)
==4243== by 0x544CCCF: ??? (in /usr/lib/odbc/psqlodbca.so)
==4243== by 0x544E2C0: PGAPI_DescribeCol (in /usr/lib/odbc/psqlodbca.so)
==4243== by 0x546ACE2: SQLDescribeCol (in /usr/lib/odbc/psqlodbca.so)
==4243== by 0x4FCA1EE: SQLDescribeCol_Internal (result.c:704)
==4243== by 0x4FCA7E0: SQLDescribeColA (result.c:850)
==4243== by 0x4633856: Poco::Data::ODBC::SQLDescribeCol(void*, unsigned short, unsigned char*, short, short*, short*, unsigned long*, short*, short*) (Unicode.h:463)
==4243== by 0x463329C: Poco::Data::ODBC::ODBCMetaColumn::getDescription() (ODBCMetaColumn.cpp:76)
==4243== by 0x463332A: Poco::Data::ODBC::ODBCMetaColumn::init() (ODBCMetaColumn.cpp:85)
==4243== by 0x46330D6: Poco::Data::ODBC::ODBCMetaColumn::ODBCMetaColumn(Poco::Data::ODBC::Handle<void*, (short)3> const&, unsigned int) (ODBCMetaColumn.cpp:50)
==4243==
==4243== 180 (172 direct, 8 indirect) bytes in 1 blocks are definitely lost in loss record 408 of 423
==4243== at 0x4028876: malloc (vg_replace_malloc.c:236)
==4243== by 0x5449839: QR_Constructor (in /usr/lib/odbc/psqlodbca.so)
==4243== by 0x545F2E4: SC_pre_execute (in /usr/lib/odbc/psqlodbca.so)
==4243== by 0x544CCCF: ??? (in /usr/lib/odbc/psqlodbca.so)
==4243== by 0x544E2C0: PGAPI_DescribeCol (in /usr/lib/odbc/psqlodbca.so)
==4243== by 0x546ACE2: SQLDescribeCol (in /usr/lib/odbc/psqlodbca.so)
==4243== by 0x4FCA1EE: SQLDescribeCol_Internal (result.c:704)
==4243== by 0x4FCA7E0: SQLDescribeColA (result.c:850)
==4243== by 0x4633856: Poco::Data::ODBC::SQLDescribeCol(void*, unsigned short, unsigned char*, short, short*, short*, unsigned long*, short*, short*) (Unicode.h:463)
==4243== by 0x463329C: Poco::Data::ODBC::ODBCMetaColumn::getDescription() (ODBCMetaColumn.cpp:76)
==4243== by 0x463332A: Poco::Data::ODBC::ODBCMetaColumn::init() (ODBCMetaColumn.cpp:85)
==4243== by 0x46330D6: Poco::Data::ODBC::ODBCMetaColumn::ODBCMetaColumn(Poco::Data::ODBC::Handle<void*, (short)3> const&, unsigned int) (ODBCMetaColumn.cpp:50)
==4243==
==4243== 180 (172 direct, 8 indirect) bytes in 1 blocks are definitely lost in loss record 409 of 423
==4243== at 0x4028876: malloc (vg_replace_malloc.c:236)
==4243== by 0x5449839: QR_Constructor (in /usr/lib/odbc/psqlodbca.so)
==4243== by 0x545F315: SC_pre_execute (in /usr/lib/odbc/psqlodbca.so)
==4243== by 0x544CCCF: ??? (in /usr/lib/odbc/psqlodbca.so)
==4243== by 0x544E2C0: PGAPI_DescribeCol (in /usr/lib/odbc/psqlodbca.so)
==4243== by 0x546ACE2: SQLDescribeCol (in /usr/lib/odbc/psqlodbca.so)
==4243== by 0x4FCA1EE: SQLDescribeCol_Internal (result.c:704)
==4243== by 0x4FCA7E0: SQLDescribeColA (result.c:850)
==4243== by 0x4633856: Poco::Data::ODBC::SQLDescribeCol(void*, unsigned short, unsigned char*, short, short*, short*, unsigned long*, short*, short*) (Unicode.h:463)
==4243== by 0x463329C: Poco::Data::ODBC::ODBCMetaColumn::getDescription() (ODBCMetaColumn.cpp:76)
==4243== by 0x463332A: Poco::Data::ODBC::ODBCMetaColumn::init() (ODBCMetaColumn.cpp:85)
==4243== by 0x46330D6: Poco::Data::ODBC::ODBCMetaColumn::ODBCMetaColumn(Poco::Data::ODBC::Handle<void*, (short)3> const&, unsigned int) (ODBCMetaColumn.cpp:50)
==4243==
==4243== LEAK SUMMARY:
==4243== definitely lost: 1,072 bytes in 7 blocks
==4243== indirectly lost: 168 bytes in 16 blocks
==4243== possibly lost: 0 bytes in 0 blocks
==4243== still reachable: 33,278 bytes in 1,081 blocks
==4243== suppressed: 0 bytes in 0 blocks
==4243== Reachable blocks (those to which a pointer was found) are not shown.
==4243== To see them, rerun with: --leak-check=full --show-reachable=yes
==4243==
==4243== For counts of detected and suppressed errors, rerun with: -v
==4243== ERROR SUMMARY: 7 errors from 7 contexts (suppressed: 149 from 15)
Giovani
 
Posts: 5
Joined: 26 Nov 2012, 19:45

Re: odbc(postgresql) simple insert leaks 1k memory

Postby sgsoft » 30 Jul 2013, 08:19

I have encountered too.
sgsoft
 
Posts: 34
Joined: 03 Jul 2010, 12:26


Return to Support

Who is online

Users browsing this forum: Baidu [Spider] and 2 guests