i386/110030: pkg_which hits segfault for non-root user, even after "portsdb -fu". Works fine for root though.

Amarendra Godbole amarendra.godbole at gmail.com
Wed Mar 7 11:20:05 UTC 2007


>Number:         110030
>Category:       i386
>Synopsis:       pkg_which hits segfault for non-root user, even after "portsdb -fu". Works fine for root though.
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-i386
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Mar 07 11:20:05 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator:     Amarendra Godbole
>Release:        6.2-RELEASE
>Organization:
VERITAS Software India Ltd.
>Environment:
FreeBSD dexter.vxindia.veritas.com 6.2-RELEASE FreeBSD 6.2-RELEASE #0: Fri Jan 12 11:05:30 UTC 2007     root at dessler.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP  i386
>Description:
Hi,

Running "pkg_which" as a non-root user hits a segfault resulting in a core dump from ruby. This happens even when the package database has been rebuilt with "pkgdb -fu", and PORTS_DBDRIVER is set to bdb1_hash or dbm_hash (got this from freshports.org). Here is copy of the session executing pkg_which:

---------------------------------------------------------
[amar at dexter ~]$ pkg_which bash
The pkgdb must be updated.  Please run 'pkgdb -u' as root.
[amar at dexter ~]$ sudo pkgdb -fu
Password:
--->  Updating the pkgdb
[Rebuilding the pkgdb <format:bdb_btree> in /var/db/pkg ... - 138 packages found (-0 +138) .......................................................................................................................................... done]
[amar at dexter ~]$ pkg_which bash
Permission denied
/usr/local/sbin/pkg_which:284: [BUG] Segmentation fault
ruby 1.8.5 (2006-12-25) [i386-freebsd6]

Abort trap: 6 (core dumped)
[amar at dexter ~]$ PORTS_DBDRIVER=bdb1_hash pkg_which bash
Permission denied
/usr/local/sbin/pkg_which:284: [BUG] Segmentation fault
ruby 1.8.5 (2006-12-25) [i386-freebsd6]

Abort trap: 6 (core dumped)
[amar at dexter ~]$ PORTS_DBDRIVER=dbm_hash pkg_which bash
Permission denied
/usr/local/sbin/pkg_which:284: [BUG] Segmentation fault
ruby 1.8.5 (2006-12-25) [i386-freebsd6]

Abort trap: 6 (core dumped)
[amar at dexter ~]$
---------------------------------------------------------


It works fine for root though

---------------------------------------------------------
dexter# whoami
root
dexter# pkg_which bash
bash-3.1.17
dexter# 
---------------------------------------------------------

Though this thing is documented in the pkg_which manpage, I find two inconsistencies here:
1. Segfault is hit even after "pkgdb -fu" is done.
2. It works fine for root user.

Thanks!

Best,
Amarendra
>How-To-Repeat:
See the "Full description" section for repro steps.
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-i386 mailing list