Giter VIP home page Giter VIP logo

Comments (16)

ilovezfs avatar ilovezfs commented on May 27, 2024 5

I've shipped Homebrew/homebrew-core#15393. If those using the Homebrew bottle want to test whether linking jemalloc statically has successfully worked around the problems, brew update && brew upgrade neovim

from homebrew-neovim.

javian avatar javian commented on May 27, 2024 2

@mhinz actually there is but there has to be a Formula to support that version. You can see a number of examples here https://github.com/Homebrew/homebrew-core/tree/master/Aliases pointing to aliases of different versions and the corresponding Formula would be in the Formula directory.

EDIT: I just had a conversation with @ilovezfs from the homebrew team and he suggested that the older jemalloc release would be included as a resource rather than creating a new Formula. This is something I would have to create for the submission of neovim into homebrew-core anyhow Homebrew/homebrew-core#14485 so I'll be taking a look at that soon.

from homebrew-neovim.

mhinz avatar mhinz commented on May 27, 2024 2

The current situation is intolerable.

Speaks anything against disabling jemalloc or using the bundled jemalloc (which is 4.5 currently) and dropping jemalloc as a formula requirement?

CC @equal-l2

from homebrew-neovim.

blueyed avatar blueyed commented on May 27, 2024 1

The Arch bug report refers to jemalloc/jemalloc#907 and jemalloc/jemalloc#908.

from homebrew-neovim.

ilovezfs avatar ilovezfs commented on May 27, 2024 1

It would be preferable to fix neovim so it works with the dylib. Otherwise, if we upgrade jemalloc neovim doesn't get the jemalloc upgrade unless someone, not CI, remembers to revision bump it. Static linkage is not really suitable for package management.

from homebrew-neovim.

mhinz avatar mhinz commented on May 27, 2024

jemalloc should probably be disabled for the time being. Random segfaults are not nice.

(I think there's no nice way to make depends_on take a specific version or version range.)

from homebrew-neovim.

justinmk avatar justinmk commented on May 27, 2024

New lib versions can break things. The versions we test against are what we support. In third-party/CMakeLists.txt we specify jemalloc 4.5.

see neovim/neovim#6895

from homebrew-neovim.

blueyed avatar blueyed commented on May 27, 2024

The versions we test against are what we support.

Can this be specified somehow, e.g. similar to requirements.txt / setup.py in Python? Although downstream might just ignore this still?!

from homebrew-neovim.

justinmk avatar justinmk commented on May 27, 2024

We could auto-generate something from third-party/CMakeLists.txt, if someone wants to write some cmake logic to do that.

from homebrew-neovim.

equal-l2 avatar equal-l2 commented on May 27, 2024

@mhinz
About using the bundled jemalloc, probably Homebrew doesn't like that way since they provides own jemalloc already.
You can use static library (cf. #204) to fix the problem if the situation is same as neovim/neovim#5681.

About disabling jemalloc, that's fine for me.

from homebrew-neovim.

justinmk avatar justinmk commented on May 27, 2024

Yes, static is required. @javian was that not part of the core formula?

from homebrew-neovim.

ilovezfs avatar ilovezfs commented on May 27, 2024
iMac-TMP:~ joe$ brew linkage neovim
System libraries:
  /usr/lib/libSystem.B.dylib
  /usr/lib/libiconv.2.dylib
  /usr/lib/libutil.dylib
Homebrew libraries:
  /usr/local/opt/gettext/lib/libintl.8.dylib (gettext)
  /usr/local/opt/jemalloc/lib/libjemalloc.2.dylib (jemalloc)
  /usr/local/opt/libtermkey/lib/libtermkey.1.dylib (libtermkey)
  /usr/local/opt/libuv/lib/libuv.1.dylib (libuv)
  /usr/local/opt/libvterm/lib/libvterm.0.dylib (libvterm)
  /usr/local/opt/msgpack/lib/libmsgpackc.2.dylib (msgpack)
  /usr/local/opt/unibilium/lib/libunibilium.0.dylib (unibilium)
iMac-TMP:~ joe$

It is using the dylib.

from homebrew-neovim.

equal-l2 avatar equal-l2 commented on May 27, 2024

@ilovezfs Is it fine to use static library like #204 ?

from homebrew-neovim.

javian avatar javian commented on May 27, 2024

I wasn't aware that I changed it from static to dynamic so it was never something I tackled when creating the core Formula. What I don't understand at the moment is the difference between the dynamic and static linking against jemalloc other than having the code inside of the executable instead of using a library file. As far as I could tell in the linked issues the library call prefix is different between the operating systems but is that the only issue or are there others ?

from homebrew-neovim.

equal-l2 avatar equal-l2 commented on May 27, 2024

the library call prefix is different between the operating systems

This was not the cause when I tested before. See #204.

from homebrew-neovim.

mhinz avatar mhinz commented on May 27, 2024

Okay. So there are two problems:

  1. The actual crashes should been fixed as of jemalloc 5.0.1. Neovim bundles with jemalloc 4.5.0 which should work just as well. Only 5.0.0 was affected, AFAIK.
  2. The freeze (e.g. with :reg) is most probably the fault of jemalloc/jemalloc#895. The issue mentions that only happens on macOS when linking dynamically. This is what the homebrew core formula does, though.

Therefore.. I think it's easiest to just disable jemalloc in the homebrew formula for now. Well, or like @jamessan suggested, disabling it from our cmake files.

For people who want to reproduce it from the repo:

$ brew install jemalloc
$ pkg-config --libs jemalloc
-L/usr/local/Cellar/jemalloc/5.0.1/lib -ljemalloc

$ git clone https://github.com/neovim/neovim.git
$ cd neovim
$ git checkout c07e144c8

$ make distclean
$ make DEPS_CMAKE_FLAGS=-DUSE_BUNDLED_JEMALLOC=OFF CMAKE_EXTRA_FLAGS=-DJEMALLOC_USE_STATIC=OFF

$ lldb build/bin/nvim
(lldb) run
< use :reg a few times until freeze then hit CTRL+C >
(lldb) bt all
Stacktrace
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
  * frame #0: 0x00007fffac269d96 libsystem_kernel.dylib`kevent + 10
    frame #1: 0x00000001002ddec3 nvim`uv__io_poll(loop=0x00000001003c0d88, timeout=4000) at kqueue.c:192 [opt]
    frame #2: 0x00000001002cd888 nvim`uv_run(loop=0x00000001003c0d88, mode=UV_RUN_ONCE) at core.c:359 [opt]
    frame #3: 0x00000001000b849e nvim`loop_poll_events(loop=0x00000001003c0d88, ms=4000) at loop.c:52
    frame #4: 0x00000001001d9167 nvim`input_poll(ms=4000) at input.c:349
    frame #5: 0x00000001001d8120 nvim`inbuf_poll(ms=4000) at input.c:372
    frame #6: 0x00000001001d7ff5 nvim`os_inchar(buf="", maxlen=48, ms=-1, tb_change_cnt=0) at input.c:110
    frame #7: 0x0000000100186787 nvim`get_keystroke at misc1.c:2328
    frame #8: 0x000000010017c02d nvim`do_more_prompt(typed_char=0) at message.c:2106
    frame #9: 0x000000010017e300 nvim`msg_puts_display(str="\n\"/   ", maxlen=-1, attr=0, recurse=0) at message.c:1720
    frame #10: 0x000000010017cf80 nvim`msg_puts_attr_len(str="\n\"/   ", len=-1, attr=0) at message.c:1627
    frame #11: 0x000000010017c9d5 nvim`msg_puts_attr(s="\n\"/   ", attr=0) at message.c:1584
    frame #12: 0x000000010017be37 nvim`msg_puts(s="\n\"/   ") at message.c:1547
    frame #13: 0x00000001001b6f4b nvim`ex_display(eap=0x00007fff5fbfe520) at ops.c:3412
    frame #14: 0x00000001000dd542 nvim`do_one_cmd(cmdlinep=0x00007fff5fbfe8f8, flags=0, cstack=0x00007fff5fbfe900, fgetline=(nvim`getexline at ex_getln.c:1950), cookie=0x0000000000000000) at ex_docmd.c:2241
    frame #15: 0x00000001000d94fc nvim`do_cmdline(cmdline=0x0000000000000000, fgetline=(nvim`getexline at ex_getln.c:1950), cookie=0x0000000000000000, flags=0) at ex_docmd.c:607
    frame #16: 0x00000001001a0eb6 nvim`nv_colon(cap=0x00007fff5fbfef58) at normal.c:4498
    frame #17: 0x000000010019ec30 nvim`normal_execute(state=0x00007fff5fbfeeb8, key=58) at normal.c:1137
    frame #18: 0x0000000100283cdb nvim`state_enter(s=0x00007fff5fbfeeb8) at state.c:61
    frame #19: 0x0000000100196807 nvim`normal_enter(cmdwin=false, noexmode=false) at normal.c:467
    frame #20: 0x0000000100153b5a nvim`main(argc=1, argv=0x00007fff5fbff180) at main.c:554
    frame #21: 0x00007fffac13a235 libdyld.dylib`start + 1

  thread #2
    frame #0: 0x00007fffac26931e libsystem_kernel.dylib`__ulock_wait + 10
    frame #1: 0x00007fffac34caff libsystem_platform.dylib`_os_ulock_wait + 25
    frame #2: 0x00007fffac34c3d2 libsystem_platform.dylib`_os_unfair_lock_lock_slow + 130
    frame #3: 0x00000000000462a9 libjemalloc.2.dylib`je_malloc_mutex_lock_slow + 153
    frame #4: 0x000000000004edd2 libjemalloc.2.dylib`je_tcache_bin_flush_small + 676
    frame #5: 0x0000000000023126 libjemalloc.2.dylib`free + 773
    frame #6: 0x0000000000052090 libjemalloc.2.dylib`zone_free_definite_size + 168
    frame #7: 0x00000001001740f5 nvim`xfree(ptr=0x0000000001a2f0c0) at memory.c:133
    frame #8: 0x00000001000b9488 nvim`multiqueueitem_get_event(item=0x0000000001ae1a40, remove=true) at multiqueue.c:205
    frame #9: 0x00000001000b8eae nvim`multiqueue_remove(this=0x00000000019d9030) at multiqueue.c:220
    frame #10: 0x00000001000b9176 nvim`multiqueue_process_events(this=0x00000000019d9030) at multiqueue.c:148
    frame #11: 0x00000001000b84e3 nvim`loop_poll_events(loop=0x000070000ec9c7d0, ms=-1) at loop.c:59
    frame #12: 0x00000001002a9885 nvim`tui_main(bridge=0x00000000015ebf80, ui=0x00000000002cf500) at tui.c:286
    frame #13: 0x00000001002b15cb nvim`ui_thread_run(data=0x00000000015ebf80) at ui_bridge.c:124
    frame #14: 0x00007fffac35393b libsystem_pthread.dylib`_pthread_body + 180
    frame #15: 0x00007fffac353887 libsystem_pthread.dylib`_pthread_start + 286
    frame #16: 0x00007fffac35308d libsystem_pthread.dylib`thread_start + 13

from homebrew-neovim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.