pkgsrc-Bugs archive

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

pkg/39060: segfault in pkg_delete on linux/x86_64 arch (and solution)



>Number:         39060
>Category:       pkg
>Synopsis:       segfault in pkg_delete on linux/x86_64 arch (and solution)
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jun 28 20:10:03 +0000 2008
>Originator:     Piotr Meyer
>Release:        Linux CentOS 5.2
>Organization:
>Environment:
Linux testhost.sm.pl 2.6.18-92.1.6.el5 #1 SMP Wed Jun 25 13:45:47 EDT 2008 
x86_64 x86_64 x86_64 GNU/Linux
>Description:

pkg_delete in pkgsrc-current segfaults on linux/amd64: after remove
includes for "nbcompat/md5.h" and others in ver. 1.40 of nbcompat.h
(in libnbcompat) gcc hasn't definition of MD5File called in plist.c
(in pkg_install). It leading to assignement values of different size
in line 562 and core dump after calling 'strcmp' in line 564 of plist.c:

562: if ((cp = MD5File(tmp, buf)) != NULL) {
563:        /* Mismatch? */
564:        if (strcmp(cp, p->next->name + ChecksumHeaderLen) != 0) {
565:                printf("original MD5 checksum failed, %s: %s\n",
566:                   Force ? "deleting anyway" : "not deleting", tmp);
567:                if (!Force) {
568:                        fail = FAIL;
569:                        continue;
570:                }
571:       }
572: }

"Affected" files: 
pkgtools/pkg_install/lib/plist.c,v 1.19
pkgtools/libnbcompat/files/nbcompat.h,v 1.40


>How-To-Repeat:
Try do bootstrap pkgsrc-current from ~ 20080627 on 64-bit linux distro, build 
some packages and then try delete some of them.
>Fix:

Include "nbcompat/md5.h" in non-native build of pkg_install.



Home | Main Index | Thread Index | Old Index