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

generate tons of big core dump files on remote server #10359

Closed
FangLin2001 opened this issue Jan 6, 2023 · 4 comments
Closed

generate tons of big core dump files on remote server #10359

FangLin2001 opened this issue Jan 6, 2023 · 4 comments
Labels
bug fixed Check the Milestone for the release in which the fix is or will be available. Language Service reliability
Milestone

Comments

@FangLin2001
Copy link

Environment

  • OS and Version: Windows 10 Enterprise 21H2
  • VS Code Version: 1.70.0
  • C/C++ Extension Version: 1.13.7
  • If using SSH remote, specify OS of remote machine: CentOS Linux release 7.6.1810 (Core)

Bug Summary and Steps to Reproduce

Bug Summary:
I'm a server developer. I use vscode's Remote-SSH to login my remote server and then edit code, gdb attach to my processes, etc. It was found that the extension of cpptools (specifically ./cpptools-srv)generate tons of core dump files (150GB totally within a month). The core dump files' directory is: ~/.../.vscode-server/extensions/ms-vscode.cpptools-1.13.7-linux-x64/bin. Note that the version of cpptools is 1.13.7. Now I have upgraded to version 1.13.9, but I haven't try out version 1.13.9. This problem severely hampers my daily work. I repeatedly clean up these files, but shortly afterwards they would take up all the space of my hard drive.

Expected behavior:
No core dump file generated.

Configuration and Logs

failed to analyze “/.vscode/c_cpp_properties.json”: ENOENT: no such file or directory, open '/.vscode/c_cpp_properties.json'

-------- Diagnostics - 1/6/2023, 7:12:47 PM
Version: 1.13.9
Current Configuration:
{
    "name": "Linux",
    "includePath": [
        "${workspaceFolder}/**"
    ],
    "defines": [],
    "compilerPath": "/usr/lib64/ccache/gcc",
    "cStandard": "c89",
    "cppStandard": "c++14",
    "intelliSenseMode": "linux-gcc-x64",
    "intelliSenseModeIsExplicit": false,
    "cStandardIsExplicit": false,
    "cppStandardIsExplicit": false,
    "mergeConfigurations": false,
    "compilerPathIsExplicit": false,
    "browse": {
        "path": [
            "${workspaceFolder}/**"
        ],
        "limitSymbolsToIncludedHeaders": true
    }
}
No active translation units.

Other Extensions

No response

Additional context

I use command 'gdb ./cpptools-srv core.23028' to analyse these core dump files:

Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `/data/fanglin/.vscode-server/extensions/ms-vscode.cpptools-1.13.7-linux-x64/bin'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x0000000000528c81 in field_for_lambda_capture(a_lambda*, a_lambda_capture*) ()
[Current thread is 1 (Thread 0x7f0ab45fa700 (LWP 23067))]
(gdb) bt
#0  0x0000000000528c81 in field_for_lambda_capture(a_lambda*, a_lambda_capture*) ()
#1  0x000000000063f9c6 in rewrite_captured_variable_access(an_operand*) ()
#2  0x000000000063fde9 in extract_node_from_operand(an_operand*, int) ()
#3  0x000000000063f6b5 in make_node_from_operand(an_operand*, int) ()
#4  0x000000000064a329 in build_unary_result_operand(an_operand*, unsigned char, a_type*, an_operand*) ()
#5  0x00000000007e304c in f_check_for_operator_overloading(unsigned char, int, int, int, int, an_operand*, an_operand*, a_source_position*, a_source_position*, unsigned int, unsigned long, a_source_position*, an_operand*, int*, a_candidate_function*, int*) ()
#6  0x00000000007e27b6 in check_for_operator_overloading(unsigned char, int, int, int, int, an_operand*, an_operand*, a_source_position*, a_source_position*, unsigned int, unsigned long, a_source_position*, an_operand*, int*) ()
#7  0x000000000060c993 in scan_indirection_operator(a_rescan_control_block*, an_operand*)
    ()
#8  0x00000000005f3bf7 in scan_expr_full(an_operand*, an_operand*, int, int) ()
#9  0x00000000005ead4b in scan_expr_list(a_token_kind_tag, int, int, int, int, int, int) ()
#10 0x00000000005eb75f in scan_call_arguments(a_type*, a_routine*, int, an_expr_node**, int, int, int, int, a_rescan_control_block*, int, an_init_component*, an_init_component**, an_operand*, int*, a_source_position*) ()
#11 0x000000000061bac9 in scan_function_call(an_operand*, an_operand*, a_rescan_control_block*, an_operand*) ()
#12 0x000000000062c729 in scan_any_call(an_operand*, an_operand*, an_operand*) ()
#13 0x00000000005f53ae in scan_expr_full(an_operand*, an_operand*, int, int) ()
#14 0x00000000005ff243 in scan_void_expression(int, int, int, a_dynamic_init**, an_init_component*) ()
#15 0x000000000082039c in expression_statement(int) ()
#16 0x000000000081c650 in statement(int, int) ()
#17 0x0000000000819489 in compound_statement_full(int, int, int, int, int, a_type**) ()
#18 0x000000000081a81b in statement(int, int) ()
#19 0x000000000081d353 in statement(int, int) ()
#20 0x00000000008192d9 in compound_statement_full(int, int, int, int, int, a_type**) ()
#21 0x0000000000675fb0 in scan_function_body(a_routine*, a_func_info_block*, unsigned long, a_macro_arg_fixup**, a_macro_arg_fixup**) ()
#22 0x000000000054e1b0 in scan_lambda() ()
#23 0x00000000005f4c98 in scan_expr_full(an_operand*, an_operand*, int, int) ()
#24 0x00000000005ead4b in scan_expr_list(a_token_kind_tag, int, int, int, int, int, int) ()
#25 0x00000000005eb75f in scan_call_arguments(a_type*, a_routine*, int, an_expr_node**, int, int, int, int, a_rescan_control_block*, int, an_init_component*, an_init_component**, an_operand*, int*, a_source_position*) ()
#26 0x000000000061bac9 in scan_function_call(an_operand*, an_operand*, a_rescan_control_block*, an_operand*) ()
#27 0x000000000062c729 in scan_any_call(an_operand*, an_operand*, an_operand*) ()
#28 0x00000000005f53ae in scan_expr_full(an_operand*, an_operand*, int, int) ()
#29 0x00000000005ff243 in scan_void_expression(int, int, int, a_dynamic_init**, an_init_component*) ()
#30 0x000000000082039c in expression_statement(int) ()
#31 0x000000000081c650 in statement(int, int) ()
#32 0x0000000000819489 in compound_statement_full(int, int, int, int, int, a_type**) ()
#33 0x000000000081a81b in statement(int, int) ()
--Type <RET> for more, q to quit, c to continue without paging--RET
#34 0x000000000081d353 in statement(int, int) ()
#35 0x00000000008192d9 in compound_statement_full(int, int, int, int, int, a_type**) ()
#36 0x0000000000675fb0 in scan_function_body(a_routine*, a_func_info_block*, unsigned long, a_macro_arg_fixup**, a_macro_arg_fixup**) ()
#37 0x0000000000678f8a in function_definition(a_symbol_locator*, a_decl_parse_state*, a_func_info_block*, a_decl_pos_block*) ()
#38 0x00000000005b209a in scan_nonmember_declaration(a_decl_parse_state*, a_source_range*)
    ()
#39 0x00000000005b41af in declaration(int, int, int, int, a_param_id*, a_source_range*, a_decl_parse_state*) ()
#40 0x00000000004b97df in compile_fragment((anonymous namespace)::a_fragment_buffer const&, a_canonicalized_file_name, msvc::strong_typedef_t<msvc::offset_traits>, msvc::strong_typedef_t<msvc::offset_traits>, a_declaration_context const&, 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&, bool, a_region_scope_info const&, msvc::strong_typedef_t<msvc::offset_traits>, bool, bool*, bool, bool, bool) ()
#41 0x00000000004b6c5f in before_tu_wrapup() ()
#42 0x0000000000882699 in process_translation_unit(char const*, int, an_exported_template_file*) ()
#43 0x0000000000527fb2 in cfe_main(int, char**) ()
#44 0x00000000008c0a96 in cfe_main_exception_handler(int, char**) () 
#45 0x00000000005280a6 in edg_main(int, char**) ()
#46 0x00000000008b9fb9 in edge_compiler_main(int, char const**) ()
#47 0x00000000004b7316 in preparse(int, char const**, a_scout_store*, edge::translation_unit*) () 
#48 0x000000000047c70f in a_compiler_thread::compiler_thread_routine(a_compiler_thread*) ()
#49 0x00000000009971fa in msvc::thread_helper_t::thread_entry(void*) ()
#50 0x00007f0ab95f8dd5 in start_thread () from /lib64/libpthread.so.0
#51 0x00007f0ab932202d in clone () from /lib64/libc.so.6

I try to upload a zip of core.23028 to help you guys debug, but it's 118MB too big to be allowed to upload. Maybe I can send it to you via email.

@sean-mcmanus sean-mcmanus added bug Language Service fixed Check the Milestone for the release in which the fix is or will be available. reliability labels Jan 6, 2023
@sean-mcmanus sean-mcmanus added this to the 1.14.0 milestone Jan 6, 2023
@sean-mcmanus
Copy link
Collaborator

Yes, the field_for_lambda_capture crash is known and the fix will be available in our pending 1.14.0 (pre-release).

@sean-mcmanus
Copy link
Collaborator

The fix is available with 1.14.0 (pre-release): https://github.com/microsoft/vscode-cpptools/releases/tag/v1.14.0

@FangLin2001
Copy link
Author

FangLin2001 commented Feb 7, 2023

The fix is available with 1.14.0 (pre-release): https://github.com/microsoft/vscode-cpptools/releases/tag/v1.14.0

Hi @sean-mcmanus . It seems that those core dump files were not only caused by the field_for_lambda_capture crash, as I still found some cores after upgrading the plugin to version 1.14.0 in dir ".../.vscode-server/extensions/ms-vscode.cpptools-1.14.0-linux-x64/bin".

GDB backtrace again:

[fanglin@10-242-10-182 bin]$ gdb ./cpptools-srv core.9364
GNU gdb (GDB) 8.2.1
...
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `/data/fanglin/.vscode-server/extensions/ms-vscode.cpptools-1.14.0-linux-x64/bin'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00000000007ca339 in mark_entry(a_source_correspondence*, an_il_entry_kind, a_walk_parents_control_block*) ()
[Current thread is 1 (Thread 0x7f648d9fb700 (LWP 9400))]
(gdb) bt
#0  0x00000000007ca339 in mark_entry(a_source_correspondence*, an_il_entry_kind, a_walk_parents_control_block*) ()
#1  0x0000000000711e5d in walk_parents(a_source_correspondence*, an_il_entry_kind, void (*)(a_source_correspondence*, an_il_entry_kind, a_walk_parents_control_block*), a_walk_parents_control_block*, int) ()
#2  0x00000000007ca206 in set_signature_mark(a_source_correspondence*, an_il_entry_kind, int) ()
#3  0x00000000007c0711 in calculate_implicit_abi_tags(a_source_correspondence*, an_il_entry_kind) ()
#4  0x00000000007bfc29 in mangled_function_name(a_routine*, int, int, int, int, unsigned long*, a_mangling_control_block*) ()
#5  0x00000000007bf94c in get_mangled_function_name_full(a_routine*, int, int, int) ()
#6  0x0000000000469155 in edge::scope_entry::compute_functions() const ()
#7  0x0000000000469014 in edge::scope_entry::ensure_functions() const ()
#8  0x00000000004b1b2c in get_immediate_members_of_scope(edge::scope_entry*, edge::list<edge::symbol*>*, bool, bool, bool) ()
#9  0x00000000004b090d in get_scope_member_list(edge::scope_entry*, edge::list<edge::symbol*>*, edge::list<edge::symbol*>*, edge::list<edge::symbol*>*, edge::list<edge::symbol*>*, edge::list<edge::namespace_symbol*>*, bool, bool, bool, bool) ()
#10 0x00000000004b019c in edge::intellisense_operation::get_auto_complete_members(edge::member_selection_entry*&, edge::scope_entry*&, edge::list<edge::symbol*>*, edge::list<edge::symbol*>*, edge::list<edge::symbol*>*, edge::list<edge::symbol*>*, edge::intellisense_operation::member_list_kind, bool, bool&, bool&, bool&) ()
#11 0x00000000004b0c11 in edge::intellisense_operation::get_auto_complete_members(edge::member_selection_entry*&, edge::scope_entry*&, edge::list<edge::symbol*>*, edge::list<edge::symbol*>*, edge::list<edge::symbol*>*, edge::list<edge::symbol*>*, edge::intellisense_operation::member_list_kind) ()
#12 0x00000000004339b4 in std::_Function_handler<void (edge::intellisense_operation&, bool&), edge_intellisense_server_impl::handle_completion(cpp_intellisense::DocumentPosition const&, bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cpp_intellisense::CompletionResponse&)::{lambda(edge::intellisense_operation&, bool&)#2}>::_M_invoke(std::_Any_data const&, edge::intellisense_operation&, bool&) ()
#13 0x0000000000432b4d in void edge_intellisense_operation::perform_isense_operation<bool>(char const*, cpp_intellisense::DocumentPosition const&, std::function<void (edge::intellisense_operation&, bool&)>&&, bool&, snapshot::snapshot_session_t, bool, edge::allocator*) ()
#14 0x00000000004214de in edge_intellisense_server_impl::handle_completion(cpp_intellisense::DocumentPosition const&, bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cpp_intellisense::CompletionResponse&) ()
#15 0x000000000044a1a5 in cpp_intellisense::server_stub::handle_completion(msvc::deserializer_t&, msvc::serializer_t&) ()
#16 0x0000000000458230 in msvc::base_channel_t::dispatch_message(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) ()
#17 0x000000000097c6f3 in msvc::common_channel_t::perform_call(unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) ()
#18 0x00000000009a9ed5 in worker ()
#19 0x00007f650920edd5 in start_thread () from /lib64/libpthread.so.0
#20 0x00007f6508f3802d in clone () from /lib64/libc.so.6
(gdb) 

@sean-mcmanus
Copy link
Collaborator

I created #10507 to track that different crash.

@github-actions github-actions bot locked and limited conversation to collaborators Apr 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug fixed Check the Milestone for the release in which the fix is or will be available. Language Service reliability
Projects
None yet
Development

No branches or pull requests

2 participants