Giter Club home page Giter Club logo

Comments (5)

city41 avatar city41 commented on August 19, 2024 1

Woohoo! Thanks @bryphe! I'll pick up the latest and get this into my project.

from libvim.

city41 avatar city41 commented on August 19, 2024

I am debugging into vim_regcomp to see if I can track down the issue

from libvim.

city41 avatar city41 commented on August 19, 2024

vim_regcomp's signature is regprog_T * vim_regcomp(char_u *expr_arg, int re_flags)

and adding printf("expr_arg: %s\n", expr_arg); as the first line of the function causes the stack trace to start from printf. Since the error says heap-use-after-free and the test does vimKey("<esc>"), I believe what might be happening it is using the same char pointer for the search pattern, but it was freed due to pressing esc.

from libvim.

city41 avatar city41 commented on August 19, 2024

I worked around this by keeping track of whether search is active or not before calling vimSearchGetHighlights. I am pretty sure the issue is using the pointer to the search pattern after it was freed. But fixing this seems difficult. vim copies this pointer to several places and keeping track of it is not easy.

I think vimSearchGetHighlights and vimSearchGetPattern are both potentially unsafe due to this.

from libvim.

bryphe avatar bryphe commented on August 19, 2024

Awesome @city41 ! Let me know if you find any more issues - thanks again for the great repro 👍

from libvim.

Related Issues (12)

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.