[MDEV-12247] Server does not respond for simple query execution Created: 2017-03-13 Updated: 2017-09-26 Resolved: 2017-04-04 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Scripts & Clients |
| Affects Version/s: | 10.2.4 |
| Fix Version/s: | 10.2.5 |
| Type: | Bug | Priority: | Critical |
| Reporter: | FLAESCH Sebastien | Assignee: | Georg Richter |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | 10.2-rc | ||
| Environment: |
Linux Debian 8.6 / 64bits, Windows 10 / 64bits |
||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Sprint: | 10.2.6-2, 10.2.6-3 | ||||||||
| Description |
|
Same code working with 10.1 now hangs when executing a simple SELECT ...
Have stopped and restarted the server several times, only one single client connects.... strange. |
| Comments |
| Comment by FLAESCH Sebastien [ 2017-03-13 ] | ||||||||||||||||||||||||||||||
|
Added mysql-strace- | ||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2017-03-13 ] | ||||||||||||||||||||||||||||||
|
Could you please paste the output of SHOW CREATE TABLE dbit2` and attach your cnf file(s)? | ||||||||||||||||||||||||||||||
| Comment by FLAESCH Sebastien [ 2017-03-13 ] | ||||||||||||||||||||||||||||||
|
The client ~/.my.cnf file:
Server my.cnf:
Description of the dbit2 table:
| ||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2017-03-14 ] | ||||||||||||||||||||||||||||||
|
Once stalled use the following with { ... }replaced by the mariadb processes id for mysqld.
Can you clarify which server versions you are using 10.1.X/ 10.2.Y? Where did you install these from? | ||||||||||||||||||||||||||||||
| Comment by FLAESCH Sebastien [ 2017-03-14 ] | ||||||||||||||||||||||||||||||
|
As written in the "Affects Version/s:" field, I have MariaDB 10.2.4 The gdb command output shows following: is in fact procid without curly braces)
Produces gdb-mysqld-001.txt in attachment. | ||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2017-03-17 ] | ||||||||||||||||||||||||||||||
|
Thanks for the stack trace, it helps. sebflaesch, are you only running on Debian 8.6, or do you have other versions/systems? I'm very interested to know where else it is reproducible, the statistics could help to get to the bottom of it. | ||||||||||||||||||||||||||||||
| Comment by FLAESCH Sebastien [ 2017-03-18 ] | ||||||||||||||||||||||||||||||
|
Thanks for considering this bug. | ||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2017-03-18 ] | ||||||||||||||||||||||||||||||
|
No, thanks, there is no need to test on other Unixes, I was asking in case you already had some observations. Is it absolutely reproducible for you? Like, every time when you run the query, it hangs? | ||||||||||||||||||||||||||||||
| Comment by FLAESCH Sebastien [ 2017-03-18 ] | ||||||||||||||||||||||||||||||
|
In fact we have a C program using the MySQL C client API, it is linked with libmariadb.so.3. | ||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2017-03-18 ] | ||||||||||||||||||||||||||||||
|
Well, according to our stack traces, server hangs "in nowhere", just reading a packet, not doing anything significant, so the client side might be of importance here. My current suspect is libmariadb, but it's too early to say for sure. The big difference between your case and mine is that yours is reproducible every time for you, while mine was only happening once in hundreds of attempts. So yours is definitely more promising. I presume you can't reproduce it on your server if you just connect to it with the command-line client and do the same prepare/execute? I've been trying to re-create your exact test case based on the log, not successful so far; so I have a question:
Do you know why it does two Prepare for the select? Better still, do you think you could share the relevant part of your code, maybe there is something specific about prepare or binding (types, attributes, whatever) that the library processes wrongly | ||||||||||||||||||||||||||||||
| Comment by FLAESCH Sebastien [ 2017-03-18 ] | ||||||||||||||||||||||||||||||
|
Double prepare:
In fact, the Genero BDL code does an OPEN USING followed by FOREACH loop. This ends up in a first call to mysql_stmt_bind_param() + mysql_stmt_execute(), and then the FOREACH makes again a call to mysql_stmt_execute()...
I suspect however that MariaDB does not deal properly with these subsequent executes, or that we misuse the MariaDB client API in this case... (but our C code implementing these instructions exists for a while and is working fine with MySQL 5.7 client and MariaDB 10.1) I will try to provide a pure MySQL C sample that reproduces the problem. | ||||||||||||||||||||||||||||||
| Comment by FLAESCH Sebastien [ 2017-03-19 ] | ||||||||||||||||||||||||||||||
|
I could reproduce with a simplified program: Try attachment Seems to be related to the cursor type setting with mysql_stmt_attr_set()...
Please try to reproduce on your side and let me know.
| ||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2017-03-19 ] | ||||||||||||||||||||||||||||||
|
Thanks a lot, reproducible for me with the libraries from 10.2.4 and mariadb-connector 3.0.1 (and not reproducible with libraries from 10.1). | ||||||||||||||||||||||||||||||
| Comment by Georg Richter [ 2017-03-21 ] | ||||||||||||||||||||||||||||||
|
Fix pushed to Connector/C master branch commit 63e0897d43881b6fcdcc4eff1d38b8e201dce631 | ||||||||||||||||||||||||||||||
| Comment by FLAESCH Sebastien [ 2017-09-26 ] | ||||||||||||||||||||||||||||||
|
Verified with 10.2.8 |