Ubuntu 14.04.1 libmyodbc 5.1.10-3 bug
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
myodbc (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
== Comment: #0 - Xiao Yuan Li <email address hidden> - 2014-11-20 21:58:30 ==
---Problem Description---
Ubuntu 14.04.1 libmyodbc 5.1.10-3 reset the row-count loop variable of user application to zero and it results in user application core dump
---uname output---
Linux (none) 3.13.0-39-generic #66-Ubuntu SMP Tue Oct 28 13:30:27 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
Machine Type = x64
---Debugger---
A debugger is not configured
---Steps to Reproduce---
user application query multi-rows data from mysql, libmyodbc function "copy_ansi_result ()" will reset row-count loop variable "j" to 0.
Then it will result in the return value of "SQLGetData()" is "SQL_NO_DATA".
user application will core dump.
int fetch_all_
SQLRETURN V_OD_erg; // result of functions
DB_ROW row = NULL;
char *temp;
#if USE_SQLLEN
SQLLEN indicator;
#else
SQLINTEGER indicator;
#endif
long j;
if (!res->
}
if (!row) {
}
for (i = 1; i <= res->field_count; i++) {//get each column for each row
temp=malloc(
}//end for j
return 0;
}
----following is gdb debug info---
please refer the following gdb info and i is res->field_count/j is res->row_count
mysql> select id from lic_pollers order by id (this is the following query sql)
-> ;
+----+
| id |
+----+
| 1 |
| 2 |
+----+
2 rows in set (0.03 sec)
11/10/2014 12:16:09 AM - LIC field_count=1, row_count=2
484 fetch_ret=
(gdb) s
fetch_all_data (V_OD_hstmt=
669 DB_ROW row = NULL;
(gdb) n
679 GRID_LOG_
(gdb)
11/10/2014 12:16:15 AM - LIC DEBUG: in fetch
680 res->fetched_
(gdb) watch i
Hardware watchpoint 2: i
(gdb) watch j
Hardware watchpoint 3: j
(gdb) n
681 if (!res->
(gdb) n
685 memset(
(gdb)
686 for(j=0;
(gdb)
Hardware watchpoint 3: j
Old value = 140737488345312
New value = 0
0x000000000040728c in fetch_all_data (V_OD_hstmt=
686 for(j=0;
(gdb)
687 V_OD_erg = SQLFetchScroll(
(gdb)
688 if(!SQL_
(gdb)
692 row=malloc(
(gdb)
693 if (!row) {
(gdb)
698 memset(row, 0, res->field_
(gdb)
699 for (i = 1; i <= res->field_count; i++) {//get each column for each row
(gdb)
Hardware watchpoint 2: i
Old value = 0
New value = 1
0x0000000000407342 in fetch_all_data (V_OD_hstmt=
699 for (i = 1; i <= res->field_count; i++) {//get each column for each row
(gdb)
700 V_OD_erg = SQLGetData(
(gdb)
701 if (SQL_SUCCEEDED(
(gdb)
703 if (indicator == SQL_NULL_DATA){
(gdb)
714 temp=malloc(
(gdb)
715 if (!temp) {
(gdb)
720 memset(temp, 0, indicator+1);
(gdb)
721 V_OD_erg = SQLGetData(
(gdb)
722 row[i-1]=temp;
(gdb)
723 GRID_LOG_
(gdb)
11/10/2014 12:17:05 AM - LIC DEBUG: Column 1 [1]: 1
699 for (i = 1; i <= res->field_count; i++) {//get each column for each row
(gdb)
Hardware watchpoint 2: i
Old value = 1
New value = 2
0x0000000000407591 in fetch_all_data (V_OD_hstmt=
699 for (i = 1; i <= res->field_count; i++) {//get each column for each row
(gdb) n
737 GRID_LOG_
(gdb)
11/10/2014 12:17:18 AM - LIC DEBUG: Fetched [1] Column
738 res->fetched_
(gdb)
686 for(j=0;
(gdb) n
Hardware watchpoint 3: j
Old value = 0
New value = 1
0x00000000004075eb in fetch_all_data (V_OD_hstmt=
686 for(j=0;
(gdb)
687 V_OD_erg = SQLFetchScroll(
(gdb)
688 if(!SQL_
(gdb) n
692 row=malloc(
(gdb) n
693 if (!row) {
(gdb) n
698 memset(row, 0, res->field_
(gdb)
699 for (i = 1; i <= res->field_count; i++) {//get each column for each row
(gdb)
Hardware watchpoint 2: i
Old value = 2
New value = 1
0x0000000000407342 in fetch_all_data (V_OD_hstmt=
699 for (i = 1; i <= res->field_count; i++) {//get each column for each row
(gdb) n
700 V_OD_erg = SQLGetData(
(gdb)
Hardware watchpoint 3: j
Old value = 1
New value = 0
0x00007ffff6aa3685 in copy_ansi_result () from /usr/lib/
Userspace tool common name: libmyodbc
The userspace tool has the following bit modes: 64-bit
Userspace rpm: libmyodbc-5.1.10-3
Userspace tool obtained from project website: na
tags: | added: architecture-x8664 bugnameltc-119128 severity-critical targetmilestone-inin14041 |
affects: | ubuntu → myodbc (Ubuntu) |
Changed in myodbc (Ubuntu): | |
status: | New → Invalid |
Thank you for taking the time to report this bug and helping to make Ubuntu better. It seems that your bug report is not filed about a specific source package though, rather it is just filed against Ubuntu in general. It is important that bug reports be filed about source packages so that people interested in the package can find the bugs about it. You can find some hints about determining what package your bug might be about at https:/ /wiki.ubuntu. com/Bugs/ FindRightPackag e. You might also ask for help in the #ubuntu-bugs irc channel on Freenode.
To change the source package that this bug is filed about visit https:/ /bugs.launchpad .net/ubuntu/ +bug/1394866/ +editstatus and add the package name in the text box next to the word Package.
[This is an automated message. I apologize if it reached you inappropriately; please just reply to this message indicating so.]