free() error with MySQL++ 3.2.5 and MySQL 8.018

free() error with MySQL++ 3.2.5 and MySQL 8.018

(1) By Armin (nollarm) on 2019-12-03 07:49:55 [link] [source]

Dear team,

we built our application with MySQL++ 3.2.5 and MySQL 8.0.18 under RHEL 7.6. When running it, we get the following error more or less immediately:

.*** Error in `bosd': free(): invalid next size (fast): 0x00000000032c64e0 ***
======= Backtrace: =========
======= Memory map: ========
00400000-00db6000 r-xp 00000000 fd:02 13245817                           /opt/gts/bin/bosd

The same with MySQL++ 3.2.4 and MySQL 5.7.27 works perfectly.

Do you have an idea what might be the problem? Might MySQL++ 3.2.5 not be compatible with MySQL 8.0.18 ?

Regards Armin

(2) By Warren Young (tangent) on 2019-12-03 13:08:14 [source] in reply to 1

As to your question of compatibility, I have no reason to believe current MySQL++ is incompatible with current MySQL. I'd need more than is in your post to change that belief. Indeed, it goes the other direction: the latest version of MySQL++ has specific changes to improve MySQL 8.0.x compatibility. Perhaps more changes are needed, but usually when that's the case, MySQL++ doesn't build at all.

free() is a C library function, which means it's well below the level of MySQL++, which generally avoids all C library mechanisms where there is a C++ equivalent. The string "free(" doesn't even appear in the MySQL++ library code.

Your own stack trace shows this call happening several levels down in libcrypto, which is of course not MySQL++ at all.

The only odd thing I see there is that we don't see libmysqlclient in the call stack. I don't know how MySQL++ calls straight into libcrypto, bypassing libmysqlclient. I'd guess there's a macro or inline function in the MySQL C API headers, but that's just a wild guess because you haven't provided any MySQL++ source code file names or line numbers.

Either run the program under a debugger with a debug build of the libraries so that you can get a more useful backtrace or use addr2line to decode those addresses so we can at least see where you're stepping out of MySQL++ into libcrypto.