libdbus tries to behave in a way suitable for a core system service, for instance by surviving (and rolling back a transaction) if memory allocators return NULL. A bug and an enhancement in this direction: * One call to realloc() is not checked, so libdbus crashes if it returns NULL. My first patch checks it. * To debug memory issues, it would be useful to be able to put libdbus in a GLib-like mode where malloc failures are fatal, particularly when combined with a small rlimit. My second patch adds this; for the moment it depends on DBUS_BUILD_TESTS.
Created attachment 51416 [details] [review] [1/2] dbus_realloc: don't crash if realloc() returns NULL while using guards
Created attachment 51417 [details] [review] [2/2] dbus-memory: add optional checking for system malloc() (etc.) failing If tests are enabled and DBUS_MALLOC_CANNOT_FAIL is set, abort on system malloc() failures (as GLib's g_malloc does). This can be used in conjunction with a resource limit, to turn runaway memory leaks into a debuggable core-dump.
Comment on attachment 51416 [details] [review] [1/2] dbus_realloc: don't crash if realloc() returns NULL while using guards Review of attachment 51416 [details] [review]: ----------------------------------------------------------------- ++
Comment on attachment 51417 [details] [review] [2/2] dbus-memory: add optional checking for system malloc() (etc.) failing Review of attachment 51417 [details] [review]: ----------------------------------------------------------------- ++
Fixed in git for 1.5.10, thanks. I didn't merge this for 1.4 in the end.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.