Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 915959 - net-fs/davfs2-1.7.0: segfault on accessing "lost+found'' -- possible cache corruption
Summary: net-fs/davfs2-1.7.0: segfault on accessing "lost+found'' -- possible cache co...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal critical (vote)
Assignee: Göktürk Yüksek
URL: https://savannah.nongnu.org/bugs/inde...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-10-18 13:55 UTC by sphakka
Modified: 2023-10-18 18:49 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Backtrace of mount.davfs (backtrace.log,1.11 KB, text/plain)
2023-10-18 18:49 UTC, sphakka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description sphakka 2023-10-18 13:55:57 UTC
As per URL, but it happens with a Seafile WebDAV mount -- I guess the server DAV implementation is irrelevant. Arch is affected as well, see <https://aur.archlinux.org/packages/davfs2>.

Tricky to reproduce as the mount point's "lost+found" dir must be populated with some files. Seafile WebDAV is not that stable, thus it might happen  frequently to have unsynced files for any reasons -- client suspend/hibernate (this is my most probable trigger scenario), server restart, etc.

The defect looks quite bad. Fortunately, it doesn't happen with stable davfs-1.6.0-r1: downgrading brings it back to normality although unsynced file changes might get lost.

Reproducible: Sometimes

Steps to Reproduce:
1. Configure and mount a (web)dav remote at, e.g., "/mnt/webdav/".
2. Edit remote files. 
3. Suspend the client machine, crash the editor, restart the dav server -- whatever can cause unsynced files ending up in "/mnt/webdav/lost+found".
4. Try accessing "/mnt/webdav/lost+found"

   $ ls "/mnt/webdav/lost+found"
Actual Results:  
Error from the command shell: 

  ls: cannot access '.../lost+found/...': Software caused connection abort
  ls: cannot access '.../lost+found/...': Transport endpoint is not connected
  ...

Dmesg:

  [Oct15 06:13] mount.davfs[15754]: segfault at 0 ip 00007f31da291ec8 sp 00007fff43bd1730 error 4 in libneon.so.27.5.4[7f31da28a000+17000] likely on CPU 0 (core 0, socket 0)
  [  +0.000013] Code: 00 00 41 57 41 56 41 55 41 54 55 89 f5 83 e5 01 53 48 89 fb f7 dd 66 81 e5 83 73 89 e8 48 83 ec 08 80 cc 40 83 e6 02 0f 45 e8 <0f> b6 07 84 c0 0f 84 bd 00 00 00 48 89 fa 45 31 e4 4c 8d 2d e0 06



Expected Results:  
"lost+found" correctly accessed.

Portage 3.0.51 (python 3.11.5-final-0, default/linux/amd64/17.1/no-multilib, gcc-13, glibc-2.37-r7, 6.1.57-gentoo-docker x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-6.1.57-gentoo-docker-x86_64-Intel-R-_Core-TM-_i7-4702MQ_CPU_@_2.20GHz-with-glibc2.37
KiB Mem:    16112296 total,   4504264 free
KiB Swap:   16777212 total,  15566240 free
Timestamp of repository gentoo: Tue, 17 Oct 2023 17:01:59 +0000
Head commit of repository gentoo: b1b2a2d69ed21affaf26fea051de5ce18199da93

Timestamp of repository xwing: Mon, 09 Oct 2023 11:02:53 +0000
Head commit of repository xwing: b718252b88dda7cbe6e767c205c5ba9cb5a24952

sh bash 5.1_p16-r6
ld GNU ld (Gentoo 2.40 p5) 2.40.0
app-misc/pax-utils:        1.3.5::gentoo
app-shells/bash:           5.1_p16-r6::gentoo
dev-lang/perl:             5.38.0-r1::gentoo
dev-lang/python:           3.10.13::gentoo, 3.11.5::gentoo
dev-lang/rust:             1.71.1::gentoo
dev-util/cmake:            3.26.5-r2::gentoo
dev-util/meson:            1.2.1-r1::gentoo
sys-apps/baselayout:       2.14::gentoo
sys-apps/openrc:           0.48::gentoo
sys-apps/sandbox:          2.38::gentoo
sys-devel/autoconf:        2.13-r7::gentoo, 2.71-r6::gentoo
sys-devel/automake:        1.16.5-r1::gentoo
sys-devel/binutils:        2.40-r5::gentoo
sys-devel/binutils-config: 5.5::gentoo
sys-devel/clang:           15.0.7-r3::gentoo, 16.0.6::gentoo
sys-devel/gcc:             12.3.1_p20230526::gentoo, 13.2.1_p20230826::gentoo
sys-devel/gcc-config:      2.11::gentoo
sys-devel/libtool:         2.4.7-r1::gentoo
sys-devel/lld:             15.0.7::gentoo, 16.0.6::gentoo
sys-devel/llvm:            15.0.7-r3::gentoo, 16.0.6::gentoo
sys-devel/make:            4.4.1-r1::gentoo
sys-kernel/linux-headers:  6.1::gentoo (virtual/os-headers)
sys-libs/glibc:            2.37-r7::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: git
    sync-uri: https://anongit.gentoo.org/git/repo/sync/gentoo.git
    priority: -1000
    volatile: False

xwing
    location: /var/db/repos/xwing
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/xwing.git
    masters: gentoo
    volatile: False

localrepo
    location: /var/db/repos/overlay/localrepo
    masters: gentoo
    priority: 10
    volatile: False

Installed sets: @audio, @cloud, @dev, @emacs, @emul, @fonts, @gkrellm, @graphix, @net, @office, @utilz, @video, @web, @webdev, @xfce
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=haswell -pipe -O2 -fomit-frame-pointer"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php8.1/ext-active/ /etc/php/cgi-php8.1/ext-active/ /etc/php/cli-php8.1/ext-active/ /etc/php/fpm-php8.1/ext-active/ /etc/php/phpdbg-php8.1/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=haswell -pipe -O2 -fomit-frame-pointer"
DISTDIR="/var/cache/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME"
FCFLAGS="-march=haswell -pipe -O2 -fomit-frame-pointer"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch parallel-install pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-march=haswell -pipe -O2 -fomit-frame-pointer"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LEX="flex"
LINGUAS=""
MAKEOPTS="-j9"
PKGDIR="/var/cache/binpkgs"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
SHELL="/bin/bash"
USE="alsa amd64 apng bittorrent bluetooth btrfs bzip2 cacert calendar caps cddb cdio clang cli corefonts crypt cups curl cvs dav1d dbus device-mapper djvu dri dvd dynamic-loading ebook elogind emacs eme-free enchant fam fbcon fortran fpm gdbm git glamor gnome-keyring gnutls gpm graphicsmagick gtk3 gtkstyle gui h323 hddtemp heif http hunspell iconv icu id3tag imagemagick introspection jabber jit jpeg jumbo-build kpathsea ladspa laptop latex lcms libnotify libsamplerate libtirpc lm_sensors lto luks1_default mng mp3 mplayer musepack musicbrainz mysql mysqli ncurses networkmanager nls nptl ntfs ntfsprogs objc objc++ ogg openmp openvg opus pam pcre pgo png policykit postscript ppds python3 readline rtmp scanner sdl seamonkey seccomp split-usr sql sqlite sqlitessh ssl system-av1 system-bootstrap system-cmark system-crontab system-ffmpeg system-harfbuzz system-icu system-jpeg system-libevent system-libvpx system-libyaml system-llvm system-mesa system-sqlite system-ssl system-webp system-zlib test-rust threads tordns truetype udisks unicode v4l v4l2 video vlc vorbis wavpack xattr xcb xcomposite xetex xfce xfs xkb xmp xorg xvfb zlib" ABI_X86="64" ADA_TARGET="gnat_2021" ALSA_CARDS="hda-intel usb-audio" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="pc" INPUT_DEVICES="keyboard mouse libinput" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php8-1" POSTGRES_TARGETS="postgres15" PYTHON_SINGLE_TARGET="python3_11" PYTHON_TARGETS="python3_11" RUBY_TARGETS="ruby31" SANE_BACKENDS="epson2 epkowa hp" VIDEO_CARDS="intel" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EMERGE_DEFAULT_OPTS, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LFLAGS, LIBTOOL, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS

=================================================================
                        Package Settings
=================================================================

net-fs/davfs2-1.7.0::gentoo was built with the following:
USE="nls (split-usr)"
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-10-18 13:58:28 UTC
Could you build davfs2+neon with debug symbols (https://wiki.gentoo.org/wiki/Debugging#Per-package) and then give a backtrace?
Comment 2 sphakka 2023-10-18 18:49:01 UTC
Weird, I'm unable to get a core dump... though attaching gdb to the mount.davfs process gives something. With:

  # /etc/portage/package.env
  net-fs/davfs2           debugsyms installsources
  net-libs/neon           debugsyms installsources


The test is

  $ ls /mnt/webdav/seafile/lost+found 

Backtrace:

Program received signal SIGSEGV, Segmentation fault.
ne_path_escapef (path=0x0, flags=<optimized out>) at ne_uri.c:497
497	    for (pnt = (const unsigned char *)path; *pnt != '\0'; pnt++) {
#0  ne_path_escapef (path=0x0, flags=<optimized out>) at ne_uri.c:497
#1  0x00007f61aaaff00a in ne_path_escape (path=<optimized out>) at ne_uri.c:484
#2  0x0000560b571d050a in dav_get_collection (path=0x0, props=props@entry=0x7ffef7646928) at webdav.c:712
#3  0x0000560b571c5382 in dav_lookup (nodep=nodep@entry=0x7ffef7646a58, parent=0x560b58d66e30, name=name@entry=0x560b58df2858 "dir-lost+found-ZectMQ", uid=<optimized out>) at cache.c:1029
#4  0x0000560b571c9404 in fuse_lookup () at dav_fuse.c:617
#5  dav_fuse_loop (device=5, mpoint=0x560b58d424d0 "/mnt/webdav/seafile", bufsize=<optimized out>, idle_time=10, is_mounted=<optimized out>, keep_on_running=0x560b571d96b8 <keep_on_running>, dbg=0) at dav_fuse.c:238
#6  0x0000560b571c0165 in main (argc=<optimized out>, argv=<optimized out>) at mount_davfs.c:352

HTH!
Comment 3 sphakka 2023-10-18 18:49:59 UTC
Created attachment 873110 [details]
Backtrace of mount.davfs