Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SIGSEGV when running an executable with non-existent dynamic interpreter #10265

Closed
yshui opened this issue Jan 26, 2024 · 2 comments
Closed

SIGSEGV when running an executable with non-existent dynamic interpreter #10265

yshui opened this issue Jan 26, 2024 · 2 comments

Comments

@yshui
Copy link

yshui commented Jan 26, 2024

fish version: 3.7.0

normally, running such an executable will give you "ENONET". other shells, e.g. bash will report it as:

bash: ./a.out: cannot execute: required file not found

but in fish I get:

fish: Job 1, './a.out' terminated by signal SIGSEGV (Address boundary error)

To test, you can create an executable with invalid interpreter like this:

echo 'int main() {}' > a.c
gcc a.c -Wl,--dynamic-linker -Wl,/non-existent
./a.out
@yshui
Copy link
Author

yshui commented Jan 26, 2024

stack trace of fish:

(gdb) bt
#0  0x00007ffff7ad86dc in __strlen_evex () from /nix/store/p3jshbwxiwifm1py0yq544fmdyy98j8a-glibc-2.38-27/lib/libc.so.6
#1  0x0000000000575e0c in safe_report_exec_error(int, char const*, char const* const*, char const* const*) ()
#2  0x000000000055306f in exec_process_in_job(parser_t&, process_t*, std::shared_ptr<job_t> const&, io_chain_t const&, autoclose_pipes_t, autoclose_pipes_t const&, bool) ()
#3  0x00000000005535aa in exec_job(parser_t&, std::shared_ptr<job_t> const&, io_chain_t const&) ()
#4  0x0000000000570639 in parse_execution_context_t::run_1_job(ast::job_t const&, block_t const*) [clone .part.0] ()
#5  0x000000000057109f in parse_execution_context_t::run_job_conjunction(ast::job_conjunction_t const&, block_t const*) ()
#6  0x0000000000571277 in parse_execution_context_t::run_job_list(ast::job_list_t const&, block_t const*) ()
#7  0x0000000000572c8e in parse_execution_context_t::eval_node(ast::job_list_t const&, block_t const*) ()
#8  0x00000000004935f2 in eval_res_t parser_t::eval_node<ast::job_list_t>(std::shared_ptr<parsed_source_t const> const&, ast::job_list_t const&, io_chain_t const&, std::shared_ptr<job_group_t> const&, block_type_t) ()
#9  0x000000000040e371 in run_command_list(parser_t&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, io_chain_t const&) ()
#10 0x000000000040c0bf in main ()

@faho
Copy link
Member

faho commented Jan 26, 2024

Duplicate of #10199

@faho faho marked this as a duplicate of #10199 Jan 26, 2024
@faho faho closed this as completed Jan 26, 2024
@faho faho added the duplicate label Jan 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants