Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QODBC Informix Segmentation fault



  • This is probably a silly configuration problem, but have now spent days trying to find the problem.

    I have an Informix 11.70 server running on a Linux platform.

    I am trying to build a Qt App to display a selection of data from the server.

    I have installed clientsdk.3.70.FC4DE.MacOSX_64 as default into /Applications/IBM/Informix/...

    I have setup ODBC on the system with the Informix driver configured as:

    @[ODBC Drivers]
    IBM INFORMIX ODBC DRIVER = Installed

    [IBM INFORMIX ODBC DRIVER]
    Driver = /Applications/IBM/informix/lib/cli/iclit09b.bundle
    Setup = /Applications/IBM/informix/lib/cli/iclit09b.bundle
    APILevel=1
    ConnectFunctions=YYY
    DriverODBCVer=03.51
    FileUsage=0
    SQLLevel=1
    smProcessPerConnect=Y
    @

    And have a System DSN setup as:
    @[ODBC]
    Trace = 0

    [ODBC Data Sources]
    SRV3 = IBM INFORMIX ODBC DRIVER

    [SRV3]
    Driver = /Applications/IBM/informix/lib/cli/iclit09b.bundle
    Description = Server 3
    UID = informix
    PWD = *******
    Database = testdata
    ServerName = srv3
    @

    The Qt Application I show here is derived from the querymodel example, but I only show the connector.h.

    @#ifndef CONNECTION_H
    #define CONNECTION_H

    #include <QMessageBox>
    #include <QSqlDatabase>
    #include <QSqlError>
    #include <QSqlQuery>

    static bool createConnection()
    {
    QSqlDatabase db = QSqlDatabase::addDatabase("QODBC");
    qDebug() << db.lastError();
    db.setDatabaseName("SRV3");
    bool openOK = db.open();
    qDebug() << db.lastError();
    if (openOK) {
    qDebug() << db.lastError();
    QMessageBox::critical(0, qApp->tr("Cannot open database"),
    qApp->tr("Unable to establish a database connection.\n"
    "This example needs SQLite support. Please read "
    "the Qt SQL driver documentation for information how "
    "to build it.\n\n"
    "Click Cancel to exit."), QMessageBox::Cancel);
    return false;
    }

    return true;
    

    }
    #endif
    @

    The project clean builds, but when run it always throws:

    @Process: querymodel [423]
    Path: /Volumes/VOLUME/*/querymodel.app/Contents/MacOS/querymodel
    Identifier: eu.technocats.querymodel
    Version: ???
    Code Type: X86-64 (Native)
    Parent Process: Qt Creator [332]
    User ID: 1025

    Date/Time: 2012-12-21 12:31:04.863 +0100
    OS Version: Mac OS X 10.8.2 (12C3012)
    Report Version: 10

    Interval Since Last Report: 489839 sec
    Crashes Since Last Report: 35
    Per-App Crashes Since Last Report: 19
    Anonymous UUID: 09EEA18C-683B-E8C9-5F24-C38ED403766E

    Crashed Thread: 0 Dispatch queue: com.apple.main-thread

    Exception Type: EXC_BAD_ACCESS (SIGSEGV)
    Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000034

    VM Regions Near 0x34:
    -->
    __TEXT 0000000100000000-0000000100007000 [ 28K] r-x/rwx SM=COW /Volumes/VOLUME/*/querymodel.app/Contents/MacOS/querymodel

    Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
    0 libiodbc.2.dylib 0x00000001004fbd09 SQLGetTypeInfo_Internal + 21
    1 libiodbc.2.dylib 0x00000001004fbf7f SQLGetTypeInfo + 225
    2 iclit09b.bundle 0x0000000107dc913c SQLGetTypeInfoW + 12
    3 libiodbc.2.dylib 0x00000001004fbd92 SQLGetTypeInfo_Internal + 158
    4 libiodbc.2.dylib 0x00000001004fc1db SQLGetTypeInfoW + 225
    5 QtSql 0x000000010003203d QODBCDriverPrivate::checkDateTimePrecision() + 49
    6 QtSql 0x000000010003d537 QODBCDriver::open(QString const&, QString const&, QString const&, QString const&, int, QString const&) + 1925
    7 QtSql 0x00000001000109fd QSqlDatabase::open() + 53
    8 eu.technocats.querymodel 0x0000000100004b8c main + 460
    9 eu.technocats.querymodel 0x0000000100003d14 start + 52

    @

    I have tested the ODBC Driver via IBMs iodbctest:

    @iodbctest
    iODBC Demonstration program
    This program shows an interactive SQL processor
    Driver Manager: 03.52.0607.1008

    Enter ODBC connect string (? shows list): DSN=SRV3
    Driver: 3.70.0000 3.70.U (iclis09b.dylib)

    SQL>select * from level

    dblevel

    225
    result set 1 returned 1 rows.
    @

    Anyone any ideas, or come across this before?

    Many thanks

    John



  • Try to set environment variable:
    DBDATE=DMY4.
    Note that symbol "." is important.

    Under Windows you can do it using IBM Informix Setnet32.


Log in to reply