Nip DATA Logo  


General Questions

ByteDesigner crash querying postresql tables

   If ByteDesigner crashes with the following stack, it means the PostgreSQL ODBC driver is trying to access a null pointer:

  Program received signal SIGSEGV, Segmentation fault.
0x00007f552f207cf2 in ?? () from /usr/local/thekompany/lib/
(gdb) where
#0  0x00007f552f207cf2 in ?? () from /usr/local/thekompany/lib/
#1  0x00007f552f207a16 in strdup () from /usr/local/thekompany/lib/
#2  0x00007f551da98c1e in copy_and_convert_field (stmt=0x27e89f0, field_type=16, atttypmod=<value optimized out>, valuei=<value optimized out>, fCType=-8,
    precision=<value optimized out>, rgbValue=0x0, cbValueMax=0, pcbValue=0x7f551e8f7568, pIndicator=0x7f551e8f7568) at convert.c:1444
#3  0x00007f551daacdd0 in PGAPI_GetData (hstmt=0x27e89f0, icol=<value optimized out>, fCType=<value optimized out>, rgbValue=<value optimized out>,
    cbValueMax=<value optimized out>, pcbValue=<value optimized out>) at results.c:1084
#4  0x00007f551dac7e0b in SQLGetData (StatementHandle=0x27e89f0, ColumnNumber=65535, TargetType=-16190, TargetValue=0x0, BufferLength=<value optimized out>,
    StrLen_or_Ind=<value optimized out>) at odbcapi.c:499
#5  0x00007f55322d0abe in SQLGetData (statement_handle=0x280a250, column_number=65535, target_type=-8, target_value=0x0, buffer_length=0, strlen_or_ind=0x7f551e8f7568)
    at SQLGetData.c:443
#6  0x0000000000498d71 in ?? ()
#7  0x00000000004a5876 in QODBCResult::data(int) ()
#8  0x00007f55316fab9d in QSqlQuery::value(int) const () from /usr/local/thekompany/lib/
#9  0x00007f553380809b in SQLThread::loadLine() () from unixodbc_u/
#10 0x00007f5533808662 in SQLThread::loadNextPage() () from unixodbc_u/
#11 0x00007f5533809df3 in SQLThread::run() () from unixodbc_u/
#12 0x00007f552ff4c24b in ?? () from /usr/local/thekompany/lib/
#13 0x00007f552fca08ca in start_thread () from /usr/local/thekompany/lib/
#14 0x00007f552f25b86d in clone () from /usr/local/thekompany/lib/
#15 0x0000000000000000 in ?? ()

   This crash happened in Postgresql ODBC psqlodbc-09.01.0100 at
 vi convert.c:1444

  The following change fixes this problem:

                   if (rgbValueBindRow)

                        char *str = strdup(rgbValueBindRow);
                        SQLLEN  ucount = utf8_to_ucs2(str, len, (SQLWCHAR *) rgbValueBindRow, cbValueMax / WCLEN);
                        if (cbValueMax < WCLEN * ucount)
                                result = COPY_RESULT_TRUNCATED;
                        len = ucount * WCLEN;