tree-sitter / tree-sitter-html

HTML grammar for Tree-sitter
MIT License
136 stars 72 forks source link

SIGSEV error during parsing html #101

Closed ReyPJ closed 5 months ago

ReyPJ commented 5 months ago

So I was using nvim without problems but when I opened a HTML file neovim crash, I ran a coredumpctl, and the backtrace indicates that the error occurred during a memory free operation, related to the external scanner of Tree-sitter for HTML, I already try to uninstall and reinstall the parser and in :checkhealt nvim-treesitter the HTML parser is OK

checkheatl outpo:

`nvim-treesitter: require("nvim-treesitter.health").check()

Installation ~

OS Info: { machine = "x86_64", release = "6.6.32-1-MANJARO", sysname = "Linux", version = "#1 SMP PREEMPT_DYNAMIC Mon May 27 03:41:25 UTC 2024" } ~

Parser/Features H L F I J

I already uninstall de parser and installed it again

amaanq commented 5 months ago

guaranteed you're using an older parser version, ensure you're using it built from the latest version

TarunDaCoder commented 5 months ago

Hey, I have also encountered this error, but when I do :TSUpdate it shows All parsers are up-to-date! I have a video of it happening here https://github.com/nvim-treesitter/nvim-treesitter/issues/6730

muriware commented 5 months ago

@amaanq, I'm running into the same issue.

:TSUpdate html shows that Parsers are up-to-date!

When it crashes, it prints on the screen:

nvim(77752,0x119e07600) malloc: *** error for object 0x6d69766f656e2f72: pointer being freed was not allocated nvim(77752,0x119e07600) malloc: *** set a breakpoint in malloc_error_break to debug

It only happens with the HTML parser installed.

When the parser is uninstalled, nvim no longer crashes on HTML files.

TarunDaCoder commented 5 months ago

@amaanq, I'm running into the same issue.

:TSUpdate html shows that Parsers are up-to-date!

When it crashes, it prints on the screen:

nvim(77752,0x119e07600) malloc: *** error for object 0x6d69766f656e2f72: pointer being freed was not allocated nvim(77752,0x119e07600) malloc: *** set a breakpoint in malloc_error_break to debug

It only happens with the HTML parser installed.

When the parser is uninstalled, nvim no longer crashes on HTML files.

I solved this by building the HTML parser from source

muriware commented 5 months ago

@TarunDaCoder, I caught that from your open issue #6730 on nvim-treesitter.

I think a better solution would be to delete the entire nvim cache directory, as this issue could have been caused by corrupted nvim cache files. Then reinstall all plugins, and allow nvim to recreate any necessary cache files when it runs.