Bug 185762 - [GTK] Initialize bmalloc only when needed
Summary: [GTK] Initialize bmalloc only when needed
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
Depends on:
Reported: 2018-05-18 03:18 PDT by Milan Crha
Modified: 2018-05-21 00:14 PDT (History)
2 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Milan Crha 2018-05-18 03:18:23 PDT
Would it be possible to initialize bmalloc only when it is really needed, please?

It's currently enough to preload WebKitGTK+ library and there's that bmalloc thread which has also some side effects, like the Gigacage allocations and so on. The Gigacage causes problems in various scenarios, when it crashes instead of fail gracefully and let the process run. (Like bug #183329 and downstream bug https://bugzilla.redhat.com/show_bug.cgi?id=1564970 ).

You can test it with such a simple program like this:


#include <stdio.h>
#include <stdlib.h>

int main (void)
	system ("sleep 30");
	return 0;


Compile it with:

   $ gcc simple.c -o simple -g

Then run it as:

   $ ./simple

and see its backtrace:

   $ gdb --batch --ex "t a a bt" -pid=`pidof simple`

which shows only a single thread and nothing else. Run it as this:

   $ LD_PRELOAD=/usr/lib64/libwebkit2gtk-4.0.so ./simple

and the backtrace will show also the bmalloc thread, even there's not called any single method from the webkit library.