Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to parse STMT_EXECUTE larger than 16MB #1350

Closed
gfloyd opened this issue Jan 25, 2018 · 4 comments
Closed

Unable to parse STMT_EXECUTE larger than 16MB #1350

gfloyd opened this issue Jan 25, 2018 · 4 comments

Comments

@gfloyd
Copy link

gfloyd commented Jan 25, 2018

Version:

ProxySQL version 1.4.5-19-g3b9e408, codename Truls

OS: Ubuntu 16.04

We're encountering frequent crashes with the following error:

#0  mysql_decode_length (ptr=0x6c6ce4be07903c55 <error: Cannot access memory at address 0x6c6ce4be07903c55>, len=0x7f75e1e07800) at MySQL_Protocol.cpp:203

Unfortunately, I can't seem to reproduce it reliably, as it's only happening under production load. Let me know where to send a core dump if that helps!

@renecannao
Copy link
Contributor

Can you please compress few core dumps, upload them to Dropbox / Box / Google Drive, and share a link?
You can send me link via email if you prefer.
Thanks

@gfloyd
Copy link
Author

gfloyd commented Jan 25, 2018

Link sent via email.

@renecannao renecannao changed the title 1.4.5 seg fault Unable to parse STMT_EXECUTE larger than 16MB Jan 26, 2018
@renecannao
Copy link
Contributor

Thank you very much for the core dumps, it absolutely helped!
I confirm the bug, and changed the subject of this issue to better describe the problem.
According to MySQL Protocol, each packet cannot be larger than 16MB. If a payload is larger than 16MB, it is split into multiple packets, see documentation .
ProxySQL correctly handles COM_QUERY payloads larger than 16MB that are split across multiple packets, but is unable to handle COM_STMT_EXECUTE payload larger than 16MB (means, there is no code to handle such scenarios).
Normally libraries use COM_STMT_SEND_LONG_DATA to send large payloads, but nothing prevents to use large payload in COM_STMT_EXECUTE itself.

renecannao added a commit that referenced this issue Jan 14, 2019
Wrong decoding in MySQL protocol for field bigger than 16MB causes crash.
The only code path affected by this seems to be reading parameters from
prepared statements.
renecannao added a commit that referenced this issue Jan 14, 2019
Wrong decoding in MySQL protocol for field bigger than 16MB causes crash.
The only code path affected by this seems to be reading parameters from
prepared statements.
@renecannao
Copy link
Contributor

Fixed in 1.4.14 and 2.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants