Hacker News new | past | comments | ask | show | jobs | submit login
I found a 271,800 character demangled symbol name in libmshr (gregoryszorc.com)
7 points by AntiRush on April 7, 2022 | hide | past | favorite | 7 comments



Please don't editorialise article submission titles. Even from the bullet point which you cherry picked to use as the title doesn't tell us anything useful other than it's a 271,800 character symbol.

https://news.ycombinator.com/newsguidelines.html


Umm... A symbol this long is very surprising and interesting. How is this editorializing? It's also a real quote from the linked post.


more interesting would be homoglyphs in C or C++ ABI's, eg by assuming UTF-8 encodings. or at least utf-8 names in the wild.

the overlong symbol looks it's coming from here: https://github.com/martinal/mshr/blob/master/src/Polyhedral_...

so not an overflow attack, just C++ nonsense.


Well what was it?


I know it's annoying, even the article doesn't reveal to us what it is:

The longest demangled ELF symbol is 271,800 characters and is defined in the file usr/lib/x86_64-linux-gnu/libmshr.so.2019.2.0.dev0 provided by the libmshr2019.2 package.

Sadly this submission is a victim of the wrong kind of title editorialising.


I tried to go looking for myself, so I downloaded the AMD64 binary from the Debian page: https://packages.debian.org/unstable/libmshr2019.2

After unpacking the data.tar.xz from the deb archive, I unpacked libmshr.so.2019.2.0.dev0 from the specified path.

Doing this:

    readelf -W --demangle=c++ -s libmshr.so.2019.2.0.dev0  | awk ' { if ( length > x ) { x = length; y = $0 } }END{ print y }' > test.txt
gave me a text file that is 101,943 bytes in size. Basically a huge C++ template soup, but still quite a bit short from the 271,800 bytes in the headline.

If you want to see it, I compressed (568 bytes!) and base64 encoded it:

    xz test.txt
    base64 test.txt.xz
And uploaded it here: https://paste.debian.net/1237184/

Which can be viewed with this one liner:

    curl https://paste.debian.net/download/1237184 | base64 -d | xz -d


Thank you. It's the wee hours here and frankly I just didn't have the energy to do it myself.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: