In my quest to get Android 10 running on my hardware, I was experimenting with minigbm/gralloc0, using intel's version of minigbm (although I also tried AOSP minigbm with the same result). I encountered a problem whereby the device boots, but SystemUI crashes after a second or two. I tracked down the crash and found something weird, so I figured I might report it, in case it is useful for somebody else.
because mDevice is NULL at that point.
However this does not do a full initialization of the module, because it calls gralloc0_init with second argument set to false. So you end up with gralloc module that is only partially initialized. Hilarity ensues.
From the higher-level point of view, both the mapper and allocator HIDL (pass-through) use the gralloc module using some kind of adapter, the mapper ends up calling gralloc0_register_buffer, while the allocator calls gralloc0_open. And it happens that the mapper is used before the allocator.