Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bottled emacs exit with SIGSEGV when use built-in rust-ts-mode #172249

Closed
4 tasks done
Moroshima opened this issue May 21, 2024 · 6 comments · Fixed by #172484
Closed
4 tasks done

bottled emacs exit with SIGSEGV when use built-in rust-ts-mode #172249

Moroshima opened this issue May 21, 2024 · 6 comments · Fixed by #172484
Labels
bug Reproducible Homebrew/homebrew-core bug

Comments

@Moroshima
Copy link

Moroshima commented May 21, 2024

brew gist-logs <formula> link OR brew config AND brew doctor output

$ brew config         
HOMEBREW_VERSION: 4.3.1
ORIGIN: https://mirrors.ustc.edu.cn/brew.git
HEAD: e0bc557e7b991cb23583679e1cf1c8a92b793aeb
Last commit: 21 hours ago
Core tap JSON: 21 May 04:16 UTC
Core cask tap JSON: 21 May 04:16 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_API_DOMAIN: https://mirrors.ustc.edu.cn/homebrew-bottles/api
HOMEBREW_BOTTLE_DOMAIN: https://mirrors.ustc.edu.cn/homebrew-bottles
HOMEBREW_BREW_GIT_REMOTE: https://mirrors.ustc.edu.cn/brew.git
HOMEBREW_CASK_OPTS: []
HOMEBREW_CORE_GIT_REMOTE: https://mirrors.ustc.edu.cn/homebrew-core.git
HOMEBREW_MAKE_JOBS: 8
all_proxy: socks5://127.0.0.1:7890
http_proxy: http://127.0.0.1:7890
https_proxy: http://127.0.0.1:7890
Homebrew Ruby: 3.3.1 => /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.1/bin/ruby
CPU: octa-core 64-bit arm_firestorm_icestorm
Clang: 15.0.0 build 1500
Git: 2.45.1 => /opt/homebrew/bin/git
Curl: 8.6.0 => /usr/bin/curl
macOS: 14.5-arm64
CLT: 15.3.0.0.1.1708646388
Xcode: 15.4
Rosetta 2: false

$ brew doctor
Your system is ready to brew.

Verification

  • My brew doctor output says Your system is ready to brew. and am still able to reproduce my issue.
  • I ran brew update and am still able to reproduce my issue.
  • I have resolved all warnings from brew doctor and that did not fix my problem.
  • I searched for recent similar issues at https://github.com/Homebrew/homebrew-core/issues?q=is%3Aissue and found no duplicates.

What were you trying to do (and why)?

I tried to use emacs write rust code with emacs built-in treesit rust-ts-mode.

What happened (include all command output)?

Emacs crashed with Fatal error 11: Segmentation fault.

What did you expect to happen?

Emacs works well.

Step-by-step reproduction instructions (by running brew commands)

brew install emacs
emacs

and then input M-x rus to enable rust-ts-mode, it will crash.

@Moroshima Moroshima added the bug Reproducible Homebrew/homebrew-core bug label May 21, 2024
@Moroshima Moroshima changed the title emacs exit with SIGSEGV when use built-in rust-ts-mode bottled emacs exit with SIGSEGV when use built-in rust-ts-mode May 21, 2024
@Moroshima
Copy link
Author

But use brew install --build-from-source emacs will not trigger the segmentation fault, maybe the new version of tree-sitter package broke the treesit support of emacs built with an older version of tree-sitter?

@Lucartas
Copy link

Yep,
tree-sitter/tree-sitter#3296

carlocab added a commit that referenced this issue May 22, 2024
Tree-sitter broke their ABI at some point. See
tree-sitter/tree-sitter#3296.

Closes #172249.
@carlocab
Copy link
Member

If there's a command-line/scriptable way to trigger the crash, we can add it to the emacs test block to avoid breakage like this in the future.

I'm not an emacs user, so suggestions welcome.

In the meantime, the rebuild I triggered in #172484 will fix this.

@Moroshima
Copy link
Author

It may be a bit difficult to reproduce the crash through a command-line or scriptable method. Tree-sitter can be used by many emacs major modes, but there is no generic way to test tree-sitter support.

The script below is just an example:

echo "(add-hook 'emacs-startup-hook 'rust-ts-mode)" >> ~/.emacs.d/init.el
emacs

I do not think this is a reliable way to trigger the crash.

@Moroshima
Copy link
Author

Sorry, I forgot to mention a crucial point: we need to first install the corresponding language grammar in Emacs, which appears to require an interactive process.

@carlocab
Copy link
Member

I think this should be fixed now by

brew update && brew upgrade emacs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Reproducible Homebrew/homebrew-core bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants