[haiku-commits] Change in haiku[master]: [RFC] Catch agg allocation errors in app_server

  • From: Gerrit <review@xxxxxxxxxxxxxxxxxxx>
  • To: waddlesplash <waddlesplash@xxxxxxxxx>, haiku-commits@xxxxxxxxxxxxx
  • Date: Sun, 1 Sep 2019 09:45:53 +0000

From Adrien Destugues <pulkomandy@xxxxxxxxx>:

Adrien Destugues has uploaded this change for review. ( 
https://review.haiku-os.org/c/haiku/+/1810 ;)


Change subject: [RFC] Catch agg allocation errors in app_server
......................................................................

[RFC] Catch agg allocation errors in app_server

I got an app_server crash because agg failed to allocate some memory.
It turns out agg does not use nothrow new and does not make any attempt
at checking null pointers. And the code calling it in most cases do not
expect operations to fail.

Since refactoring all of this seems a bit pointless, I think the best
way to go is to catch the error at the level where we can handle it.
The ServerWindow seems to be appropriate, as we can then propagate the
error to the BApplication (in the cases where the application is
expecting a return message from its commands).

I wonder if we should make app_server better at managing its memory.
Maybe it could check which app is making it use a lot of resources and
somehow ask it to calm down? It is difficult to handle the out of memory
situation here because we are just replying to application requests, and
when an allocation fails, it may not even be the fault of the
application which requested that specific allocation.
---
M src/servers/app/ServerWindow.cpp
1 file changed, 11 insertions(+), 3 deletions(-)



  git pull ssh://git.haiku-os.org:22/haiku refs/changes/10/1810/1
--
To view, visit https://review.haiku-os.org/c/haiku/+/1810
To unsubscribe, or for help writing mail filters, visit 
https://review.haiku-os.org/settings

Gerrit-Project: haiku
Gerrit-Branch: master
Gerrit-Change-Id: If5285d778f0ff370cdfa70e9a05044b0023bf5ea
Gerrit-Change-Number: 1810
Gerrit-PatchSet: 1
Gerrit-Owner: Adrien Destugues <pulkomandy@xxxxxxxxx>
Gerrit-MessageType: newchange

Other related posts:

  • » [haiku-commits] Change in haiku[master]: [RFC] Catch agg allocation errors in app_server - Gerrit