NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/56080: tar(1) dumps core on nfs volume



>Number:         56080
>Category:       bin
>Synopsis:       tar(1) dumps core on nfs volume
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Mar 28 10:05:00 +0000 2021
>Originator:     Hauke Fath
>Release:        NetBSD 9.99.81
>Organization:
Falling Raindrops
>Environment:
	
	
System: NetBSD i386-pxe 9.99.81 NetBSD 9.99.81 (BLACKBOX-$Revision: 1.85 $) #0: Mon Mar 22 16:48:50 CET 2021  hauke%pizza.causeuse.org@localhost:/var/obj/netbsd-builds/developer/amd64/sys/arch/amd64/compile/BLACKBOX amd64
Architecture: x86_64
Machine: amd64

% ldd /bin/tar
/bin/tar:
	-larchive.4 => /usr/lib/libarchive.so.4
	-lbz2.1 => /usr/lib/libbz2.so.1
	-lc.12 => /lib/libc.so.12
	-lcrypto.14 => /lib/libcrypto.so.14
	-lcrypt.1 => /lib/libcrypt.so.1
	-lexpat.2 => /usr/lib/libexpat.so.2
	-llzma.2 => /lib/liblzma.so.2
	-lpthread.1 => /lib/libpthread.so.1
	-lz.1 => /lib/libz.so.1
% ident /bin/tar
/bin/tar:
     $NetBSD: crt0.S,v 1.4 2018/11/26 17:37:46 joerg Exp $
     $NetBSD: crt0-common.c,v 1.23 2018/12/28 20:12:35 christos Exp $
     $NetBSD: crti.S,v 1.1 2010/08/07 18:01:35 joerg Exp $
     $NetBSD: crtbegin.S,v 1.2 2010/11/30 18:37:59 joerg Exp $
     $NetBSD: crtend.S,v 1.1 2010/08/07 18:01:34 joerg Exp $
     $NetBSD: crtn.S,v 1.1 2010/08/07 18:01:35 joerg Exp $
%

>Description:

Building (packaging) editors/xemacs-nox11 on a net-booted -current
installation fails when libarchive-as-tar invoked from
work/xemacs-21.4.24/Makefile dumps core because of an assertion
failure:
 
[hauke@i386-pxe] /<6>xemacs-21.4.24/lisp > pwd
/var/obj/pkgsrc/editors/xemacs-nox11/work/xemacs-21.4.24/lisp
[hauke@i386-pxe] /<6>xemacs-21.4.24/lisp > tar -cf /dev/null .
Segmentation fault (core dumped)
[hauke@i386-pxe] /<6>xemacs-21.4.24/lisp > gdb /bin/tar tar.core
GNU gdb (GDB) 11.0.50.20200914-git
Copyright (C) 2020 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--netbsd".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
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 /bin/tar...
Reading symbols from /usr/libdata/debug//bin/tar.debug...
[New process 6101]
Core was generated by `tar'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00006f8f68467866 in _citrus_iconv_convert (nresults=0x7f7fff388ab8, flags=0, outbytes=0x7f7fff388b38, out=0x7f7fff388b30, 
    inbytes=0x7f7fff388b28, in=0x7f7fff388b20, cv=0x6f8f6a89b0e0) at /usr/src/lib/libc/citrus/citrus_iconv.h:61
61		_DIAGASSERT(cv && cv->cv_shared && cv->cv_shared->ci_ops &&
(gdb) bt
#0  0x00006f8f68467866 in _citrus_iconv_convert (nresults=0x7f7fff388ab8, flags=0, outbytes=0x7f7fff388b38, out=0x7f7fff388b30, 
    inbytes=0x7f7fff388b28, in=0x7f7fff388b20, cv=0x6f8f6a89b0e0) at /usr/src/lib/libc/citrus/citrus_iconv.h:61
#1  _iconv (handle=handle@entry=0x6f8f6a89b0e0, in=in@entry=0x7f7fff388b20, szin=szin@entry=0x7f7fff388b28, out=out@entry=0x7f7fff388b30, 
    szout=szout@entry=0x7f7fff388b38) at /usr/src/lib/libc/iconv/iconv.c:97
#2  0x00006f8f6a483834 in iconv_strncat_in_locale (as=0x6f8f6a832158, _p=<optimized out>, length=<optimized out>, sc=0x6f8f6a883070)
    at /usr/src/external/bsd/libarchive/dist/libarchive/archive_string.c:2039
#3  0x00006f8f6a4844ba in archive_strncat_l (as=as@entry=0x6f8f6a832158, _p=<optimized out>, n=<optimized out>, sc=<optimized out>)
    at /usr/src/external/bsd/libarchive/dist/libarchive/archive_string.c:1998
#4  0x00006f8f6a48459a in archive_strncpy_l (as=as@entry=0x6f8f6a832158, _p=<optimized out>, n=<optimized out>, sc=<optimized out>)
    at /usr/src/external/bsd/libarchive/dist/libarchive/archive_string.c:1944
#5  0x00006f8f6a4847d9 in archive_mstring_get_mbs_l (aes=0x6f8f6a832110, p=0x7f7fff388c58, length=0x7f7fff388c88, sc=<optimized out>)
    at /usr/src/external/bsd/libarchive/dist/libarchive/archive_string.c:4005
#6  0x00006f8f6a47b810 in _archive_entry_pathname_l (entry=<optimized out>, p=<optimized out>, len=<optimized out>, sc=<optimized out>)
    at /usr/src/external/bsd/libarchive/dist/libarchive/archive_entry.c:598
#7  0x00006f8f6a41f051 in get_entry_pathname (a=0x6f8f6a88d000, entry=<optimized out>, name=<optimized out>, length=<optimized out>, 
    sc=<optimized out>) at /usr/src/external/bsd/libarchive/dist/libarchive/archive_write_set_format_pax.c:428
#8  0x00006f8f6a41f5da in archive_write_pax_header (a=0x6f8f6a88d000, entry_original=0x6f8f6a831500)
    at /usr/src/external/bsd/libarchive/dist/libarchive/archive_write_set_format_pax.c:839
#9  0x00006f8f6a46a1da in _archive_write_header (_a=0x6f8f6a88d000, entry=0x6f8f6a831500)
    at /usr/src/external/bsd/libarchive/dist/libarchive/archive_write.c:650
#10 0x00000000e4c08ac2 in write_entry (bsdtar=bsdtar@entry=0x7f7fff389590, a=a@entry=0x6f8f6a88d000, entry=0x6f8f6a831500)
    at /usr/src/external/bsd/libarchive/dist/tar/write.c:974
#11 0x00000000e4c08cac in write_file (entry=<optimized out>, a=0x6f8f6a88d000, bsdtar=0x7f7fff389590)
    at /usr/src/external/bsd/libarchive/dist/tar/write.c:962
#12 write_hierarchy (bsdtar=bsdtar@entry=0x7f7fff389590, a=a@entry=0x6f8f6a88d000, path=path@entry=0x7f7fff389dd2 ".")
    at /usr/src/external/bsd/libarchive/dist/tar/write.c:941
#13 0x00000000e4c0907e in write_archive (a=a@entry=0x6f8f6a88d000, bsdtar=bsdtar@entry=0x7f7fff389590)
    at /usr/src/external/bsd/libarchive/dist/tar/write.c:513
#14 0x00000000e4c098a4 in tar_mode_c (bsdtar=bsdtar@entry=0x7f7fff389590) at /usr/src/external/bsd/libarchive/dist/tar/write.c:247
#15 0x00000000e4c0ba4d in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/external/bsd/libarchive/dist/tar/bsdtar.c:910
(gdb) print *cv
$1 = {cv_shared = 0x6c652e73, cv_closure = 0x6f8f6a80b050}
(gdb) print *cv->cv_shared
Cannot access memory at address 0x6c652e73
(gdb)

where 0x6c652e73 happens to be ascii 's.el'.

See also
<https://mail-index.netbsd.org/current-users/2021/03/26/msg040510.html> ff.

	
>How-To-Repeat:

	On a net-booted instance of -current amd64, with pkgsrc
	mounted r/o and WRKOBJDIR=/var/obj/pkgsrc, 'make extract'
	editors/xemacs-nox11.

	Change to
	${WRKOBJDIR}/editors/xemacs-nox11/work/xemacs-21.4.24/lisp and
	run '/bin/tar -cf /dev/null .'.

	The assertion failure appears to be somewhat specific to the
	tared up directory.

	/bin/pax works here, as does pkgsrc gtar.

	
>Fix:

	None, yet. 

	A workaround is to have the xemacs Makefile use GNU tar	instead.

	

>Unformatted:
 	
 	


Home | Main Index | Thread Index | Old Index