Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 103445 - deltup: Segmentation fault with some kde-packages
Summary: deltup: Segmentation fault with some kde-packages
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Stefan Schweizer (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-23 06:22 UTC by Stephan Loescher
Modified: 2005-11-14 02:16 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stephan Loescher 2005-08-23 06:22:55 UTC
This command gives an "Segmentation fault":
deltup -p -v -D /usr/portage/distfiles/
/tmp/kdebase-3.3.2.tar.bz2-kdebase-3.4.1.tar.bz2.dtu
In /usr/portage/distfiles the file kdebase-3.3.2.tar.bz2 with size 19995043 and
md5sum edbd721a2a4970977dfe5f45d9e38923 exists and is OK (bunzip -tv ...).
deltup works fine for all other packages.
deltup is version app-portage/deltup-0.4.2-r1.

Reproducible: Always
Steps to Reproduce:
1. deltup -p -v -D /usr/portage/distfiles/
/tmp/kdebase-3.3.2.tar.bz2-kdebase-3.4.1.tar.bz2.dtu
Actual Results:  
Output:
Segmentation fault

Expected Results:  
deltup should create the file kdebase-3.4.1.tar.bz2 from the old file
kdebase-3.3.2.tar.bz2 and the delta-patch
kdebase-3.3.2.tar.bz2-kdebase-3.4.1.tar.bz2.dtu

I found this bug while trying to update my Gentoo with the help of deltup
described in this HOWTO: http://gentoo-wiki.com/HOWTO_Install_Deltup

The strace stops with this message:
...
6708  read(1023, "BZh", 131072)         = 3
6708  read(1023, "", 131072)            = 0
6708  open("/tmp/.3zGrIh/000509", O_RDONLY) = -1 EMFILE (Too many open files)
6708  --- SIGSEGV (Segmentation fault) @ 0 (0) ---
6708  +++ killed by SIGSEGV +++

So I increased my ulimit for open files and added a lot of swap.
Then the strace stop here:

29134 read(19321, "BZh", 4)             = 3
29134 read(19321, "", 1)                = 0
29134 open("/tmp/.brGMBQ/009658", O_RDONLY) = 19322
29134 brk(0x2d0f3000)                   = 0x2d0c3000
29134 mmap2(NULL, 1048576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 
0) = -1 ENOMEM (Cannot allocate memory)
29134 mmap2(NULL, 2097152, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -
1, 0) = -1 ENOMEM (Cannot allocate memory)
29134 mmap2(NULL, 1048576, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -
1, 0) = -1 ENOMEM (Cannot allocate memory)
29134 mmap2(NULL, 2097152, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -
1, 0) = -1 ENOMEM (Cannot allocate memory)
29134 mmap2(NULL, 1048576, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -
1, 0) = -1 ENOMEM (Cannot allocate memory)
29134 close(19322)                      = 0
29134 --- SIGSEGV (Segmentation fault) @ 0 (0) ---
29134 +++ killed by SIGSEGV +++
Comment 1 Stephan Loescher 2005-08-23 06:47:39 UTC
I let it run in gdb for more debug-info:

Program received signal SIGSEGV, Segmentation fault.
0xb7e1ca4c in mempcpy () from /lib/libc.so.6
(gdb) bt
#0  0xb7e1ca4c in mempcpy () from /lib/libc.so.6
#1  0xb7e12b6e in _IO_file_xsputn () from /lib/libc.so.6
#2  0xb7e08b29 in fwrite () from /lib/libc.so.6
#3  0x0805332a in OFStream::write (this=0xbfffed90, data=0xbfffed90, 
    num=-1073746544) at file.h:75
#4  0x0804f735 in copy_bytes_to_file (infile=@0xbffff330, outfile=@0xbffff2b0, 
    numleft=6162949) at deltup.cpp:531
#5  0x08050ea4 in patchPackage (f=@0xbffff330) at deltup.cpp:637
#6  0x080525aa in applyPatchfile (fname=0xbffff330 "p\200\005\bж\005\b")
    at deltup.cpp:786
#7  0x08052e9a in main (argc=-1073746544, argv=0xbfffed90) at deltup.cpp:878
(gdb) quit
Comment 2 Stephan Loescher 2005-08-23 06:47:39 UTC
I let it run in gdb for more debug-info:

Program received signal SIGSEGV, Segmentation fault.
0xb7e1ca4c in mempcpy () from /lib/libc.so.6
(gdb) bt
#0  0xb7e1ca4c in mempcpy () from /lib/libc.so.6
#1  0xb7e12b6e in _IO_file_xsputn () from /lib/libc.so.6
#2  0xb7e08b29 in fwrite () from /lib/libc.so.6
#3  0x0805332a in OFStream::write (this=0xbfffed90, data=0xbfffed90, 
    num=-1073746544) at file.h:75
#4  0x0804f735 in copy_bytes_to_file (infile=@0xbffff330, outfile=@0xbffff2b0, 
    numleft=6162949) at deltup.cpp:531
#5  0x08050ea4 in patchPackage (f=@0xbffff330) at deltup.cpp:637
#6  0x080525aa in applyPatchfile (fname=0xbffff330 "p\200\005\bж\005\b")
    at deltup.cpp:786
#7  0x08052e9a in main (argc=-1073746544, argv=0xbfffed90) at deltup.cpp:878
(gdb) quit
Comment 3 Stefan Schweizer (RETIRED) gentoo-dev 2005-08-23 06:47:58 UTC
Does the same also happen with the newer version?

http://dev.gentoo.org/~genstef/files/overlay/deltup-0.4.3_pre2.ebuild
Comment 4 Stephan Loescher 2005-08-23 07:15:45 UTC
(In reply to comment #2)
Yes, but the returned error is now:
cleaning up
Segmentation fault

The backtrace:

Program received signal SIGSEGV, Segmentation fault.
0xb7df1a4c in mempcpy () from /lib/libc.so.6
(gdb) bt
#0  0xb7df1a4c in mempcpy () from /lib/libc.so.6
#1  0xb7de7b6e in _IO_file_xsputn () from /lib/libc.so.6
#2  0xb7dddb29 in fwrite () from /lib/libc.so.6
#3  0x0804a1a6 in OFStream::write (this=0xbffff220, data=0xbfffed20, 
    num=4294967295) at file.h:54
#4  0x0804abf3 in copy_bytes_to_file (infile=@0xbffff2b0, outfile=@0xbffff220, 
    numleft=6162949) at file.cpp:79
#5  0x0805179d in patchPackage (f=@0xbffff2b0) at deltup.cpp:417
#6  0x08052930 in applyPatchfile (fname=
        {static npos = 4294967295, _M_dataplus = {<std::allocator<char>> = {<No
data fields>}, _M_p = 0x805a6bc
"/home/loescher/trans/kdebase-3.3.2.tar.bz2-kdebase-3.4.1.tar.bz2.dtu"}, static
_S_empty_rep_storage = {0, 0, 4, 0}})
    at deltup.cpp:547
#7  0x08053231 in main (argc=6, argv=0xbffff614) at deltup.cpp:618
(gdb) quit
Comment 5 Stefan Schweizer (RETIRED) gentoo-dev 2005-08-23 07:35:30 UTC
Are you using the dynamic-deltup-server?
Where do you have the dtu file from?
Comment 6 Stephan Loescher 2005-08-23 11:26:54 UTC
I have installed getdelta:

echo "app-portage/deltup ~x86" >> /etc/portage/package.keywords
echo "dev-util/bdelta ~x86" >> /etc/portage/package.keywords
echo "app-portage/getdelta ~x86" >> /etc/portage/package.keywords
echo "app-portage/xdelta ~x86" >> /etc/portage/package.keywords
emerge getdelta xdelta
and
FETCHCOMMAND="/usr/bin/getdelta.sh \${URI}"
in /etc/make.conf

Then I have done "emerge -fuD" as usually, which loads dtu-files for tons of
packages, but not for kdebase:

>>> emerge (71 of 116) kde-base/kdebase-3.4.1-r1 to /
>>> Downloading http://distfiles.gentoo.org/distfiles/kdebase-3.4.1.tar.bz2
Searching for a previously downloaded file in /usr/portage/distfiles

We have following candidates to choose from 
kdebase-3.3.2.tar.bz2 

The best of all is ... kdebase-3.3.2.tar.bz2

Checking if this file is OK.

Trying to download kdebase-3.3.2.tar.bz2-kdebase-3.4.1.tar.bz2.dtu

--20:08:18-- 
http://linux01.gwdg.de/%7Enlissne/deltup.php?have=kdebase-3.3.2.tar.bz2&want=kdebase-3.4.1.tar.bz2&url=&version=0.7&time=1124820498
           =>
`deltup.php?have=kdebase-3.3.2.tar.bz2&want=kdebase-3.4.1.tar.bz2&url=&version=0.7&time=1124820498'
Resolving localhost... 127.0.0.1
Connecting to localhost[127.0.0.1]:8080... connected.
Proxy request sent, awaiting response... 302 Found
Location:
ftp://217.160.166.143/dtu/kdebase-3.3.2.tar.bz2-kdebase-3.4.1.tar.bz2.dtu
[following]
--20:08:34-- 
ftp://217.160.166.143/dtu/kdebase-3.3.2.tar.bz2-kdebase-3.4.1.tar.bz2.dtu
           => `kdebase-3.3.2.tar.bz2-kdebase-3.4.1.tar.bz2.dtu'
Connecting to localhost[127.0.0.1]:8080... connected.
Proxy request sent, awaiting response... 200 FTP Proxy OK
Length: unspecified [text/plain]

    [   <=>                               ] 4,963,744      8.01M/s             

20:08:44 (7.99 MB/s) - `kdebase-3.3.2.tar.bz2-kdebase-3.4.1.tar.bz2.dtu' saved
[4,963,744]

GOT kdebase-3.3.2.tar.bz2-kdebase-3.4.1.tar.bz2.dtu

Successfully fetched the dtu-file - let's build kdebase-3.4.1.tar.bz2...

/usr/bin/getdelta.sh: line 690: 29487 Segmentation fault      deltup -p -v -D
${DISTDIR} ${best_candidate}-${NEW_FILE}.dtu
mv: cannot stat `kdebase-3.4.1.tar.bz2': No such file or directory
The dtu could not be fetched, downloading full file from original URL

--20:08:47--  http://distfiles.gentoo.org/distfiles/kdebase-3.4.1.tar.bz2
           => `kdebase-3.4.1.tar.bz2'
Resolving localhost... 127.0.0.1
Connecting to localhost[127.0.0.1]:8080... connected.
Proxy request sent, awaiting response... 200 OK
Length: unspecified [application/x-tar]

    [                             <=>     ] 56,472         2.99K/s

So I think my dtu-File came from
ftp://217.160.166.143/dtu/kdebase-3.3.2.tar.bz2-kdebase-3.4.1.tar.bz2.dtu
The md5sum of this dtu-file is 77e03c9c325ced27b44dfcfb99c9de80.

Here is my /etc/deltup/getdelta.rc, but all values are defaults:

KDE_MIRROR="ftp://ftp.kde.org/pub/kde/stable"
LOCAL_MIRROR=""
DELTUP_SERVER="http://linux01.gwdg.de/~nlissne/deltup.php"
FETCH="/usr/bin/wget -t 1 --passive-ftp"
QUEUERETRY="15"
MAXIMUM_ACCEPTABLE_QUEUEPOS="15"
QUEUETIMEOUT="900"
CHECK_OLD_FILE="false"
REMOVE_OLD="false"
DO_NOT_REMOVE="/etc/deltup/do_not_remove"
REMOVE_INCOMPLETE_OLD_FILES="false"
VERBOSITY="true"
COLOR="true"
LOGFILE="/var/log/getdelta.log"
DELETE_LOG="true"
SEPARATED_WINDOW="false"
TERM_APP="aterm -tr -trsb -fg white -bg black -sh 70 -e tail -f "

Do you think I have a corrupt or wrong dtu-file?
Comment 7 Stephan Loescher 2005-11-14 02:16:43 UTC
This bug didin't appear anymore, so I think the dtu-files were corrupt.