Don't autosuggest invalid commands #6

Closed
ridiculousfish opened this Issue May 16, 2012 · 1 comment

Comments

Projects
None yet
2 participants
@ridiculousfish
Member

ridiculousfish commented May 16, 2012

If you type a command that's not valid at all, maybe we can avoid autosuggesting it. This could be handled by a "special" handler in highlight.cpp

@niemeyer niemeyer referenced this issue Jun 5, 2012

Closed

Segfault on ~ #34

DarkStarSword added a commit to DarkStarSword/fish-shell that referenced this issue Sep 10, 2012

Remove wperror causing pthreads weirdness
I'm not entirely sure what is going on, but on one machine I run fish on
a couple of times a day I find an instance of fish using 100% CPU.
Killing it never kills an interactive session, so it is presumably
something fish is doing in the background.

strace shows it repeatedly calling sys_FUTEX with an invalid op (0xef).
Since the op is invalid, the kernel returns -ENOSYS, but pthreads keeps
spinning hoping for success and uses 100% CPU.

The backtraces always look similar to:

> (gdb) bt
> #0  __lll_lock_wait () at ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:136
> #1  0x00007f9739351861 in pthread_rwlock_rdlock ()
>     at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S:120
> #2  0x00007f973884e778 in __dcigettext (domainname=<optimized out>, msgid1=0xef <Address 0xef out of bounds>,
>     msgid2=0x0, plural=-1, n=0, category=<optimized out>) at dcigettext.c:460
> #3  0x00007f97388a0ad8 in *__GI___strerror_r (errnum=5, buf=0x0, buflen=0) at _strerror.c:65
> #4  0x00007f97388a09de in strerror (errnum=951726048) at strerror.c:33
> #5  0x000000000050f15e in wperror(std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&) ()
> #6  0x00000000004cfd0b in do_builtin_io(char const*, char const*) ()
> #7  0x00000000004d1038 in exec(parser_t&, job_t*) ()
> #8  0x00000000004f1ed8 in parser_t::eval_job(tokenizer*) ()
> #9  0x00000000004f2629 in parser_t::eval(std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, io_
> #10 0x00000000004cfb9c in internal_exec_helper(parser_t&, wchar_t const*, block_type_t, io_chain_t&) ()
> #11 0x00000000004d07bc in exec(parser_t&, job_t*) ()
> #12 0x00000000004f1ed8 in parser_t::eval_job(tokenizer*) ()
> #13 0x00000000004f2629 in parser_t::eval(std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, io_
> #14 0x000000000051fac0 in event_fire_internal(event_t const*) ()
> #15 0x00000000005200c7 in event_fire(event_t*) ()
> #16 0x00000000004f8a5e in proc_fire_event(wchar_t const*, int, int, int) ()
> #17 0x000000000053ee7b in main ()

There is some weirdness here - in particular, the errnum passed to
strerror randomises (but is never sensible), the msgid1 is passed as
0xef (i.e. the same as the op passed to sys_FUTEX).

Until I better understand what is going on, remove the wperror call that
is present in every backtrace. I'll keep an eye on things and see if it
happens again.

Signed-off-by: Ian Munsie <darkstarsword@gmail.com>
@siteshwar

This comment has been minimized.

Show comment
Hide comment
@siteshwar

siteshwar Jan 5, 2013

Member

It was fixed here :

commit 05c721b
Author: Siteshwar Vashisht siteshwar@gmail.com
Date: Fri Jun 29 00:24:37 2012 +0530

Some improvements to validate commands suggested from history
Member

siteshwar commented Jan 5, 2013

It was fixed here :

commit 05c721b
Author: Siteshwar Vashisht siteshwar@gmail.com
Date: Fri Jun 29 00:24:37 2012 +0530

Some improvements to validate commands suggested from history

@siteshwar siteshwar closed this Jan 5, 2013

@extrowerk extrowerk referenced this issue Aug 21, 2016

Closed

Fish gives warning at start on Haiku #3317

2 of 2 tasks complete

mqudsi added a commit to mqudsi/fish-shell that referenced this issue Mar 12, 2018

Add gettext operator back to strings in tokenizer
This was purposely disabled as it causes a floating point exception immediately on run:

    Program received signal SIGFPE, Arithmetic exception.
    0x000000000056eae8 in std::__detail::_Mod_range_hashing::operator()(unsigned long, unsigned long) const ()
    (gdb) bt
    #0  0x000000000056eae8 in std::__detail::_Mod_range_hashing::operator()(unsigned long, unsigned long) const ()
    #1  0x00000000005bb4f1 in std::__detail::_Hash_code_base<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >, std::pair<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const, std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >, std::__detail::_Select1st, std::hash<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, true>::_M_bucket_index(std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, unsigned long, unsigned long) const ()
    #2  0x00000000005bb22a in std::_Hashtable<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >, std::pair<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const, std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >, std::allocator<std::pair<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const, std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > > >, std::__detail::_Select1st, std::equal_to<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >, std::hash<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::_M_bucket_index(std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, unsigned long) const ()
    #3  0x00000000005bb115 in std::__detail::_Map_base<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >, std::pair<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const, std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >, std::allocator<std::pair<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const, std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > > >, std::__detail::_Select1st, std::equal_to<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >, std::hash<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true>, true>::operator[](std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&) ()
    #4  0x00000000005af388 in std::unordered_map<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >, std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >, std::hash<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >, std::equal_to<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >, std::allocator<std::pair<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const, std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > > > >::operator[](std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&) ()
    #5  0x000000000067dc6b in wgettext[abi:cxx11](wchar_t const*) ()
    #6  0x0000000000551df7 in __cxx_global_var_init.1 ()
    #7  0x000000000055225e in _GLOBAL__sub_I_tokenizer.cpp ()
    #8  0x000000000069d45d in __libc_csu_init ()
    #9  0x00007ffffdc907bf in __libc_start_main (main=0x552500 <main>, argc=1, argv=0x7ffffffed298, init=0x69d410 <__libc_csu_init>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffffffed288) at ../csu/libc-start.c:247
    #10 0x0000000000552389 in _start ()
    (gdb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment