[haiku-bugs] Re: [Haiku] #7976: Improve memory exhaustion process

  • From: "Haiku" <trac@xxxxxxxxxxxx>
  • To: undisclosed-recipients: ;
  • Date: Sat, 08 Aug 2020 12:32:50 -0000

#7976: Improve memory exhaustion process
----------------------------+----------------------------
  Reporter:  kallisti5      |      Owner:  nobody
      Type:  enhancement    |     Status:  assigned
  Priority:  normal         |  Milestone:  R1
 Component:  System/Kernel  |    Version:  R1/Development
Resolution:                 |   Keywords:
Blocked By:                 |   Blocking:
  Platform:  All            |
----------------------------+----------------------------
Comment (by pulkomandy):

 What I can see in the log is:
 - Jam crashed on a NULL pointer dereference. That's a bug in Jam, it
 didn't bother to check if malloc actually returned some memory
 - Then, we try to handle this in the debug_server. We also allocate memory
 for that. This also fails, and debug_server also crashes.
 - Finally, Tracker crashes as well.

 I don't think there is much to be done on the system side. Killing random
 apps is always a bad idea, better let the user make the right decisions on
 what to close. However, we should fix Tracker, debug_server and jam to
 check for allocation failures, and not crash, but cleanly stop what they
 are doing instead (jam could just exit, debug_server could just kill the
 crashed app without trying to show the debug alert, and Tracker stop
 whatever it was doing).

 One thing we may improve on is user feedback. If the memory is completely
 filled, there may not even be enough memory left for showing an error
 alert, since that also needs memory (spawning two threads in app_server
 and the app doing it, at least). If even that can't be done, it iwll
 appear as if the system is just not doing anything when trying to interact
 with it.
-- 
Ticket URL: <https://dev.haiku-os.org/ticket/7976#comment:5>
Haiku <https://dev.haiku-os.org>
The Haiku operating system.

Other related posts: