On Wed, 25 Mar 2026 01:04:08 GMT, Alexander Matveev <[email protected]> wrote:
> All recently submitted NULL pointer checks are not related to memory > allocation. They related to very unlikely conditions that might occur due to > something did not get initialized properly or we got into bad state. gstreamer is a C code base so it uses pointers a lot. It's not always the case that a routine that traffics in pointers needs to check those pointers for NULL. And I suspect these checks won't avoid crashes but just delay them. I think it would be better to submit these fixes to the gstreamer repository for evaluation. > I did some research and it looks like on Linux memory overcommit can be > disabled and in this case malloc() will return NULL. I think it is better to > check for NULL, since we do not know in what environment we will be executed. Overcommit is sort of beside the point. On desktop platforms memory out conditions are very, very rare (and by default we can't detect them). Designing and implementing a system that recovers from memory out is very, very hard. Testing such a system is almost impossible. JavaFX isn't a system that can recover from low memory and a few checks added to gstreamer won't change that. If these fixes were in JavaFX code I wouldn't object so much. But here we're making speculative fixes for speculative bugs in third-party code with the expectation that we will carry those fixes forward indefinitely. We should only do that if the bug is real and there's no hope of getting it fixed upstream. ------------- PR Comment: https://git.openjdk.org/jfx/pull/2115#issuecomment-4164276406
