Subject: pkg/10322: pkg_install-20000511.tar.gz: main.o: Undefined symbol `_asprintf' referenced from text segment
To: None <gnats-bugs@gnats.netbsd.org>
From: Olaf Seibert <rhialto@polder.ubc.kun.nl>
List: netbsd-bugs
Date: 06/08/2000 05:14:14
>Number:         10322
>Category:       pkg
>Synopsis:       main.o: Undefined symbol `_asprintf' refer enced from text segment in pkg_install-20000511.tar.gz
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jun 08 05:15:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Olaf Seibert
>Release:        1.3.3
>Organization:
	
>Environment:
>Description:
	
	When trying the latest pkgsrc.tar.gz, I was told to install the
	newest verion of the package tools. When building these, I get
	the following:

	all ===> delete
	cc -O  -Werror  -I/usr/tmp/pkgtools/pkg_install/work/pkg_install/delete/../lib  -DBINDIR='"/usr/sbin"' -DCHMOD='"/bin/chmod"' -DCHOWN='"/usr/sbin/chown"' -DCHGRP='"/usr/bin/chgrp"' -c main.c
	cc -O  -Werror  -I/usr/tmp/pkgtools/pkg_install/work/pkg_install/delete/../lib  -DBINDIR='"/usr/sbin"' -DCHMOD='"/bin/chmod"' -DCHOWN='"/usr/sbin/chown"' -DCHGRP='"/usr/bin/chgrp"' -c perform.c
	cc  -Wl,-R/usr/lib -L/usr/lib -Wl,-R/usr/lib -L/usr/lib  -o pkg_delete main.o perform.o -L/usr/tmp/pkgtools/pkg_install/work/pkg_install/lib -linstall
	main.o: Undefined symbol `_asprintf' referenced from text segment
	pen.o: warning: mktemp() possibly used unsafely, consider using mkstemp()

>How-To-Repeat:
	try to install cdrdao, which was not present in the previous
	pkgsrc I had installed.
>Fix:
	Replace the following in pkg_install/delete/main,c

	        asprintf(&fn, "%s/%s", _pkgdb_getPKGDB_DIR(), pkg);

	with

		fn = malloc(4096);
		snprintf(fn, 4096, "%s/%s", _pkgdb_getPKGDB_DIR(), pkg); 

	maybe conditionally compiled on NetBSD version.

	Do the same in delete/main.c.

-Olaf.
-- 
___ Olaf 'Rhialto' Seibert - rhialto@polder   -- Ah only did well at school
\X/ land.nl      -- tae git intae an O level class tae git away fae Begbie.
>Release-Note:
>Audit-Trail:
>Unformatted:
 >Environmen:
 	<machine, os, target, libraries (multiple lines)>
 System: NetBSD klei.intern.polderland.nl 1.3.3 NetBSD 1.3.3 (KLEI) #16: Tue May 18 18:08:15 CEST 1999 rhialto@klei.intern.polderland.nl:/usr/src/sys/arch/i386/compile/KLEI i386