Skip to content

Several completion/globbing tests SIGSEGV on i386 #10944

Closed
@nc7s

Description

@nc7s

This is the problem reported in #10633 for 4.0b1, that fish segfaults in tests related to globs on i386.

My development/packaging setup:

  • host: Debian unstable, current, amd64
  • build: chroot, sbuild, unshare mode, i386
  • rustc: Debian shipped rustc package
  • CPU: Intel i7-9750H, x86_64

Failed tests (see log for output of each test):

The following tests FAILED:
	 27 - complete.fish (Failed)
	 62 - glob.fish (Failed)
	146 - wildcard.fish (Failed)
	185 - wildcard_tab.py (Failed)

With the offending test taken out as a separate .fish script (from tests/checks/complete.fish, CHECK at line 359), running it as build/fish t.fish will always SIGSEGV. The core dump shows:

Core was generated by `./obj-i686-linux-gnu/fish --debug complete --debug-output ../debug-output ddd.f'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x5675a447 in fish::wildcard::expander::WildCardExpander::expand ()
[Current thread is 1 (Thread 0xf7a63980 (LWP 18127))]
(gdb) bt
#0  0x5675a447 in fish::wildcard::expander::WildCardExpander::expand ()
#1  0x567592db in fish::expand::Expander::stage_wildcards ()
#2  0x567570f2 in fish::expand::expand_to_receiver ()
#3  0x567cb43b in fish::complete::Completer::complete_cmd ()
#4  0x567c0f0d in fish::complete::complete ()
#5  0x5671fc65 in fish::builtins::complete::complete ()
#6  0x566f181f in fish::exec::exec_process_in_job ()
#7  0x566d9af7 in fish::exec::exec_job ()
(...)

Then I went the good ol' way: sprinkling eprintln! across the code.

With -DCMAKE_BUILD_TYPE=Debug, the test somehow passed:

::wildcard::expander::WildCardExpander::expand(base_dir = "", wc = "__test6_", effective_prefix = "")
::wildcard::expander::WildCardExpander::expand(base_dir = "", wc = "__test6_", effective_prefix = "")
::wildcard::expander::WildCardExpander::expand(base_dir = "", wc = "__test6_", effective_prefix = "")
::wildcard::expander::WildCardExpander::expand(base_dir = "", wc = "__test6_", effective_prefix = "")
::wildcard::expander::WildCardExpander::expand(base_dir = "", wc = "__test6_", effective_prefix = "")
::wildcard::expander::WildCardExpander::expand(base_dir = "", wc = "__test6_", effective_prefix = "")
::wildcard::expander::WildCardExpander::expand(base_dir = "", wc = "__test6_", effective_prefix = "")
::wildcard::expander::WildCardExpander::expand(base_dir = "", wc = "__test6_", effective_prefix = "")
::wildcard::expander::WildCardExpander::expand(base_dir = "", wc = "__test6_", effective_prefix = "")
::wildcard::expander::WildCardExpander::expand(base_dir = "", wc = "__test6_", effective_prefix = "")
Command completion with parened PATHs test passed

With =RelWithDebInfo, though, it eprinted the same result, but failed with the same output as in Debian builds (or lack of, that is).

This method seems to recurse a lot. On i386 it recursed 10 times. On amd64 it recursed 14 times, though passing the test. In other tests it recurses even more.

This looks like an under-optimized recursion to me, but I don't really know much about this part.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions