Giter Site home page Giter Site logo

Segfault on autocomplete about gf HOT 11 CLOSED

nakst avatar nakst commented on July 18, 2024
Segfault on autocomplete

from gf.

Comments (11)

nakst avatar nakst commented on July 18, 2024

What happens if you replace line 436 in gf2.cpp
from pthread_cond_timedwait(&evaluateEvent, &evaluateMutex, &timeout);
to pthread_cond_wait(&evaluateEvent, &evaluateMutex);
?

from gf.

aolo2 avatar aolo2 commented on July 18, 2024

It hangs intead of segfaulting if I do that.

from gf.

nakst avatar nakst commented on July 18, 2024

If you uncomment line 420, what is the output?

from gf.

aolo2 avatar aolo2 commented on July 18, 2024

sending: complete file Doc

from gf.

nakst avatar nakst commented on July 18, 2024

And if you run that command manually in GDB what is the full output?

The only thing I could think that could be broken is that the GDB prompt has been changed to something other than (gdb) so gf doesn't detect when the command has completed.

from gf.

aolo2 avatar aolo2 commented on July 18, 2024

Oooh, that must be it! I have a completely different .gdbinit file on the laptop. Will be able to confirm after work today

from gf.

nakst avatar nakst commented on July 18, 2024

See if it works on the latest commit.

from gf.

aolo2 avatar aolo2 commented on July 18, 2024

Sorry for the late response. The latest commit still crashes, BUT renaming .gdbinit fixed it. I guess some other gdb response has changed, because the config is quite extensive (I was using this: https://github.com/cyrus-and/gdb-dashboard before switching to gf).

I think such behaviour is to be expected, considering gf chooses to parse gdbs text response instead of MI.

Considering this issue, I think it'd be best if gf laucnhed gdb with -nx, and only passed arguments from the gf2_config.ini. I think we already discussed something similar in one of the older issues.

from gf.

nakst avatar nakst commented on July 18, 2024

Could you get a stack trace of the crash? It might not be worth fixing it, but I think it's best to check what's going wrong.

from gf.

aolo2 avatar aolo2 commented on July 18, 2024

Sure. I compiled 783d310 with -O0 -g -fsanitize=address, and lauched gf with this in my .gdbinit: https://gist.github.com/aolo2/ff71d45a25404f0eed7c8f80d11ecd81.

Here's the stack trace:

==7411==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7f721bb1a9d3 bp 0x7ffe4e5b3510 sp 0x7ffe4e5b2c88 T0)
==7411==The signal is caused by a READ memory access.
==7411==Hint: address points to the zero page.
    #0 0x7f721bb1a9d2  (/lib/x86_64-linux-gnu/libc.so.6+0x9c9d2)
    #1 0x7f721c20742c  (/usr/lib/x86_64-linux-gnu/libasan.so.5+0x7142c)
    #2 0x557b60d7c29a in TabCompleterRun(TabCompleter*, UITextbox*, bool, bool) /home/aolo2/Documents/BIN/gf/gf2.cpp:617
    #3 0x557b60d82574 in TextboxInputMessage(UIElement*, UIMessage, int, void*) /home/aolo2/Documents/BIN/gf/windows.cpp:589
    #4 0x557b60d51b3d in UIElementMessage /home/aolo2/Documents/BIN/gf/luigi.h:1358
    #5 0x557b60d72472 in _UIWindowInputEvent /home/aolo2/Documents/BIN/gf/luigi.h:3934
    #6 0x557b60d77631 in _UIProcessEvent /home/aolo2/Documents/BIN/gf/luigi.h:4491
    #7 0x557b60d78188 in _UIMessageLoopSingle /home/aolo2/Documents/BIN/gf/luigi.h:4555
    #8 0x557b60d73604 in UIMessageLoop /home/aolo2/Documents/BIN/gf/luigi.h:4189
    #9 0x557b60d92ea6 in main /home/aolo2/Documents/BIN/gf/gf2.cpp:1299
    #10 0x7f721baa4e0a in __libc_start_main ../csu/libc-start.c:308
    #11 0x557b60d4b929 in _start (/home/aolo2/Documents/BIN/gf/gf2+0xc929)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (/lib/x86_64-linux-gnu/libc.so.6+0x9c9d2)
==7411==ABORTING

from gf.

nakst avatar nakst commented on July 18, 2024

c3ef490 should sort this out.

from gf.

Related Issues (20)

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.