tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Firefox dysfunctional, need help with sys/kern/uipc_sem.c



Hi all,

I'd like to call attention to a bug we have:
http://gnats.netbsd.org/55386

At some point Firefox added support for running on multiple OS
processes. To do this, it uses a process-shared semaphores.

We used to not support them properly (rather: lied about supporting
them, but failed to implement in practice). This caused a different set
of issues in the past.

In NetBSD 9.x, thorpej implemented process-shared semaphores, but the
implementation is a bit weird to avoid breaking compatibility with the
struct choices done in the previous implementation.

It has one caveat remaining: it doesn't allow destroying a semaphore
from another process. This causes firefox to violently leak fds, and
eventually show corrupt output.


sys__ksem_destroy
...
                /* Cannot destroy if we did't create it. */
                KASSERT(fd == -1);
                KASSERT(ks->ks_pshared_proc != NULL);
                if (ks->ks_pshared_proc != curproc) {
                        error = EINVAL;
                        goto out;
                }

Most of the web is usable with bumping sysctl kern.maxfiles, but it
doesn't seem to bump RLIMIT_NOFILE, so a few websites still fail.
It might be worthwhile to bump MAXFILES anyway, it's somewhat long
overdue.

It would be nice if more people looked at this problem, because it is
getting very hard to work-around this issue in Firefox. Our previous
workaround (entirely disable multiprocess firefox) can't display
google.com(!).

Thanks.


Home | Main Index | Thread Index | Old Index