JetBrains/teamcity-symbol-server

JetBrains.CommandLine.Symbols.exe cannot handle pdb files with symbols longer than 2048 bytes

Marc-Aldorasi-Imprivata opened this issue · 0 comments

Boost MultiIndex generates symbol names which are very long. One symbol I have is 3214 characters long:

header_holder<boost::multi_index::detail::sequenced_index_node<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::ordered_index_node<boost::multi_index::detail::null_augment_policy, boost::multi_index::detail::index_node_base<GC::MessageService::detail::unsent_message<std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long long int, std::ratio<1, 1000000000> > > >, std::allocator<GC::MessageService::detail::unsent_message<std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long long int, std::ratio<1, 1000000000> > > > > > >, boost::multi_index::detail::hashed_unique_tag> >*, boost::multi_index::multi_index_container<GC::MessageService::detail::unsent_message<std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long long int, std::ratio<1, 1000000000> > > >, boost::multi_index::indexed_by<boost::multi_index::sequenced<boost::multi_index::tag<mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na> >, boost::multi_index::hashed_unique<boost::multi_index::tag<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, boost::multi_index::member<GC::MessageService::detail::unsent_message<std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long long int, std::ratio<1, 1000000000> > > >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, &GC::MessageService::detail::unsent_message<std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long long int, std::ratio<1, 1000000000> > > >::id>, mpl_::na, mpl_::na>, boost::multi_index::ordered_non_unique<boost::multi_index::tag<std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long long int, std::ratio<1, 1000000000> > >, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, boost::multi_index::member<GC::MessageService::detail::unsent_message<std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long long int, std::ratio<1, 1000000000> > > >, std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long long int, std::ratio<1, 1000000000> > >, &GC::MessageService::detail::unsent_message<std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long long int, std::ratio<1, 1000000000> > > >::send_timeout>, mpl_::na>, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, std::allocator<GC::MessageService::detail::unsent_message<std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long long int, std::ratio<1, 1000000000> > > > > > >

When JetBrains.CommandLine.Symbols.exe attempts to list the source files in this PDB file, it attempts to read that type name into a 2048-byte buffer, which fails with the message "Unable to read indexed sources from PDF file C:\BuildAgent\work\42fcd98868f43657\windows-installer\converted\libGCTaskService.pdb: The buffer capacity of 2,048 bytes were exhausted while looking for a terminating zero on a UTF-8 string. Reading longer strings is currently not supported." This causes the file to be omitted from the pdb file list, which means it is not served up by the symbol server.

Running the program in a debugger gives the following call stack when the error occurs:

JetBrains.Metadata.Utils.StreamBinaryReader.ReadStringUtf8()
JetBrains.Metadata.Debug.Pdb.WindowsPdbFile.GetNamesStreamDictionary()
JetBrains.CommandLine.Symbols.ListReferencesSourcesCommand+d__4.MoveNext()
System.Linq.Enumerable+WhereEnumerableIterator`1[[System.__Canon, mscorlib]].MoveNext()
System.Linq.Enumerable+d__64`1[[System.__Canon, mscorlib]].MoveNext()
JetBrains.CommandLine.Symbols.ListReferencesSourcesCommand.Execute()
JetBrains.CommandLine.Symbols.Program.Main(System.String[])