Open autarch opened 1 year ago
For the sample in this comment, here tree-sitter parse
yields:
tree-sitter: /tmp/tree-sitter-markdown.ikatyang/src/./tree_sitter_markdown/inline_delimiter.cc:240: void tree_sitter_markdown::InlineDelimiterList::transfer_to(tree_sitter_markdown::MinimizedInlineDelimiterList&): Assertion `inl_dlm.sym() == SYM_EXT_AUT_LNK_BGN || inl_dlm.sym() == SYM_EXT_AUT_LNK_CTN' failed.
Aborted (core dumped)
For the sample in this comment, here tree-sitter parse
yields:
tree-sitter: /tmp/tree-sitter-markdown.ikatyang/src/./tree_sitter_markdown/inline_delimiter.cc:240: void tree_sitter_markdown::InlineDelimiterList::transfer_to(tree_sitter_markdown::MinimizedInlineDelimiterList&): Assertion `inl_dlm.sym() == SYM_EXT_AUT_LNK_BGN || inl_dlm.sym() == SYM_EXT_AUT_LNK_CTN' failed.
Aborted (core dumped)
Output looks the same to me, though the input files appear to differ.
This is using ikatyang's markdown grammar at commit 8b8b77af and the tree-sitter cli commit is 524bf7e2.
It appears to be caused by table-long dash-lines in tables -- this example crashes emacs with the following backtrace (using the version available at commit 69fa82c76fc25b30fc0528291423002dd18a89e5 of elisp-tree-sitter
As the assertion seems to come from https://github.com/ikatyang/tree-sitter-markdown/, it probably requires a fix there. It does not seem to be related to https://github.com/ikatyang/tree-sitter-markdown/issues/59 or https://github.com/ikatyang/tree-sitter-markdown/issues/57, I'll open a new issue there.
emacs: src/./tree_sitter_markdown/inline_delimiter.cc:240: void tree_sitter_markdown::InlineDelimiterList::transfer_to(tree_sitter_markdown::MinimizedInlineDelimiterList&): Assertiva “inl_dlm.sym() == SYM_EXT_AUT_LNK_BGN || inl_dlm.sym() == SYM_EXT_AUT_LNK_CTN” falhou.
Fatal error 6: Aborted
Backtrace:
emacs[0x52d3ab]
emacs[0x4222ff]
emacs[0x422801]
emacs[0x52ba08]
emacs[0x52bae9]
/lib64/libc.so.6(+0x3db70)[0x7fc622290b70]
/lib64/libc.so.6(+0x8e844)[0x7fc6222e1844]
/lib64/libc.so.6(gsignal+0x1e)[0x7fc622290abe]
/lib64/libc.so.6(abort+0xdf)[0x7fc62227987f]
/lib64/libc.so.6(+0x2679b)[0x7fc62227979b]
/lib64/libc.so.6(+0x36147)[0x7fc622289147]
/home/kassick/.emacs.d/elpa/29.1/develop/tree-sitter-langs-20230910.547/bin/markdown.so(_ZN20tree_sitter_markdown19InlineDelimiterList11transfer_toERNS_28MinimizedInlineDelimiterListE+0x16e)[0x7fc5b06e0c9e]
/home/kassick/.emacs.d/elpa/29.1/develop/tree-sitter-langs-20230910.547/bin/markdown.so(tree_sitter_markdown_external_scanner_scan+0x841)[0x7fc5b071eb51]
/home/kassick/.emacs.d/elpa/29.1/develop/tsc-20230916.113114/tsc-dyn.so(+0x14da92)[0x7fc5c614da92]
/home/kassick/.emacs.d/elpa/29.1/develop/tsc-20230916.113114/tsc-dyn.so(+0x12d0d1)[0x7fc5c612d0d1]
/home/kassick/.emacs.d/elpa/29.1/develop/tsc-20230916.113114/tsc-dyn.so(+0x128a6a)[0x7fc5c6128a6a]
/home/kassick/.emacs.d/elpa/29.1/develop/tsc-20230916.113114/tsc-dyn.so(+0x12d526)[0x7fc5c612d526]
emacs[0x5d2172]
emacs[0x5e148e]
emacs[0x5994e6]
emacs[0x5995a9]
emacs[0x59841c]
emacs[0x598629]
emacs[0x5994e6]
/usr/local/bin/../lib/emacs/29.1.50/native-lisp/29.1.50-a92a42e2/preloaded/subr-13adf6a6-8f3898dc.eln(F72756e2d6d6f64652d686f6f6b73_run_mode_hooks_0+0x389)[0x7fc61f65fd09]
emacs[0x5994e6]
/usr/local/bin/../lib/emacs/29.1.50/native-lisp/29.1.50-a92a42e2/preloaded/elisp-mode-90dbfe40-2f48c113.eln(F656d6163732d6c6973702d6d6f6465_emacs_lisp_mode_0+0x62c)[0x7fc61f246a7c]
emacs[0x5e1450]
emacs[0x5e3c8b]
emacs[0x59d020]
emacs[0x59d5d8]
emacs[0x59cf07]
emacs[0x59f4d6]
/home/kassick/.emacs.d/eln-cache/29.1.50-a92a42e2/yasnippet-1427ec8a-8df7bbfb.eln(top_level_run+0xaf58)[0x7fc5b080c6c3]
emacs[0x5ec8e8]
emacs[0x5ecd73]
emacs[0x5cb863]
emacs[0x5cc0b8]
emacs[0x5991c1]
emacs[0x59b5a2]
emacs[0x59c975]
...
The following extract from the first sample was enough to cause the error for me:
| Key | Type | Required? | Description | | --------- | ---------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `exclude` | array of strings | no | Each array member is a pattern that will be matched against potential files when `precious` is run. These patterns are matched in the same way as patterns in a [gitignore file](https://git-scm.com/docs/gitignore#_pattern_format).
You can use lines starting with a `!` to negate the meaning of previous rules in the list, so that anything that matches is _not_ excluded even if it matches previous rules. |
Thanks for digging into this and reporting it to the right place. Does it make sense to leave this issue open until upstream fixes it? I'm assuming that elisp-tree-sitter
would need to update the version of tree-sitter-markdown
it pulls in.
Leaving the issue open seems good to me.
I see this on Emacs 30.0.5 using tree-sitter with https://github.com/ikatyang/tree-sitter-markdown and my crash is also on tables. I'm using the built-in tree-sitter in Emacs 30, not this library directly, but this issue is the best place with examples + root cause, so tossing my example README file in here:
I've seen this crash in both Emacs 27 & 28, with the packages tree-sitter@3cfab8a0e945db9b3df84437f27945746a43cc71 and tree-sitter-langs@d8f8ac4faeb4564fbb61e94a631b4672523d84a9
If I run
emacs --debug
from the CLI I see this when it crashes:The file in question is attached to this issue.
README.md