Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 28 additions & 9 deletions test/other/metadce/test_metadce_files_wasmfs.funcs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
$__cxa_pure_virtual
$__cxx_global_array_dtor
$__cxx_global_array_dtor.1
$__cxx_global_array_dtor.2
Expand Down Expand Up @@ -28,24 +29,36 @@ $__pthread_mutex_lock
$__stdio_close
$__stdio_seek
$__stdio_write
$__towrite
$__unlockfile
$__wasi_fd_close
$__wasi_fd_write
$__wasm_call_ctors
$decltype\28auto\29\20std::__2::__variant_detail::__visitation::__base::__dispatcher<0ul>::__dispatch\5babi:v160006\5d<std::__2::__variant_detail::__dtor<std::__2::__variant_detail::__traits<std::__2::vector<wasmfs::Directory::Entry\2c\20std::__2::allocator<wasmfs::Directory::Entry>>\2c\20int>\2c\20\28std::__2::__variant_detail::_Trait\291>::__destroy\5babi:v160006\5d\28\29::'lambda'\28auto&\29&&\2c\20std::__2::__variant_detail::__base<\28std::__2::__variant_detail::_Trait\291\2c\20std::__2::vector<wasmfs::Directory::Entry\2c\20std::__2::allocator<wasmfs::Directory::Entry>>\2c\20int>&>\28auto\2c\20std::__2::__variant_detail::__base<\28std::__2::__variant_detail::_Trait\291\2c\20std::__2::vector<wasmfs::Directory::Entry\2c\20std::__2::allocator<wasmfs::Directory::Entry>>\2c\20int>&\29
$decltype\28auto\29\20std::__2::__variant_detail::__visitation::__base::__dispatcher<1ul>::__dispatch\5babi:v160006\5d<std::__2::__variant_detail::__dtor<std::__2::__variant_detail::__traits<long\2c\20std::__2::shared_ptr<wasmfs::File>>\2c\20\28std::__2::__variant_detail::_Trait\291>::__destroy\5babi:v160006\5d\28\29::'lambda'\28auto&\29&&\2c\20std::__2::__variant_detail::__base<\28std::__2::__variant_detail::_Trait\291\2c\20long\2c\20std::__2::shared_ptr<wasmfs::File>>&>\28auto\2c\20std::__2::__variant_detail::__base<\28std::__2::__variant_detail::_Trait\291\2c\20long\2c\20std::__2::shared_ptr<wasmfs::File>>&\29
$decltype\28auto\29\20std::__2::__variant_detail::__visitation::__base::__dispatcher<0ul>::__dispatch\5babi:un170004\5d<std::__2::__variant_detail::__dtor<std::__2::__variant_detail::__traits<std::__2::vector<wasmfs::Directory::Entry\2c\20std::__2::allocator<wasmfs::Directory::Entry>>\2c\20int>\2c\20\28std::__2::__variant_detail::_Trait\291>::__destroy\5babi:un170004\5d\28\29::'lambda'\28auto&\29&&\2c\20std::__2::__variant_detail::__base<\28std::__2::__variant_detail::_Trait\291\2c\20std::__2::vector<wasmfs::Directory::Entry\2c\20std::__2::allocator<wasmfs::Directory::Entry>>\2c\20int>&>\28auto\2c\20std::__2::__variant_detail::__base<\28std::__2::__variant_detail::_Trait\291\2c\20std::__2::vector<wasmfs::Directory::Entry\2c\20std::__2::allocator<wasmfs::Directory::Entry>>\2c\20int>&\29
$decltype\28auto\29\20std::__2::__variant_detail::__visitation::__base::__dispatcher<1ul>::__dispatch\5babi:un170004\5d<std::__2::__variant_detail::__dtor<std::__2::__variant_detail::__traits<long\2c\20std::__2::shared_ptr<wasmfs::File>>\2c\20\28std::__2::__variant_detail::_Trait\291>::__destroy\5babi:un170004\5d\28\29::'lambda'\28auto&\29&&\2c\20std::__2::__variant_detail::__base<\28std::__2::__variant_detail::_Trait\291\2c\20long\2c\20std::__2::shared_ptr<wasmfs::File>>&>\28auto\2c\20std::__2::__variant_detail::__base<\28std::__2::__variant_detail::_Trait\291\2c\20long\2c\20std::__2::shared_ptr<wasmfs::File>>&\29
$dlmalloc
$dummy
$fflush
$fmt_fp
$fmt_u
$frexp
$getint
$is_equal\28std::type_info\20const*\2c\20std::type_info\20const*\2c\20bool\29
$main
$memchr
$memcmp
$memmove
$operator\20delete\28void*\29
$operator\20new\28unsigned\20long\29
$out
$pad
$pop_arg
$pop_arg_long_double
$printf_core
$pthread_mutex_init
$sbrk
$std::__2::__allocation_result<std::__2::allocator_traits<std::__2::allocator<char>>::pointer>\20std::__2::__allocate_at_least\5babi:v160006\5d<std::__2::allocator<char>>\28std::__2::allocator<char>&\2c\20unsigned\20long\29
$std::__2::__allocation_result<std::__2::allocator_traits<std::__2::allocator<char>>::pointer>\20std::__2::__allocate_at_least\5babi:un170004\5d<std::__2::allocator<char>>\28std::__2::allocator<char>&\2c\20unsigned\20long\29
$std::__2::__libcpp_verbose_abort\28char\20const*\2c\20...\29
$std::__2::__shared_ptr_emplace<wasmfs::MemoryDataFile\2c\20std::__2::allocator<wasmfs::MemoryDataFile>>::~__shared_ptr_emplace\28\29
$std::__2::__shared_ptr_emplace<wasmfs::MemoryDataFile\2c\20std::__2::allocator<wasmfs::MemoryDataFile>>::~__shared_ptr_emplace\28\29.1
$std::__2::__shared_ptr_emplace<wasmfs::MemoryDirectory\2c\20std::__2::allocator<wasmfs::MemoryDirectory>>::__on_zero_shared\28\29
Expand All @@ -70,20 +83,25 @@ $std::__2::__shared_ptr_emplace<wasmfs::SpecialFiles::\28anonymous\20namespace\2
$std::__2::__shared_ptr_emplace<wasmfs::SpecialFiles::\28anonymous\20namespace\29::StdoutFile\2c\20std::__2::allocator<wasmfs::SpecialFiles::\28anonymous\20namespace\29::StdoutFile>>::~__shared_ptr_emplace\28\29.1
$std::__2::__shared_weak_count::__release_weak\28\29
$std::__2::__shared_weak_count::lock\28\29
$std::__2::__throw_bad_weak_ptr\5babi:un170004\5d\28\29
$std::__2::__throw_length_error\5babi:un170004\5d\28char\20const*\29
$std::__2::__tree<std::__2::__value_type<std::__2::basic_string<char\2c\20std::__2::char_traits<char>\2c\20std::__2::allocator<char>>\2c\20wasmfs::Directory::DCacheEntry>\2c\20std::__2::__map_value_compare<std::__2::basic_string<char\2c\20std::__2::char_traits<char>\2c\20std::__2::allocator<char>>\2c\20std::__2::__value_type<std::__2::basic_string<char\2c\20std::__2::char_traits<char>\2c\20std::__2::allocator<char>>\2c\20wasmfs::Directory::DCacheEntry>\2c\20std::__2::less<std::__2::basic_string<char\2c\20std::__2::char_traits<char>\2c\20std::__2::allocator<char>>>\2c\20true>\2c\20std::__2::allocator<std::__2::__value_type<std::__2::basic_string<char\2c\20std::__2::char_traits<char>\2c\20std::__2::allocator<char>>\2c\20wasmfs::Directory::DCacheEntry>>>::destroy\28std::__2::__tree_node<std::__2::__value_type<std::__2::basic_string<char\2c\20std::__2::char_traits<char>\2c\20std::__2::allocator<char>>\2c\20wasmfs::Directory::DCacheEntry>\2c\20void*>*\29
$std::__2::basic_string<char\2c\20std::__2::char_traits<char>\2c\20std::__2::allocator<char>>&\20std::__2::basic_string<char\2c\20std::__2::char_traits<char>\2c\20std::__2::allocator<char>>::__assign_no_alias<false>\28char\20const*\2c\20unsigned\20long\29
$std::__2::basic_string<char\2c\20std::__2::char_traits<char>\2c\20std::__2::allocator<char>>&\20std::__2::basic_string<char\2c\20std::__2::char_traits<char>\2c\20std::__2::allocator<char>>::__assign_no_alias<true>\28char\20const*\2c\20unsigned\20long\29
$std::__2::basic_string<char\2c\20std::__2::char_traits<char>\2c\20std::__2::allocator<char>>::__begin_lifetime\5babi:un170004\5d\28char*\2c\20unsigned\20long\29
$std::__2::basic_string<char\2c\20std::__2::char_traits<char>\2c\20std::__2::allocator<char>>::__grow_by_and_replace\28unsigned\20long\2c\20unsigned\20long\2c\20unsigned\20long\2c\20unsigned\20long\2c\20unsigned\20long\2c\20unsigned\20long\2c\20char\20const*\29
$std::__2::basic_string<char\2c\20std::__2::char_traits<char>\2c\20std::__2::allocator<char>>::__init_copy_ctor_external\28char\20const*\2c\20unsigned\20long\29
$std::__2::basic_string<char\2c\20std::__2::char_traits<char>\2c\20std::__2::allocator<char>>::__invalidate_iterators_past\5babi:v160006\5d\28unsigned\20long\29
$std::__2::basic_string<char\2c\20std::__2::char_traits<char>\2c\20std::__2::allocator<char>>::__throw_length_error\5babi:v160006\5d\28\29\20const
$std::__2::char_traits<char>::copy\28char*\2c\20char\20const*\2c\20unsigned\20long\29
$std::__2::shared_ptr<wasmfs::SpecialFiles::\28anonymous\20namespace\29::RandomFile>\20std::__2::make_shared\5babi:v160006\5d<wasmfs::SpecialFiles::\28anonymous\20namespace\29::RandomFile\2c\20void>\28\29
$std::__2::basic_string<char\2c\20std::__2::char_traits<char>\2c\20std::__2::allocator<char>>::__throw_length_error\5babi:un170004\5d\28\29\20const
$std::__2::char_traits<char>::copy\5babi:un170004\5d\28char*\2c\20char\20const*\2c\20unsigned\20long\29
$std::__2::shared_ptr<wasmfs::SpecialFiles::\28anonymous\20namespace\29::RandomFile>\20std::__2::make_shared\5babi:un170004\5d<wasmfs::SpecialFiles::\28anonymous\20namespace\29::RandomFile\2c\20void>\28\29
$std::__2::vector<char\2c\20std::__2::allocator<char>>::__throw_length_error\5babi:un170004\5d\28\29\20const
$std::__2::vector<unsigned\20char\2c\20std::__2::allocator<unsigned\20char>>::__append\28unsigned\20long\29
$std::__2::vector<wasmfs::MemoryDirectory::ChildEntry\2c\20std::__2::allocator<wasmfs::MemoryDirectory::ChildEntry>>::erase\5babi:v160006\5d\28std::__2::__wrap_iter<wasmfs::MemoryDirectory::ChildEntry\20const*>\29
$std::__2::vector<wasmfs::MemoryDirectory::ChildEntry\2c\20std::__2::allocator<wasmfs::MemoryDirectory::ChildEntry>>::erase\5babi:un170004\5d\28std::__2::__wrap_iter<wasmfs::MemoryDirectory::ChildEntry\20const*>\29
$std::__throw_bad_array_new_length\5babi:un170004\5d\28\29
$strlen
$void\20std::__2::__libcpp_operator_delete\5babi:v160006\5d<void*>\28void*\29
$void\20std::__2::__libcpp_operator_delete\5babi:un170004\5d<void*>\28void*\29
$void\20std::__2::vector<std::__2::shared_ptr<wasmfs::OpenFileState>\2c\20std::__2::allocator<std::__2::shared_ptr<wasmfs::OpenFileState>>>::__emplace_back_slow_path<>\28\29
$void\20std::__2::vector<wasmfs::Directory::Entry\2c\20std::__2::allocator<wasmfs::Directory::Entry>>::__push_back_slow_path<wasmfs::Directory::Entry>\28wasmfs::Directory::Entry&&\29
$wasmfs::DataFile::Handle::flush\28\29
$wasmfs::DataFile::Handle::write\28unsigned\20char\20const*\2c\20unsigned\20long\2c\20long\20long\29
$wasmfs::Directory::Handle::cacheChild\28std::__2::basic_string<char\2c\20std::__2::char_traits<char>\2c\20std::__2::allocator<char>>\20const&\2c\20std::__2::shared_ptr<wasmfs::File>\2c\20wasmfs::Directory::DCacheKind\29
Expand Down Expand Up @@ -145,3 +163,4 @@ $wasmfs::path::\28anonymous\20namespace\29::doParseParent\28std::__2::basic_stri
$wasmfs::path::\28anonymous\20namespace\29::getBaseDir\28unsigned\20int\29
$wasmfs::path::\28anonymous\20namespace\29::getChild\28std::__2::shared_ptr<wasmfs::Directory>\2c\20std::__2::basic_string_view<char\2c\20std::__2::char_traits<char>>\2c\20wasmfs::path::LinkBehavior\2c\20unsigned\20long&\29
$wasmfs::path::parseParent\28std::__2::basic_string_view<char\2c\20std::__2::char_traits<char>>\2c\20unsigned\20int\29
$wctomb
2 changes: 1 addition & 1 deletion test/other/metadce/test_metadce_files_wasmfs.size
Original file line number Diff line number Diff line change
@@ -1 +1 @@
51616
60220
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a pretty big bump that might be worth investigating. Is print being pulled in where it wasn't before for some reason?

There are a few useful linking command line tricks for tracking down why symbols get included. For example --trace-symbol and maybe -Wl,-Map=.

Copy link
Member Author

@aheejin aheejin Nov 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah this also turned out to be the __libcpp_verbose_abort issue. We thought adding -D_LIBCPP_AVAILABILITY_HAS_NO_VERBOSE_ABORT in libcxx's system_libs.py would solve the issue, but those routines are in the headers. So these routines can be called whenever a user gives errorneous arguments to string or vector allocations, so basically any user code can pull these __libcpp_verbose_abort in. In this case libwasmfs code pulled in __libcpp_verbose_abort and thus the printf family. We can add -D_LIBCPP_AVAILABILITY_HAS_NO_VERBOSE_ABORT to libwasmfs's cflags in system_libs.py but that's just a band-aid for libwasmfs because we can't do that for all user code.

I guess we should just define it in https://github.com/emscripten-core/emscripten/blob/main/system/lib/libcxx/include/__verbose_abort. WDYT?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ping 😀

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about defining it system/lib/libcxx/include/__config_site

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done