mawww / kakoune

mawww's experiment for a better code editor
http://kakoune.org
The Unlicense
9.99k stars 715 forks source link

[BUG] Selecting a regex doesn't work sometimes #5127

Closed schragge closed 8 months ago

schragge commented 8 months ago

Version of Kakoune

v2023.08.05-258-gdbe85282

Reproducer

  1. Try iaaa<esc>bsa<ret>

  2. When selecting digits, zero (0) doesn't get selected:

    i0123<esc>xs\d<ret>

Introduced with https://github.com/mawww/kakoune/commit/ca7471c25d3e0f8dbe48bfec7f6c9af1cb6b34ae

Outcome

1st example: error message nothing selected.

2nd example: zero isn't selected, but other digits are.

Expectations

1st example: each letter a has to be selected.

2nd example: zero is a digit and has to be selected by \d.

Additional information

Debian 12 (bookworm)

$ dpkg-query -W libstdc++6
libstdc++6:amd64    12.2.0-14
$ c++ -v
Using built-in specs.
COLLECT_GCC=g++.real
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/12/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 12.2.0-14' --with-bugurl=file:///usr/share/doc/gcc-12/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-12 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --enable-cet --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-12-bTRWOB/gcc-12-12.2.0/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-12-bTRWOB/gcc-12-12.2.0/debian/tmp-gcn/usr --enable-offload-defaulted --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.2.0 (Debian 12.2.0-14)
mawww commented 8 months ago

I do not manage to reproduce this here, does that happen on kak -n as well ?

schragge commented 8 months ago

Yep. Actually, "sometimes" is an understatement. "Half of the time" would be more appropriate. This is a massive regression. About a half of included VimGolf challenges are now failing on me. And golf.sh uses kak -n. golf

At least, when starting with kak -n, I'm not getting any errors from kakrc. Otherwise, when just starting kak I'm getting the message

error during startup, see `:buffer *debug*` for details

The contents of *debug* are

*** This is the debug buffer, where debug info will be written ***
shell stderr: <<<
find: ‘/colors’: No such file or directory
>>>
/home/sero/.local/share/kak/kakrc:No such colorscheme default.kak
error while parsing kakrc:
    No such colorscheme default.kak

make check gives a lot of errors and then gets stuck after test/./shell/quoted-range when performing

./run test/./tools/git/blame-in-diff

probably because I don't have a run command in the PATH. I'm attaching the results of running tests w/o test/tools/git. test-results.gz

arrufat commented 8 months ago

I've just ran ./golf.sh and only one challenge failed (latest Kakoune from master on an up-to-date Arch)

As for the i0123<esc>xs\d<ret>, I also can't reproduce :(

schragge commented 8 months ago

@arrufat. Yes, this is how it is supposed to be. The only failed challenge should be The D a n k Side of the Moon. Not because of a bug, but because of a recent change in Kakoune behavior. Unfortunately, I'm having it much worse now.

mawww commented 8 months ago

I've tried running in valgrind which does not raise any issues, anything special about your setup ?

schragge commented 8 months ago

Your comment made me think, and I found the culprit: ccache.

$ dpkg-query -W ccache
ccache  4.8+really4.7.5-1

Disabling it and rebuilding Kakoune with make -B made the errors go away.

Should I close the issue or you'll do it?

mawww commented 8 months ago

Its weird the ccache would have failed there, I wonder if there is something in the build system that breaks it, but I have ccache enabled at work and never had issues with building Kakoune there.