[Interest] Using leveldb in a Qt app redirects unrelated system malloc calls to tcmalloc?

René J. V. Bertin rjvbertin at gmail.com
Fri Apr 13 09:58:46 CEST 2018

Thiago Macieira wrote:


> of the parent. The fact that it's deadlocking in the code that is supposed to
> remove locks so that it won't deadlock is a good irony.

Yeah, very funny until it happens to you :)

> Absent further proof to the contrary, this looks like a system bug.

You could be right, but how on earth do I end up in tcmalloc code here?

In my experiment I'm trying to store ints (index numbers used as the key) as 4-
byte strings in QByteArrays which get converted to std::strings for use with 
leveldb. I half expect that I'm overlooking a place where this goes wrong, but 
also that that would lead to more variable crash backtraces.

I use Chrome as a browser, which must use leveldb internally, so if this were a 
system bug I'd expect to see deadlocks while surfing. That just doesn't happen, 
which probably means we can at least not factor Qt out of the equation.


More information about the Interest mailing list