xdelta -v -s some10GBfile second10GBfile deltafile throws: *** buffer overflow detected ***: xdelta3 terminated ======= Backtrace: ========= /lib64/libc.so.6(__fortify_fail+0x37)[0x7f952f269db7] /lib64/libc.so.6(+0xfec30)[0x7f952f267c30] /lib64/libc.so.6(+0xfdfa9)[0x7f952f266fa9] /lib64/libc.so.6(_IO_default_xsputn+0xc9)[0x7f952f1df7b9] /lib64/libc.so.6(_IO_vfprintf+0xf31)[0x7f952f1af0b1] /lib64/libc.so.6(__vsprintf_chk+0x9d)[0x7f952f26704d] /lib64/libc.so.6(__sprintf_chk+0x7f)[0x7f952f266f8f] xdelta3[0x40c6a3] xdelta3[0x4182fe] xdelta3[0x41abd8] /lib64/libc.so.6(__libc_start_main+0xfd)[0x7f952f187d2d] xdelta3[0x401599] ======= Memory map: ======== 00400000-00422000 r-xp 00000000 fd:04 1042612 /usr/bin/xdelta3 00621000-00622000 r--p 00021000 fd:04 1042612 /usr/bin/xdelta3 00622000-00623000 rw-p 00022000 fd:04 1042612 /usr/bin/xdelta3 00623000-0062d000 rw-p 00000000 00:00 0 01da3000-01dc4000 rw-p 00000000 00:00 0 [heap] 7f952a748000-7f952a75e000 r-xp 00000000 09:01 271 /lib64/libgcc_s.so.1 7f952a75e000-7f952a95d000 ---p 00016000 09:01 271 /lib64/libgcc_s.so.1 7f952a95d000-7f952a95e000 r--p 00015000 09:01 271 /lib64/libgcc_s.so.1 7f952a95e000-7f952a95f000 rw-p 00016000 09:01 271 /lib64/libgcc_s.so.1 7f952a967000-7f952f169000 rw-p 00000000 00:00 0 7f952f169000-7f952f2e3000 r-xp 00000000 09:01 8991 /lib64/libc-2.12.2.so 7f952f2e3000-7f952f4e2000 ---p 0017a000 09:01 8991 /lib64/libc-2.12.2.so 7f952f4e2000-7f952f4e6000 r--p 00179000 09:01 8991 /lib64/libc-2.12.2.so 7f952f4e6000-7f952f4e7000 rw-p 0017d000 09:01 8991 /lib64/libc-2.12.2.so 7f952f4e7000-7f952f4ec000 rw-p 00000000 00:00 0 7f952f4ec000-7f952f56d000 r-xp 00000000 09:01 8218 /lib64/libm-2.12.2.so 7f952f56d000-7f952f76c000 ---p 00081000 09:01 8218 /lib64/libm-2.12.2.so 7f952f76c000-7f952f76d000 r--p 00080000 09:01 8218 /lib64/libm-2.12.2.so 7f952f76d000-7f952f76e000 rw-p 00081000 09:01 8218 /lib64/libm-2.12.2.so 7f952f76e000-7f952f78e000 r-xp 00000000 09:01 8224 /lib64/ld-2.12.2.so 7f952f981000-7f952f984000 rw-p 00000000 00:00 0 7f952f98c000-7f952f98d000 rw-p 00000000 00:00 0 7f952f98d000-7f952f98e000 r--p 0001f000 09:01 8224 /lib64/ld-2.12.2.so 7f952f98e000-7f952f98f000 rw-p 00020000 09:01 8224 /lib64/ld-2.12.2.so 7f952f98f000-7f952f990000 rw-p 00000000 00:00 0 7fff3fb48000-7fff3fb69000 rw-p 00000000 00:00 0 [stack] 7fff3fbf2000-7fff3fbf3000 r-xp 00000000 00:00 0 [vdso] ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall] Aborted (core dumped) Here is backtrace: (gdb) thread apply all bt Thread 1 (Thread 22926): #0 0x00007f952f19ca05 in raise () from /lib64/libc.so.6 #1 0x00007f952f19e08f in abort () from /lib64/libc.so.6 #2 0x00007f952f1db52a in __libc_message () from /lib64/libc.so.6 #3 0x00007f952f269db7 in __fortify_fail () from /lib64/libc.so.6 #4 0x00007f952f267c30 in __chk_fail () from /lib64/libc.so.6 #5 0x00007f952f266fa9 in _IO_str_chk_overflow () from /lib64/libc.so.6 #6 0x00007f952f1df7b9 in _IO_default_xsputn () from /lib64/libc.so.6 #7 0x00007f952f1af0b1 in vfprintf () from /lib64/libc.so.6 #8 0x00007f952f26704d in __vsprintf_chk () from /lib64/libc.so.6 #9 0x00007f952f266f8f in __sprintf_chk () from /lib64/libc.so.6 #10 0x000000000040c6a3 in sprintf (stream=0x7fff3fb65b40, cmd=<value optimized out>, sfile=0x7fff3fb66940, source=<value optimized out>) at /usr/include/bits/stdio2.h:34 #11 main_set_source (stream=0x7fff3fb65b40, cmd=<value optimized out>, sfile=0x7fff3fb66940, source=<value optimized out>) at xdelta3-blkcache.h:244 #12 0x00000000004182fe in main_input (cmd=CMD_ENCODE, ifile=0x7fff3fb66a00, ofile=<value optimized out>, sfile=<value optimized out>) at xdelta3-main.h:3161 #13 0x000000000041abd8 in main (argc=2, argv=<value optimized out>) at xdelta3-main.h:3935 xdelta started without "-v" doesn't crash with segfault. Reproducible: Always
# emerge --info Portage 2.1.10.3 (default/linux/amd64/10.0/server, gcc-4.4.5, glibc-2.12.2-r0, 2.6.39-gentoo-r3 x86_64) ================================================================= System uname: Linux-2.6.39-gentoo-r3-x86_64-Intel-R-_Core-TM-2_Quad_CPU_Q9400_@_2.66GHz-with-gentoo-2.0.3 Timestamp of tree: Wed, 24 Aug 2011 05:30:01 +0000 app-shells/bash: 4.1_p9 dev-lang/python: 2.7.1-r1, 3.1.3-r1 dev-util/cmake: 2.8.4-r1 dev-util/pkgconfig: 0.26 sys-apps/baselayout: 2.0.3 sys-apps/openrc: 0.8.3-r1 sys-apps/sandbox: 2.4 sys-devel/autoconf: 2.68 sys-devel/automake: 1.11.1 sys-devel/binutils: 2.21.1 sys-devel/gcc: 4.4.5 sys-devel/gcc-config: 1.4.1-r1 sys-devel/libtool: 2.4-r1 sys-devel/make: 3.82 sys-kernel/linux-headers: 2.6.36.1 (virtual/os-headers) sys-libs/glibc: 2.12.2 Repositories: gentoo ACCEPT_KEYWORDS="amd64" ACCEPT_LICENSE="* -@EULA dlj-1.1" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-O2 -pipe -march=native -pipe" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/share/openvpn/easy-rsa" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo" CXXFLAGS="-O2 -pipe -march=native -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="assume-digests binpkg-logs collision-protect distlocks ebuild-locks fixlafiles fixpackages news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch" FFLAGS="" GENTOO_MIRRORS="http://distfiles.gentoo.org" LC_ALL="pl_PL.utf8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" LINGUAS="pl en" MAKEOPTS="-j4 -l 5" PKGDIR="/usr/portage/packages" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_EXTRA_OPTS="-O" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="acl amd64 bash-completion bzip2 caps cli cracklib crypt cxx device-mapper dri fortran glibc-omitfp gpm hpn iconv iproute2 logrotate mmap mmx modules mudflap multilib ncurses network-cron nls nptl nptlonly openmp pam pcre pppd readline session slang snmp sse sse2 sse3 ssl ssse3 sysfs threads threadsafe truetype unicode urandom vhosts vim vim-pager vim-syntax xml xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" APACHE2_MPMS="prefork" CALLIGRA_FEATURES="kexi words flow plan stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="pl en" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga neomagic nouveau nv r128 radeon savage sis tdfx trident vesa via vmware dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS
Can you report this to upstream? http://xdelta.org/
And also try this patch to get it compiled without -O3: http://pkgs.fedoraproject.org/gitweb/?p=xdelta.git;a=blob_plain;f=xdelta30-cflags.patch;h=a206e670c21787595942edb5cfa9022945b8a2e3;hb=HEAD
Patch doesn't apply (ebuild seeds 03 flags). I've added "include config.mk" mannualy then i got: Makefile:60: config.mak: No such file or directory It looks like issue: http://code.google.com/p/xdelta/issues/detail?id=125 , so upstream knows about it. I can't see any commits since one year. It doesn't sounds well.
+*xdelta-3.0.0-r1 (02 Apr 2012) + + 02 Apr 2012; Pacho Ramos <pacho@gentoo.org> + +files/01_bigger_print_buffers.patch, + +files/02_replace_sprintf_with_snprintf.patch, + +files/03_fix_pipe_draining_and_closing.patch, +xdelta-3.0.0-r1.ebuild: + Fix overflows with ThePythonicCow's patches, bug #380473 by Marcin Mirosław. +
Thanks for keeping eyes on bug!