You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@mesos.apache.org by "James Peach (JIRA)" <ji...@apache.org> on 2018/11/16 00:56:00 UTC

[jira] [Created] (MESOS-9393) Fetcher crashes extracting archives with non-ASCII filenames.

James Peach created MESOS-9393:
----------------------------------

             Summary: Fetcher crashes extracting archives with non-ASCII filenames.
                 Key: MESOS-9393
                 URL: https://issues.apache.org/jira/browse/MESOS-9393
             Project: Mesos
          Issue Type: Bug
          Components: fetcher
            Reporter: James Peach


{noformat}
(gdb) bt
#0  0x00007f2ec3827925 in raise () from /lib64/libc.so.6
#1  0x00007f2ec3829105 in abort () from /lib64/libc.so.6
#2  0x00007f2ec3e5da5d in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib64/libstdc++.so.6
#3  0x00007f2ec3e5bbe6 in ?? () from /usr/lib64/libstdc++.so.6
#4  0x00007f2ec3e5bc13 in std::terminate() () from /usr/lib64/libstdc++.so.6
#5  0x00007f2ec3e5bd0e in __cxa_throw () from /usr/lib64/libstdc++.so.6
#6  0x00007f2ec3e00837 in std::__throw_logic_error(char const*) () from /usr/lib64/libstdc++.so.6
#7  0x00007f2ec3e3be59 in ?? () from /usr/lib64/libstdc++.so.6
#8  0x00007f2ec3e3bf33 in std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&) ()
   from /usr/lib64/libstdc++.so.6
#9  0x0000555f5e843a6d in archiver::extract (source=...,
    destination="/tmp/mesos/slaves/04f97156-23b7-4411-8fa7-bdec71518221-S1320/frameworks/156b4459-4bb6-460b-89e5-d8c583dee257-0413/executors/cstapper-test-service.simple-pod.test.0.ti9dgngkdceq2_0/runs/4a2a188e-54ef-4"..., flags=<optimized out>) at ../../3rdparty/stout/include/stout/archiver.hpp:130
#10 0x0000555f5e859f06 in extract (sourcePath="/tmp/mesos/fetch/siri/c3-ace-inspector.tar.gz",
    destinationDirectory="/tmp/mesos/slaves/04f97156-23b7-4411-8fa7-bdec71518221-S1320/frameworks/156b4459-4bb6-460b-89e5-d8c583dee257-0413/executors/cstapper-test-service.simple-pod.test.0.ti9dgngkdceq2_0/runs/4a2a188e-54ef-4"...) at ../../src/launcher/fetcher.cpp:86
{noformat}

{noformat}
(gdb) p (struct archive_string_conv *)archive_string_conversion_to_charset(entry->archive, "UTF-8", 1)
$1 = (struct archive_string_conv *) 0x7fe599cd2be0
(gdb) p &entry->ae_pathname
$2 = (struct archive_mstring *) 0x7fe599c48010
(gdb) p (int)archive_strncpy_l(&($2->aes_utf8), $2->aes_mbs.s, $2->aes_mbs.length, $1)
$3 = -1
{noformat}

So archive_strncpy_l() fails with -1. best_effort_strncat_in_locale() has this wonky-looking code:

{noformat}
2235   remaining = length;
2236   itp = (const uint8_t *)_p;
2237   while (*itp && remaining > 0) {
2238     if (*itp > 127) {
2239       // Non-ASCII: Substitute with suitable replacement
2240       if (sc->flag & SCONV_TO_UTF8) {
2241         if (archive_string_append(as, utf8_replacement_char, sizeof(utf8_replacement_char)) == NULL) {
2242           __archive_errx(1, "Out of memory");
2243         }
2244       } else {
2245         archive_strappend_char(as, '?');
2246       }
2247       return_value = -1;
2248     } else {
2249       archive_strappend_char(as, *itp);
2250     }
2251     ++itp;
2252   }

(gdb) break best_effort_strncat_in_locale
Breakpoint 2 at 0x56143c85ff70: file libarchive/archive_string.c, line 2213.
(gdb) p (int)archive_strncpy_l(&($2->aes_utf8), $2->aes_mbs.s, $2->aes_mbs.length, $1)
...

(gdb)
2237		while (*itp && remaining > 0) {
(gdb)
2238			if (*itp > 127) {
(gdb)
2240				if (sc->flag & SCONV_TO_UTF8) {
(gdb)
2241					if (archive_string_append(as, utf8_replacement_char, sizeof(utf8_replacement_char)) == NULL) {
(gdb)
2251			++itp;
(gdb)
2237		while (*itp && remaining > 0) {
(gdb)
2247				return_value = -1;
(gdb) p *itp
$5 = 195 '\303'
{noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)