[haiku-bugs] Re: [Haiku] #16610: app_server: crash when running application from another user

  • From: "Haiku" <trac@xxxxxxxxxxxx>
  • To: undisclosed-recipients: ;
  • Date: Fri, 20 Nov 2020 04:07:25 -0000

#16610: app_server: crash when running application from another user
---------------------------------+----------------------------
  Reporter:  X512                |      Owner:  axeld
      Type:  bug                 |     Status:  new
  Priority:  normal              |  Milestone:  Unscheduled
 Component:  Servers/app_server  |    Version:  R1/Development
Resolution:                      |   Keywords:
Blocked By:                      |   Blocking:
  Platform:  All                 |
---------------------------------+----------------------------
Comment (by waddlesplash):

Common registrar resources:

 We are mostly talking about app_server here, and only registrar
 secondarily. It may well be the case that registrar should have only a
 single instance but app_server should have multiple; they are not so
 closely tied.

MIME processing.

 This actually needs to be at least partially per-user, since different
 users can have different applications installed, or different custom
 mimetypes registered, so what a file is sniffed as for one user can be
 different for another, or what path is launched for a mimetype different
 by user.

Timers (move to libbe.so?).

 Yes, they should be moved indeed.

I see no benefits of moving this in separate process, threads are
 enough.

 I was talking about app_server regarding port/looper separation, not
 registrar, here.

This argument is working in opposite direction because different
 sessions will likely use same fonts and single process will give cache
 benefits.

 That is only half true, as different users can have different fonts
 installed, in use, set as default, etc. and so the glyph and fallback
 caches, despite the font sets being very similar, wind up being extremely
 different.

 But fonts are the only thing this is true of. The alpha-mask cache, as I
 mentioned earlier, will be almost entirely different between users (unless
 they are doing almost the exact same things!) and so to share the alpha
 mask cache between users would just seriously degrade performance. And
 these are only examples, there are other resources shared inside
 app_server which make little sense to share across users (or cannot be
 shared for security reasons.)

Multiple processes will have duplicate cache entries that will waste
 memory and slow down access.

 If we have got to the level where the slowed-down access is due to
 duplication in CPU caches... that is the last level of argument about
 performance, IMO. Most of the time, the CPU cache is not anything close to
 being a bottleneck for most algorithms.

 But if we are talking purely about font caching, I am pretty sure this is
 exactly what fontconfig does on Linux, and there, every application will
 load some portion of the fontconfig cache into memory to draw text. On
 Haiku, only app_server does, so it is hardly a big deal if multiple
 processes use it.

 It is also the case that we are talking about a small amount of memory
 here, maybe 4-8MB at absolute most. The vast majority of app_server memory
 is dedicated to per-application/per-desktop resources, not the small
 number of things like this that can even be potentially shared.
-- 
Ticket URL: <https://dev.haiku-os.org/ticket/16610#comment:15>
Haiku <https://dev.haiku-os.org>
The Haiku operating system.

Other related posts: