cern-fts / davix

High-performance file management over WebDAV / HTTP
GNU Lesser General Public License v2.1
84 stars 36 forks source link

Crash on badly formed `davix-cp` command #126

Open amadio opened 4 months ago

amadio commented 4 months ago
$ coredumpctl debug
           PID: 2622881 (davix-cp)
           UID: 75748 (amadio)
           GID: 1399 (zh)
        Signal: 11 (SEGV)
     Timestamp: Wed 2024-07-03 14:49:40 CEST (18s ago)
  Command Line: davix-cp --copy-mode push --capath /etc/grid-security/certificates https://eospublic.cern.ch/eos/opendata
    Executable: /usr/bin/davix-cp
 Control Group: /user.slice/user-75748.slice/session-4.scope
          Unit: session-4.scope
         Slice: user-75748.slice
       Session: 4
     Owner UID: 75748 (amadio)
       Boot ID: 77cbd0db00854ddb92e1ae54500fbcd1
    Machine ID: 4e3d8d92ab567e94901505535e4be753
      Hostname: gentoo.cern.ch
       Storage: /var/lib/systemd/coredump/core.davix-cp.75748.77cbd0db00854ddb92e1ae54500fbcd1.2622881.1720010980000000.zst (present)
  Size on Disk: 286.1K
       Message: Process 2622881 (davix-cp) of user 75748 dumped core.

                Module libkrb5support.so.0 without build-id.
                Module libcom_err.so.2 without build-id.
                Module libk5crypto.so.3 without build-id.
                Module libkrb5.so.3 without build-id.
                Module libgssapi_krb5.so.2 without build-id.
                Module librtmp.so.1 without build-id.
                Module libstdc++.so.6 without build-id.
                Stack trace of thread 2622881:
                #0  0x00007f1efcd78701 __memmove_avx_unaligned (libc.so.6 + 0x136701)
                #1  0x00007f1efcf6bac0 _ZNSt11char_traitsIcE4copyEPcPKcm (libstdc++.so.6 + 0x16bac0)
                #2  0x00007f1efd32ddf2 _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6assignERKS4_ (libdavix.so.0 + 0x10edf2)
                #3  0x00005646e6cf2274 main (davix-cp + 0xc274)
                #4  0x00007f1efcc66985 __libc_start_call_main (libc.so.6 + 0x24985)
                #5  0x00007f1efcc66a3c __libc_start_main_impl (libc.so.6 + 0x24a3c)
                #6  0x00005646e6cf2875 _start (davix-cp + 0xc875)
                ELF object binary architecture: AMD x86-64

GNU gdb (Gentoo 14.2 vanilla) 14.2
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://bugs.gentoo.org/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/bin/davix-cp...
[New LWP 2622881]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib64/libthread_db.so.1".
Core was generated by `davix-cp --copy-mode push --capath /etc/grid-security/certificates https://eosp'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  __memcpy_avx_unaligned () at ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:220
220             VMOVU   (%rsi), %VMM(0)
(gdb) bt
#0  __memcpy_avx_unaligned () at ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:220
#1  0x00007f1efcf6bac0 in std::char_traits<char>::copy (__s1=<optimized out>, __s2=<optimized out>, __n=49)
    at /usr/src/debug/sys-devel/gcc-14.1.9999/build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/char_traits.h:427
#2  std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_S_copy (__d=<optimized out>, __s=<optimized out>, __n=49)
    at /usr/src/debug/sys-devel/gcc-14.1.9999/build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/basic_string.h:435
#3  std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_S_copy (__d=<optimized out>, __s=<optimized out>, __n=49)
    at /usr/src/debug/sys-devel/gcc-14.1.9999/build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/basic_string.h:430
#4  std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_assign (this=this@entry=0x56470c147560,
    __str=<error: Cannot access memory at address 0x6d65747461207972>) at /usr/src/debug/sys-devel/gcc-14.1.9999/build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/basic_string.tcc:295
#5  0x00007f1efd32ddf2 in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::assign (this=0x56470c147560,
    __str=<error: Cannot access memory at address 0x6d65747461207972>) at /usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/bits/basic_string.h:1588
#6  std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator= (this=0x56470c147560, __str=<error: Cannot access memory at address 0x6d65747461207972>)
    at /usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/bits/basic_string.h:819
#7  Davix::UriPrivate::parsing (this=0x56470c147490, uri_string=<error: Cannot access memory at address 0x6d65747461207972>)
    at /usr/src/debug/net-libs/davix-0.8.7/davix-0.8.7/src/utils/davixuri.cpp:70
#8  Davix::Uri::Uri (this=this@entry=0x7ffe221b5d00, uri=<error: Cannot access memory at address 0x6d65747461207972>)
    at /usr/src/debug/net-libs/davix-0.8.7/davix-0.8.7/src/utils/davixuri.cpp:161
#9  0x00005646e6cf2274 in main (argc=6, argv=<optimized out>) at /usr/src/debug/net-libs/davix-0.8.7/davix-0.8.7/src/tools/davix_tool_copy_main.cpp:70