[Bug 665188] Re: QVariant and ODBC for iSeries segmentation fault in text field.

2012-02-04 Thread Mondin Marco
I made a mistake, the working code is as follows:

if(unicode) {
QVarLengthArray buftmp(colSize);
memset(buftmp.data(), 0, colSize*sizeof(SQLTCHAR));
r = SQLGetData(hStmt,
column+1,
SQL_C_TCHAR,
(SQLPOINTER)buftmp.data(),
0,
&lengthIndicator);

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/665188

Title:
  QVariant and ODBC for iSeries segmentation fault in text field.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/qt4-x11/+bug/665188/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 665188] Re: QVariant and ODBC for iSeries segmentation fault in text field.

2012-02-03 Thread Mondin Marco
I found the source of the problem and a solution.
In qsql_odbc.cpp file (at line 373 of QT4 version 4.7.4) is the following:

if(unicode) {
r = SQLGetData(hStmt,
column+1,
SQL_C_TCHAR,
NULL,
0,
&lengthIndicator);

The problem is in the NULL pointer.
If the lines are corrected as follows, the problem is resolved:

if(unicode) {
QVarLengthArray buftmp(colSize);
memset(buftmp.data(), 0, 65536*sizeof(SQLTCHAR));
r = SQLGetData(hStmt,
column+1,
SQL_C_TCHAR,
(SQLPOINTER)buftmp.data(),
0,
&lengthIndicator);

Probably not a very clean solution as I have not had time to analyze in
detail the sources, but at least it solves the problem.

Now all QT4 applications that need access to the database on the iSeries
with the IBM ODBC driver work properly.

-- 
You received this bug notification because you are a member of Kubuntu
Bugs, which is subscribed to qt4-x11 in Ubuntu.
https://bugs.launchpad.net/bugs/665188

Title:
  QVariant and ODBC for iSeries segmentation fault in text field.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/qt4-x11/+bug/665188/+subscriptions

-- 
kubuntu-bugs mailing list
kubuntu-b...@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kubuntu-bugs


[Bug 665188] Re: QVariant and ODBC for iSeries segmentation fault in text field.

2012-01-17 Thread Mondin Marco
questo bug affligge ubuntu e fedora sia a 32bit che a 64 bit a partire dalle
This bug affects ubuntu and fedora both 32bit and 64bit versions from where 
unixODBC has taken the place of iODBC. Although the newer versions have 
libiodbc2, you can not use it because soar QT4 has been compiled with unixODBC.
Since this bug affects different product versions of various distributions, I 
opened a bug report is also available on Nokia QT.
https://bugreports.qt.nokia.com//browse/QTBUG-23675

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/665188

Title:
  QVariant and ODBC for iSeries segmentation fault in text field.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/qt4-x11/+bug/665188/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 665188] Re: QVariant and ODBC for iSeries segmentation fault in text field.

2011-01-11 Thread Mondin Marco
Here is gdb bt output:
(gdb) bt
#0  0x75d0cba5 in raise (sig=) at 
../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1  0x75d106b0 in abort () at abort.c:92
#2  0x75d05a71 in __assert_fail (
assertion=0x75e22c40 "outbuf != ((void *)0) && *outbuf != ((void *)0)", 
file=, 
line=75, function=0x75e1f7d9 "__gconv") at assert.c:81
#3  0x75cf93a3 in __gconv (cd=0x922e80, inbuf=0x7fff9bc0, 
inbufend=0xb7ec62 
"\362\360\361\360\361\362\363\361\361\360\360\361\367\360\371\302\344\306\306\...@\327\311\305\331\326",
 '@' "\362, 
\360\361\360\361\362\363\361\361\360\360\361\367\361\360\326\342\301\...@\342\331\323",
 '@' "\362, 
\360\361\360\361\362\363\361\361\360\360\361\367\361\361\302\305\331\343\311\325\...@\301\344\307\344\342\343\326@\242\201\242",
 '@' "\362, \360\361\360\361\362\363\---Type  to 
continue, or q  to quit---
361\361\360\360\361\367\361\362\324\301\343\343\311\326\304\...@\327\311\305\331\311\325\326@p...@\306\311\307\323\311@\342\327\301@@@"...,
 outbuf=0x7fff9bb0, outbufend=0x77fc9760 "`\227\374\367\377\177", 
irreversible=) at gconv.c:75
#4  0x75cf882c in iconv (cd=0x1210, inbuf=0x7fff9bc0, 
inbytesleft=0x7fff9bb8, 
outbuf=0x7fff9bb0, outbytesleft=0x7fff9ba8) at iconv.c:53
#5  0x7fffe737631f in doIconv(void*, unsigned char const*, unsigned char*, 
unsigned long, unsigned long, unsigned long&, bool) () from 
/usr/lib/libcwbcore.so
#6  0x7fffe7376456 in PiNlConverter::convertIconv(unsigned char const*, 
unsigned char*, unsigned long, unsigned long, PiNlConversionDetail&) const () 
from /usr/lib/libcwbcore.so
#7  0x7fffe73796a8 in PiNlConverter::convert(unsigned char const*, unsigned 
char*, unsigned long, unsigned lon---Type  to continue, or q  
to quit---
g, PiNlConversionDetail&) const () from /usr/lib/libcwbcore.so
#8  0x7fffe75c6f5f in STATEMENT_INFO::convertToClientCodePage(char const*, 
char*, unsigned int, unsigned int, COLUMN_INFO&, COLUMN_INFO const&, unsigned 
int*, PiNlConverter::PADTYPE, int) ()
   from /opt/ibm/iSeriesAccess/lib64/libcwbodbc.so
#9  0x7fffe75c771b in odbcConv_SQL400_CHAR_to_C_WCHAR(STATEMENT_INFO&, char 
const*, char*, unsigned int, unsigned int, COLUMN_INFO&, COLUMN_INFO const&, 
unsigned int*) () from /opt/ibm/iSeriesAccess/lib64/libcwbodbc.so
#10 0x7fffe75c2587 in odbcConvSQLtoC(STATEMENT_INFO&, int, int, char 
const*, char*, unsigned int, unsigned int, COLUMN_INFO&, COLUMN_INFO&, unsigned 
int*) () from /opt/ibm/iSeriesAccess/lib64/libcwbodbc.so
#11 0x7fffe75b17b9 in STATEMENT_INFO::odbcGetData(unsigned int, short, 
char*, int, int*) ()
   from /opt/ibm/iSeriesAccess/lib64/libcwbodbc.so
---Type  to continue, or q  to quit---
#12 0x7fffe75b478d in SQLGetData () from 
/opt/ibm/iSeriesAccess/lib64/libcwbodbc.so
#13 0x7fffe839d7e1 in SQLGetData () from /usr/lib/libodbc.so.1
#14 0x7fffe85f2114 in qGetStringData (hStmt=0xb0df00, column=, colSize=36, 
unicode=) at 
../../../sql/drivers/odbc/qsql_odbc.cpp:379
#15 0x7fffe85fc986 in QODBCResult::data (this=0x931d80, field=2)
at ../../../sql/drivers/odbc/qsql_odbc.cpp:1212
#16 0x77babc4d in QSqlQuery::value (this=0x7fffb9e0, index=2) at 
kernel/qsqlquery.cpp:399
#17 0x0041b294 in fatture::leggiFatture (this=0x96ec70) at 
fattura.cpp:657
#18 0x004363e9 in fatture::qt_metacall (this=0x96ec70, 
_c=QMetaObject::InvokeMetaMethod, _id=12, 
_a=0x7fffbbd0) at moc_fattura.cpp:113
---Type  to continue, or q  to quit---
#19 0x76b98b27 in QMetaObject::activate (sender=0x7f90b0, m=, 
local_signal_index=, argv=0x) at 
kernel/qobject.cpp:3280
#20 0x77468d45 in QDateTimeEdit::dateChanged (this=0x1210, _t1=)
at .moc/release-shared/moc_qdatetimeedit.cpp:254
#21 0x7746f0e1 in QDateTimeEditPrivate::emitSignals 
(this=0x7fffbc00, ep=, 
old=) at widgets/qdatetimeedit.cpp:2120
#22 0x7744929e in QAbstractSpinBoxPrivate::setValue (this=0x765640, 
val=, 
ep=EmitIfChanged, doUpdate=) at 
widgets/qabstractspinbox.cpp:1719
#23 0x7744c865 in QAbstractSpinBoxPrivate::_q_editorTextChanged 
(this=0x765640, t=...)
at widgets/qabstractspinbox.cpp:1487
---Type  to continue, or q  to quit---
#24 0x7744c9ae in QAbstractSpinBox::qt_metacall (this=0x7f90b0, 
_c=QMetaObject::InvokeMetaMethod, 
_id=, _a=0x7fffbf80) at 
.moc/release-shared/moc_qabstractspinbox.cpp:120
#25 0x77470495 in QDateTimeEdit::qt_metacall (this=0x1210, _c=4624, 
_id=6, _a=0x)
at .moc/release-shared/moc_qdatetimeedit.cpp:154
#26 0x77470945 in QDateEdit::qt_metacall (this=0x1210, _c=4624, _id=6, 
_a=0x)
at .moc/release-shared/moc_qdatetimeedit.cpp:389
#27 0x76b98b27 in QMetaObject::activate (sender=0x8b2300, m=, 
local_signal_index=, argv=0x) at 
kernel/qobject.cpp:3280
#28 0x7749ae72 in QLineEdit::textChanged (this=0x1210, _t1=)
  

[Bug 665188] Re: QVariant and ODBC for iSeries segmentation fault in text field.

2011-01-11 Thread Mondin Marco
Here is gdb output:

ma...@marco-desktop:~/src/g-suite/gfat$ gdb gfat
GNU gdb (GDB) 7.2-ubuntu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
...
Reading symbols from /home/marco/src/g-suite/gfat/gfat...done.
(gdb) break qsql_odbc.cpp:373
No source file named qsql_odbc.cpp.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (qsql_odbc.cpp:373) pending.
(gdb) run
Starting program: /home/marco/src/g-suite/gfat/gfat 
[Thread debugging using libthread_db enabled]
QInotifyFileSystemWatcherEngine::addPaths: inotify_add_watch failed: File o 
directory non esistente
[New Thread 0x7fffe9007700 (LWP 2281)]
QFileSystemWatcher: failed to add paths: /home/marco/.config/ibus/bus
Bus::open: Can not get ibus-daemon's address. 
IBusInputContext::createInputContext: no connection to ibus-daemon 
Provo a leggere le fatture...
 
Preparo la query...
 
Eseguo la query...
 
Query eseguita...
 
Provo a leggere le fatture...
 
Preparo la query...
 
Eseguo la query...
 
Query eseguita...
 
Provo a leggere le fatture...
 
Preparo la query...
 
Eseguo la query...
 
Query eseguita...
 
Valore letto... 
1... 

Breakpoint 1, qGetStringData (hStmt=0xb222c0, column=2, colSize=36, 
unicode=true)
at ../../../sql/drivers/odbc/qsql_odbc.cpp:373
373 ../../../sql/drivers/odbc/qsql_odbc.cpp: File o directory non esistente.
in ../../../sql/drivers/odbc/qsql_odbc.cpp
(gdb) s
379 in ../../../sql/drivers/odbc/qsql_odbc.cpp
(gdb) s
gfat: gconv.c:75: __gconv: asserzione "outbuf != ((void *)0) && *outbuf != 
((void *)0)" non riuscita.

Program received signal SIGABRT, Aborted.
0x75d0cba5 in raise (sig=) at 
../nptl/sysdeps/unix/sysv/linux/raise.c:64
64  ../nptl/sysdeps/unix/sysv/linux/raise.c: File o directory non esistente.
in ../nptl/sysdeps/unix/sysv/linux/raise.c

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/665188

Title:
  QVariant and ODBC for iSeries segmentation fault in text field.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 665188] Re: QVariant and ODBC for iSeries segmentation fault in text field.

2010-10-26 Thread Mondin Marco
Following is the gdb bugtrace:

#0  0x75d0cba5 in raise () from /lib/libc.so.6
#1  0x75d106b0 in abort () from /lib/libc.so.6
#2  0x75d05a71 in __assert_fail () from /lib/libc.so.6
#3  0x75cf93a3 in ?? () from /lib/libc.so.6
#4  0x75cf882c in iconv () from /lib/libc.so.6
#5  0x7fffe3227cb7 in doIconv(void*, unsigned char const*, unsigned char*, 
unsigned long, unsigned long, unsigned long&, bool) () from 
/opt/ibm/iSeriesAccess/lib64/libcwbcore.so
#6  0x7fffe3227de6 in PiNlConverter::convertIconv(unsigned char const*, 
unsigned char*, unsigned long, unsigned long, PiNlConversionDetail&) const () 
from /opt/ibm/iSeriesAccess/lib64/libcwbcore.so
#7  0x7fffe322afd8 in PiNlConverter::convert(unsigned char const*, unsigned 
char*, unsigned long, unsigned lon
g, PiNlConversionDetail&) const () from 
/opt/ibm/iSeriesAccess/lib64/libcwbcore.so
#8  0x7fffe3454236 in STATEMENT_INFO::convertToClientCodePage(char const*, 
char*, unsigned int, unsigned int, COLUMN_INFO&, COLUMN_INFO const&, unsigned 
int*, PiNlConverter::PADTYPE, int) ()
   from /opt/ibm/iSeriesAccess/lib64/libcwbodbc.so
#9  0x7fffe345496b in odbcConv_SQL400_CHAR_to_C_WCHAR(STATEMENT_INFO&, char 
const*, char*, unsigned int, unsigned int, COLUMN_INFO&, COLUMN_INFO const&, 
unsigned int*) () from /opt/ibm/iSeriesAccess/lib64/libcwbodbc.so
#10 0x7fffe344e25a in odbcConvSQLtoC(STATEMENT_INFO&, int, int, char 
const*, char*, unsigned int, unsigned int, COLUMN_INFO&, COLUMN_INFO&, unsigned 
int*) () from /opt/ibm/iSeriesAccess/lib64/libcwbodbc.so
#11 0x7fffe343d831 in STATEMENT_INFO::odbcGetData(unsigned int, short, 
char*, int, int*) ()
   from /opt/ibm/iSeriesAccess/lib64/libcwbodbc.so
#12 0x7fffe344054d in SQLGetData () from 
/opt/ibm/iSeriesAccess/lib64/libcwbodbc.so
#13 0x7fffe83c97e1 in SQLGetData () from /usr/lib/libodbc.so.1
#14 0x7fffe861e114 in ?? () from 
/usr/lib/qt4/plugins/sqldrivers/libqsqlodbc.so
#15 0x7fffe8628986 in ?? () from 
/usr/lib/qt4/plugins/sqldrivers/libqsqlodbc.so
#16 0x77babc4d in QSqlQuery::value(int) const () from 
/usr/lib/libQtSql.so.4
#17 0x00422866 in fatture::leggiFatture() ()
#18 0x0043d82d in fatture::qt_metacall(QMetaObject::Call, int, void**) 
()
#19 0x76b98b27 in QMetaObject::activate(QObject*, QMetaObject const*, 
int, void**) ()
   from /usr/lib/libQtCore.so.4
#20 0x77468d45 in QDateTimeEdit::dateChanged(QDate const&) () from 
/usr/lib/libQtGui.so.4
#21 0x7746f0e1 in ?? () from /usr/lib/libQtGui.so.4
#22 0x7744929e in ?? () from /usr/lib/libQtGui.so.4
#23 0x7744c865 in ?? () from /usr/lib/libQtGui.so.4
#24 0x7744c9ae in QAbstractSpinBox::qt_metacall(QMetaObject::Call, int, 
void**) ()
   from /usr/lib/libQtGui.so.4
#25 0x77470495 in QDateTimeEdit::qt_metacall(QMetaObject::Call, int, 
void**) ()
   from /usr/lib/libQtGui.so.4
#26 0x77470945 in QDateEdit::qt_metacall(QMetaObject::Call, int, 
void**) () from /usr/lib/libQtGui.so.4
#27 0x76b98b27 in QMetaObject::activate(QObject*, QMetaObject const*, 
int, void**) ()
   from /usr/lib/libQtCore.so.4
#28 0x7749ae72 in QLineEdit::textChanged(QString const&) () from 
/usr/lib/libQtGui.so.4
#29 0x7749e36c in QLineEdit::qt_metacall(QMetaObject::Call, int, 
void**) () from /usr/lib/libQtGui.so.4
#30 0x76b98b27 in QMetaObject::activate(QObject*, QMetaObject const*, 
int, void**) ()
   from /usr/lib/libQtCore.so.4
#31 0x7774c295 in QLineControl::textChanged(QString const&) () from 
/usr/lib/libQtGui.so.4
#32 0x774a4be6 in QLineControl::finishChange(int, bool, bool) () from 
/usr/lib/libQtGui.so.4
#33 0x774a65ff in QLineControl::processKeyEvent(QKeyEvent*) () from 
/usr/lib/libQtGui.so.4
#34 0x7749b021 in QLineEdit::keyPressEvent(QKeyEvent*) () from 
/usr/lib/libQtGui.so.4
#35 0x770c1cfa in QWidget::event(QEvent*) () from /usr/lib/libQtGui.so.4
#36 0x7749c223 in QLineEdit::event(QEvent*) () from 
/usr/lib/libQtGui.so.4
#37 0x7744bd13 in QAbstractSpinBox::keyPressEvent(QKeyEvent*) () from 
/usr/lib/libQtGui.so.4
#38 0x7746f7be in QDateTimeEdit::keyPressEvent(QKeyEvent*) () from 
/usr/lib/libQtGui.so.4
#39 0x770c1cfa in QWidget::event(QEvent*) () from /usr/lib/libQtGui.so.4
#40 0x7746e29d in QDateTimeEdit::event(QEvent*) () from 
/usr/lib/libQtGui.so.4
#41 0x7706bfdc in QApplicationPrivate::notify_helper(QObject*, QEvent*) 
() from /usr/lib/libQtGui.so.4
#42 0x77073346 in QApplication::notify(QObject*, QEvent*) () from 
/usr/lib/libQtGui.so.4
#43 0x76b80cdc in QCoreApplication::notifyInternal(QObject*, QEvent*) 
() from /usr/lib/libQtCore.so.4
#44 0x771194ba in ?? () from /usr/lib/libQtGui.so.4
#45 0x7711bac0 in ?? () from /usr/lib/libQtGui.so.4
#46 0x770f2cb4 in QApplication::x11ProcessEvent(_XEvent*) () from 
/usr/lib/libQtGui.so.4
#47 0x7711f0e

[Bug 665188] Re: QVariant and ODBC for iSeries segmentation fault in text field.

2010-10-25 Thread Mondin Marco
** Description changed:

  Binary package hint: libqt4-sql-odbc
  
- Ubuntu / Kubuntu 4.10 everything worked perfectly.
+ Ubuntu / Kubuntu 10.04 everything worked perfectly.
  
  With ubuntu / kubuntu 10.10, accessing a database on the IBM iSeries, using a 
SELECT query from QT4 application, everything works correctly only with numeric 
fields on the database.
  If you try to read a text field with the method "QVariant value (int index) 
const", it lies in a crash!
  The error is as follows:
  
  gconv.c: 75: __gconv: Assertion "outbuf! = ((void *) 0) & & * outbuf! = 
((void *) 0) 'failed.
  Aborted
  
  It happens on application found on the repositories, just as stacked on
  personal application.
  
  For example, the application "tora", querying works on numeric fields,
  but does not work on text fields.
  
  For example, an application personnel arrived at this point in the
  source:
  
  ...
  while(query.next())
  {
std::cout<<"Valore letto...";
std::cout.flush();
num_doc.append(query.value(1).toInt());
std::cout<<"1...";
std::cout.flush();
sleep(3);
QVariant a=query.value(0);
std::cout<<"1.5...";
std::cout.flush();
main_window->listWidget_cli->addItem(QString("FD 
nr.")+QString::number(query.value(1).toInt())+QString(" di 
")+QString::fromLatin1(query.value(2).toByteArray().data()));
std::cout<<"2...\n";
std::cout.flush();
stato=true;
  }
  ...
  
  the output is as follows:
  ...
  Valore letto...1...1.5...gfat: gconv.c:75: __gconv: Asserzione "outbuf != 
((void *)0) && *outbuf != ((void *)0)" non riuscita.
  Aborted
  
  Even with a simple:
  ...
  QVariant a=query.value(2);
  ...
  
  the output is as follows:
  ...
  gfat: gconv.c:75: __gconv: Asserzione "outbuf != ((void *)0) && *outbuf != 
((void *)0)" non riuscita.
  Aborted

** Tags added: database gconv ibm iseries odbc qodbc qstring qt4
qvariant sql

-- 
QVariant and ODBC for iSeries segmentation fault in text field.
https://bugs.launchpad.net/bugs/665188
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs