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

Shell process terminated unexpectedly when typing tab to get parameter suggestions #7390

Closed
yushli opened this issue Jun 12, 2023 · 4 comments · Fixed by #7404
Closed

Shell process terminated unexpectedly when typing tab to get parameter suggestions #7390

yushli opened this issue Jun 12, 2023 · 4 comments · Fixed by #7404
Assignees
Labels
bug Issue is reported as a bug team:VM Assigned to OTP team VM

Comments

@yushli
Copy link

yushli commented Jun 12, 2023

Describe the bug

  1. Use rebar3 release to build a release with some dependencies, like cowboy or thoas.
  2. Run ./_build/default/rel/some_app/bin/some_app console
  3. type thoas:encode(
  4. type tab to get suggestions
  5. Shell terminated with the following messages:
    *** ERROR: Shell process terminated! ***
    =ERROR REPORT==== 11-Jun-2023::23:42:23.102598 ===
    Error in process <0.764.0> on node 'some_app@127.0.0.1' with exit value:
    {function_clause,
    [{filename,join,
    [{error,bad_name},"ebin"],
    [{file,"filename.erl"},{line,454}]},
    {filename,join,1,[{file,"filename.erl"},{line,441}]},
    {code,get_doc,2,[{file,"code.erl"},{line,919}]},
    {edlin_type_suggestion,lookup_type,4,
    [{file,"edlin_type_suggestion.erl"},{line,223}]},
    {edlin_type_suggestion,type_traverser,5,
    [{file,"edlin_type_suggestion.erl"},{line,195}]},
    {edlin_type_suggestion,type_traverser,5,
    [{file,"edlin_type_suggestion.erl"},{line,142}]},
    {edlin_type_suggestion,'-type_traverser/5-lc$^1/1-2-',5,
    [{file,"edlin_type_suggestion.erl"},{line,65}]},
    {edlin_type_suggestion,type_traverser,5,
    [{file,"edlin_type_suggestion.erl"},{line,65}]}]}

Eshell V14.0.1 (press Ctrl+G to abort, type help(). for help)

NOTE:

  1. It needs to type "(" before typing tab to reproduce the crash.
  2. It doesn't happen when started using rebar3 shell. Type tab in this case successfully gets the suggestions.

To Reproduce
Please follow the above steps to reproduce.
Expected behavior
Type tab should get the suggestions and should not terminate the shell.

Affected versions
Latest OTP dev branch

Additional context

@yushli yushli added the bug Issue is reported as a bug label Jun 12, 2023
@rickard-green rickard-green added the team:VM Assigned to OTP team VM label Jun 12, 2023
@frazze-jobb frazze-jobb self-assigned this Jun 12, 2023
@frazze-jobb
Copy link
Contributor

frazze-jobb commented Jun 14, 2023

I have not been able to reproduce this.
tab completion gives me this:

efrfred@elx71487vj2:~/expand_crash_app$ _build/prod/rel/expand_crash_app/bin/expand_crash_app console
Exec: /home/efrfred/expand_crash_app/_build/prod/rel/expand_crash_app/erts-14.0.1/bin/erlexec -boot /home/efrfred/expand_crash_app/_build/prod/rel/expand_crash_app/releases/1.0.0/start -mode embedded -boot_var SYSTEM_LIB_DIR /home/efrfred/expand_crash_app/_build/prod/rel/expand_crash_app/lib -config /home/efrfred/expand_crash_app/_build/prod/rel/expand_crash_app/releases/1.0.0/sys.config -args_file /home/efrfred/expand_crash_app/_build/prod/rel/expand_crash_app/releases/1.0.0/vm.args -- console
Root: /home/efrfred/expand_crash_app/_build/prod/rel/expand_crash_app
/home/efrfred/expand_crash_app/_build/prod/rel/expand_crash_app
Erlang/OTP 27 [DEVELOPMENT] [erts-14.0.1] [source-3a354b80a1] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit:ns]

Eshell V14.0.1 (press Ctrl+G to abort, type help(). for help)
1> thoas:encode
functions
encode(              encode_to_iodata(

Adding '(' myself and pressing tabs gives me this:

1> thoas:encode(
typespecs
thoas:encode/1
thoas:encode/2

@yushli
Copy link
Author

yushli commented Jun 14, 2023

Looks like you are testing a prod release. I tried and find out that in rebar.config, if relx options set to
{mode, prod} it works as expected. But if the option is set to {mode, dev} it will crash the shell process.

@frazze-jobb
Copy link
Contributor

frazze-jobb commented Jun 15, 2023

Okey I can reproduce it, and solution fixes the issue

@yushli
Copy link
Author

yushli commented Jun 15, 2023

Thanks for the quick fix. Look forward to seeing it merged.

frazze-jobb added a commit that referenced this issue Jun 20, 2023
…aded/GH-7390

kernel: code:get_doc/1 return missing, on missing preloaded
OTP-18654
bjorng pushed a commit that referenced this issue Jun 29, 2023
… maint-26

* frazze/kernel/missing_preloaded/GH-7390/OTP-18656:
  kernel: code:get_doc/1 return missing, on missing preloaded
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is reported as a bug team:VM Assigned to OTP team VM
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants