From owner-freebsd-ports-bugs@FreeBSD.ORG Thu Sep 25 17:49:08 2014 Return-Path: Delivered-To: freebsd-ports-bugs@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 07444268 for ; Thu, 25 Sep 2014 17:49:08 +0000 (UTC) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C737E76F for ; Thu, 25 Sep 2014 17:49:07 +0000 (UTC) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.14.9/8.14.9) with ESMTP id s8PHn7hg044649 for ; Thu, 25 Sep 2014 17:49:07 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-ports-bugs@FreeBSD.org Subject: [Bug 193928] New: pkg2ng always immediately seg faults on converting old package database Date: Thu, 25 Sep 2014 17:49:07 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports Tree X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: freebsd@spatula.net X-Bugzilla-Status: Needs Triage X-Bugzilla-Priority: Normal X-Bugzilla-Assigned-To: freebsd-ports-bugs@FreeBSD.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 17:49:08 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=193928 Bug ID: 193928 Summary: pkg2ng always immediately seg faults on converting old package database Product: Ports Tree Version: Latest Hardware: Any OS: Any Status: Needs Triage Severity: Affects Some People Priority: Normal Component: Individual Port(s) Assignee: freebsd-ports-bugs@FreeBSD.org Reporter: freebsd@spatula.net Updating from an older 8.2-Stable to 8.4-Stable, after running /usr/local/sbin/pkg2ng, pkg immediately seg faults: Converting packages from /var/db/pkg Converting en-freebsd-doc-20110110... Child process pid=21252 terminated abnormally: Segmentation fault: 11 After building again with debug symbols, gdb provides the following stack trace: #0 0x000000080175412a in strlcpy () from /lib/libc.so.7 #1 0x00000008006df44b in plist_new (pkg=0x801a9c800, stage=0x0) at pkg_ports.c:1083 #2 0x00000008006dfd14 in ports_parse_plist (pkg=0x801a9c800, plist=0x7fffffffdec0 "/var/db/pkg/en-freebsd-doc-20110110/+CONTENTS", stage=0x0) at pkg_ports.c:1140 #3 0x000000080070cd34 in pkg_old_load_from_path (pkg=0x801a9c800, path=0x7fffffffe380 "/var/db/pkg/en-freebsd-doc-20110110") at pkg_old.c:72 #4 0x000000000040e20d in convert_from_old (pkg_add_dbdir=0x425b3d "/var/db/pkg", dry_run=false) at convert.c:308 #5 0x000000000040e471 in exec_convert (argc=0, argv=0x7fffffffeaf8) at convert.c:368 #6 0x00000000004144d9 in main (argc=1, argv=0x7fffffffeaf0) at main.c:822 In frame 1: 1083 strlcpy(p->prefix, prefix, sizeof(p->prefix)); prefix is a null pointer, so the strlcpy seg faults. This suggests that the previous line: pkg_get(pkg, PKG_PREFIX, &prefix); Set &prefix to a null pointer, which was unchecked before the strlcpy. As a result no errors are provided, no warnings offered, no workarounds are performed, and the program crashes instead of handling whatever problem exists gracefully. It appears to be trying to work with "/var/db/pkg/en-freebsd-doc-20110110/+CONTENTS" at the time of the crash. How-To-Repeat: Have an older ports db. Try to upgrade. Fix: Not known at this time. -- You are receiving this mail because: You are the assignee for the bug.