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

Crash when rendering certain SQL files #9550

Closed
paholg opened this issue Feb 6, 2024 · 7 comments · Fixed by #9634
Closed

Crash when rendering certain SQL files #9550

paholg opened this issue Feb 6, 2024 · 7 comments · Fixed by #9634
Labels
A-language-support Area: Support for programming/text languages C-bug Category: This is a bug

Comments

@paholg
Copy link

paholg commented Feb 6, 2024

Summary

Helix crashes with a "buffer overflow detected" when rendering certain SQL files. This happens on the latest master, but was not an issue in the previous version of helix I was using, which is a custom branch based off of commit c0fd8bc61b4c1611a48312938aaf0e3121f393b1 from September 6th.

Reproduction Steps

I created a directory with the following sql file:

CREATE OR REPLACE FUNCTION trigger_updated_at ()
    RETURNS TRIGGER
    AS $$
BEGIN
    NEW.updated_at = NOW();
    RETURN NEW;
END;
$$
LANGUAGE plpgsql;

I opened hx in this directory, and opened the file picker. As soon as that sql file was highlighted, helix crashed:
2024-02-06-073046-s

Helix log

No log entries are created.

Platform

Linux ubuntu 6.2.0-39-generic #40~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Nov 16 10:53:04 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

Terminal Emulator

alacritty 0.13.1

Installation Method

compiled nix flake from master

Helix Version

helix 23.10 -- commit 5c567f3

@paholg paholg added the C-bug Category: This is a bug label Feb 6, 2024
@pascalkuthe
Copy link
Member

pascalkuthe commented Feb 6, 2024

This looks like an issue with the grammar. The SQL grammar has caused problems before. You would need to report this upstream to get that fixed (or maybe just updating the grammar could be enough)

@David-Else
Copy link
Contributor

I couldn't reproduce it with Helix master.... mmm.

Regardless, I think we should update to https://github.com/DerekStride/tree-sitter-sql/releases/tag/v0.2.0 as there has been a lot of activity since the last Oct 4th Helix version, that was a pre-release version, first release version was v0.1.0 Nov 17, 2023.

@ds-cbo Do you feel like updating tree-sitter-sql again?

@paholg
Copy link
Author

paholg commented Feb 6, 2024

Hm, I just tried again with an updated master, and it still crashes. I'd be happy to do anything else if it helps reproduce or figure out what's going wrong.

But if you just want to update tree-sitter-sql, I'd be happy to just try again when that's done.

@the-mikedavis
Copy link
Member

I can reproduce this and updating to the latest tree-sitter-sql revision fixes it

@the-mikedavis the-mikedavis added the A-language-support Area: Support for programming/text languages label Feb 7, 2024
@ds-cbo
Copy link
Contributor

ds-cbo commented Feb 13, 2024

@David-Else I'll gladly bump it again if that's still necessary

@David-Else
Copy link
Contributor

@ds-cbo Awesome! It seems the bump is needed to avoid this crash. I am afraid I don't have the knowledge needed for making any new new queries if they are required.

@ds-cbo
Copy link
Contributor

ds-cbo commented Feb 14, 2024

I've found some oddities upstream while bumping: DerekStride/tree-sitter-sql#239

Play stay tuned while I resolve those first, otherwise I might be bumping again in a few days 😛

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-language-support Area: Support for programming/text languages C-bug Category: This is a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants