Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 586248 - app-editors/neovim merging hangs while generating helptags
Summary: app-editors/neovim merging hangs while generating helptags
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal with 1 vote (vote)
Assignee: Vim Maintainers
URL: https://github.com/neovim/neovim/issu...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-18 02:46 UTC by anoteros
Modified: 2018-01-15 11:50 UTC (History)
13 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description anoteros 2016-06-18 02:46:21 UTC
Merging app-edits/neovim hangs permanently while generating helptags. All versions in the portage tree are affected, including the live ebuild. However, building directly from neovim/neovim git repo works fine.

The command causing the hang is "nvim -u NONE -i NONE -e --headless -c helptags ++t . -c quit"

More info can be found at https://github.com/neovim/neovim/issues/4920
Comment 1 anoteros 2016-06-20 14:27:11 UTC
It seems to build find with USE="-jemalloc"
Comment 2 Marcin Kowalski 2016-06-21 13:55:07 UTC
hitting the same thing. I'll try the workaround.
Comment 3 Marcin Kowalski 2016-06-21 13:56:17 UTC
yes, confirming the workaround on my end.
Comment 4 nvinson234 2016-06-22 13:25:15 UTC
The issue is with libsandbox and libjemalloc.  In short, when jemalloc during jemalloc initialization, jemalloc calls open("/proc/vm/overcommit_memory").  The open call is caught by sandbox.  Sandbox calls dlvsym() to find the real open() function.  dlvsym() calls calloc(), which is jemalloc's calloc(), and calloc(), begins executing (at least part of) jemalloc()'s initialization again.  Finally, the initialization deadlocks because jemalloc was already initializing.

I'm not sure what the fix for this would be, but one idea is to re-implement dl*sym() in sandbox, so these types of problems don't occur.
Comment 5 nvinson234 2016-06-22 14:27:34 UTC
Just wanted to add that Gentoo has seen this before with firefox.  Here's that bug URL: https://bugzilla.mozilla.org/show_bug.cgi?id=435683

It looks like Mozilla fixed their issue by patching jemalloc.
Comment 6 Maxim Koltsov gentoo-dev 2016-07-03 08:26:39 UTC
I can confirm the bug and workaround.
@mozilla, maybe we should fix jemalloc in portage?
Comment 7 Greg Turner 2016-08-22 21:12:57 UTC
The workaround I've used is to create /etc/portage/env/nosandbox like so:

  FEATURES="${FEATURES} -sandbox -usersandbox"

and then activate this for affected packages, by adding lines like so to /etc/portage/package.env:

  app-editors/neovim nosandbox


Perhaps, like me, some folks will find this slightly less distasteful than opting not to use jemalloc; I guess it might depend on how important paranoia is in your schedule of priorities*.


* If you are truly paranoid, you should probably not be /relying/ on the sandbox feature but using it as a failsafe. It's not even a real sandbox, unless you activate the experimental namespaces feature, and even then, it's not really designed to be an impenetrable security barrier, but more of a QA/bug-catcher mechanism.
Comment 8 Bearcat M. Sandor 2017-01-20 07:50:52 UTC
I can confirm that Greg's fix works well. 

Thank you Greg!
Comment 9 Jory A. Pratt gentoo-dev 2017-08-26 17:56:10 UTC
If you feel I have closed your bug and it is still a current issue, please reopen and update it completely. We will not work bugs that have no ebuild in tree any longer or can not be reproduced with a current system.

Thank You for your support and understanding
The Mozilla Team
Comment 10 Ian Stakenvicius gentoo-dev 2017-09-02 21:37:15 UTC
still happens, reopening.  workaround isn't a real fix.
Comment 11 Greg Turner 2017-09-02 22:39:23 UTC
(In reply to Ian Stakenvicius from comment #10)
> still happens, reopening.  workaround isn't a real fix.

Fully agreed.  Indeed, "turn off jemalloc helps" is not even a diagnosis, and I see no clear evidence this has to be a bug in jemalloc .. i.e.: it could be a sandbox bug, for example, or the obvious thing: a neovim bug.
Comment 12 Matthew Marchese Gentoo Infrastructure gentoo-dev 2017-11-15 00:21:10 UTC
USE="-jemalloc" worked for me.