Opened 3 years ago

Closed 3 years ago

#56508 closed defect (fixed)

qt5XX-qtwebkit dependency on leveldb causes crashes

Reported by: Veence (Vincent) Owned by: MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: qt5-qtwebkit


qtwebkit depends on leveldb, which in turn depends on gperftools.

One, or both, of those dependencies seems buggy. Qgis3, which links against qtwebkit, keeps crashing in various dialogs (with messages like [src/tcmalloc.cpp]: attempt to free unknown pointer at {some address}).

Remove qtwebkit’s dependency on leveldb and not only it keeps on building fine, but the bugs are gone. So that dependency seems to be toxic. Why does it exist, given that qtwebkit seems to compile fine without?


Change History (8)

comment:1 Changed 3 years ago by Veence (Vincent)

Summary: qtXX-qtwebkit dependency on leveldb causes crashesqt5XX-qtwebkit dependency on leveldb causes crashes

comment:2 Changed 3 years ago by ryandesign (Ryan Schmidt)

Keywords: qt5 qtwebkit removed

comment:3 Changed 3 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Status: assignedaccepted

qtwebkit tests to see if there is a system version of leveldb by trying to compile a program.
If no system leveldb is found, qtwebkit builds its own.

I am not sure why the system version would cause these problems.
Any help narrowing down this problem would be appreciated.

comment:4 Changed 3 years ago by Veence (Vincent)

I have at that point no clue as to the culprit. It seemed to me that the current version of qtwebkit, when compiled with an external leveldb, reports using both the internal and third party code, but that might be misinterpreting something. I’ll try again this morning and let you know.

Other hypothesis: “gperftools” is buggy and Qt-internal leveldb doesn’t use it. Is there a way to compile leveldb without using gperftool’s tcmalloc library?

Other possibility: “gperftools”, if used internally by Qt, is compiled with less stringent behavorial rules and does not abort on freeing wrong addresses (which may give rise to leaks, but otherwise don’t plague the application behavior).

I’d have to look into this, but that entails recompling all those ports with “-g -O0” flags and using XCode/LLDB/Instruments to monitor the defects. It’s not unfeasable, but there may be simplier way to address this rather than going the whole hog.

comment:5 Changed 3 years ago by Veence (Vincent)

Ok, using leveldb without the gperftool dependency works. So it’s definitely gperftool which causes the whole shebang to run amok.

comment:6 Changed 3 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Resolution: fixed
Status: acceptedclosed

This discussion seems to have moved back to #56164.
There is a potential fix in leveldb.

Last edited 3 years ago by ryandesign (Ryan Schmidt) (previous) (diff)

comment:7 Changed 3 years ago by ryandesign (Ryan Schmidt)

Resolution: fixed
Status: closedreopened

Just removing the gperftool dependency can't possibly fix the problem for users who build from source. The build system must also be informed not to use gperftool even if it is already installed.

comment:8 Changed 3 years ago by Veence (Vincent)

Resolution: fixed
Status: reopenedclosed
Note: See TracTickets for help on using tickets.