Bug 374 - make hangs on Solaris 8/9
Summary: make hangs on Solaris 8/9
Status: RESOLVED WONTFIX
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: Build environment (show other bugs)
Version: 3.0.0preX
Hardware: All Solaris
: P2 normal
Target Milestone: none
Assignee: Tim Potter
QA Contact:
URL:
Keywords:
: 379 (view as bug list)
Depends on:
Blocks: 669 807
  Show dependency treegraph
 
Reported: 2003-08-29 13:53 UTC by Brian Dudek
Modified: 2005-11-14 09:26 UTC (History)
3 users (show)

See Also:


Attachments
Fix make proto argument bug (729 bytes, patch)
2003-09-15 20:08 UTC, Tim Potter
no flags Details
Replace 'tr' with sed (413 bytes, patch)
2003-10-13 12:38 UTC, Brian King
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Brian Dudek 2003-08-29 13:53:21 UTC
make hangs on both Solaris 8 and 9 using GCC 3.2.3

The no ./configure options have been passed.

# make
Using FLAGS =  -g -O2 -I./popt -Iinclude -I/opt/samba-3.0.0rc2/source/include -
I/opt/samba-3.0.0rc2/source/ubiqx -I/opt/samba-3.0.0rc2/source/smbwrapper  -I. -
D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/opt/samba-3.0.0rc2/source    
      LIBS = -lsec -lgen -lresolv -lsocket -lnsl -ldl
      LDSHFLAGS = -G 
      LDFLAGS = 
Generating smbd/build_options.c
Building include/proto.h
creating /opt/samba-3.0.0rc2/source/include/proto.h

I have "truss"ed  the four make processes that are left running, each are 
sleeping:

ROOT@cassiope ~ # truss -f -p 2296
2296:	waitid(P_PID, 2297, 0xFFBEE100, WEXITED|WTRAPPED|WNOWAIT) (sleeping...)
^CROOT@cassiope ~ # truss -f -p 2297
2297:	waitid(P_PID, 2306, 0xFFBEDC88, WEXITED|WTRAPPED|WNOWAIT) (sleeping...)
^CROOT@cassiope ~ # truss -f -p 2306
2306:	read(0, 0xFF2C35E4, 1024)	(sleeping...)
ROOT@cassiope ~ # truss -f -p 2287
2287:	wait()				(sleeping...)


These are the ps outputs of the process that remain:

root      2287  0.0  0.3 1728 1536 pts/8    S 14:30:00  0:00 make
root      2296  0.0  0.2 1104  896 pts/8    S 14:30:01  0:00 /bin/sh -c 
cd /opt/samba-3.0.0rc2/source && /bin/sh /opt/samba-3.0.0rc2/source/
root      2297  0.0  0.2 1080  880 pts/8    S 14:30:01  0:00 /bin/sh /opt/samba-
3.0.0rc2/source/script/mkproto.sh nawk -h _PROTO_H_ /opt/samba-
3.0.0rc2/source/include/proto.h smbd/server.o smbd/files.o smbd/chgpasswd.o 
smbd/connection.o smbd/utmp.o smbd/session.o smbd/dfree.o smbd/dir.o 
smbd/password.o smbd/conn.o smbd/fileio.o smbd/ipc.o smbd/lanman.o 
smbd/negprot.o smbd/message.o smbd/nttrans.o smbd/pipes.o smbd/reply.o 
smbd/sesssetup.o smbd/trans2.o smbd/uid.o smbd/dosmode.o smbd/filename.o 
smbd/open.o smbd/close.o smbd/blocking.o smbd/sec_ctx.o smbd/srvstr.o 
smbd/vfs.o smbd/vfs-wrap.o smbd/statcache.o smbd/posix_acls.o lib/sysacls.o 
lib/server_mutex.o smbd/process.o smbd/service.o smbd/error.o 
printing/printfsp.o lib/util_seaccess.o lib/sysquotas.o smbd/change_trust_pw.o 
smbd/fake_file.o smbd/quotas.o smbd/ntquotas.o smbd/mangle.o smbd/mangle_hash.o 
smbd/mangle_map.o smbd/mangle_hash2.o nmbd/asyncdns.o nmbd/nmbd.o 
nmbd/nmbd_become_dmb.o nmbd/nmbd_become_lmb.o nmbd/nmbd_browserdb.o 
nmbd/nmbd_browsesync.o nmbd/nmbd_elections.o nmbd/nmbd_incomingdgrams.o 
nmbd/nmbd_incomingrequests.o nmbd/nmbd_lmhosts.o nmbd/nmbd_logonnames.o 
nmbd/nmbd_mynames.o nmbd/nmbd_namelistdb.o nmbd/nmbd_namequery.o 
nmbd/nmbd_nameregister.o nmbd/nmbd_namerelease.o nmbd/nmbd_nodestatus.o 
nmbd/nmbd_packets.o nmbd/nmbd_processlogon.o nmbd/nmbd_responserecordsdb.o 
nmbd/nmbd_sendannounce.o nmbd/nmbd_serverlistdb.o nmbd/nmbd_subnetdb.o 
nmbd/nmbd_winsproxy.o nmbd/nmbd_winsserver.o nmbd/nmbd_workgroupdb.o 
nmbd/nmbd_synclists.o web/cgi.o web/diagnose.o web/startstop.o web/statuspage.o 
web/swat.o web/neg_lang.o lib/version.o lib/charcnv.o lib/debug.o lib/fault.o 
lib/getsmbpass.o lib/interface.o lib/md4.o lib/interfaces.o lib/pidfile.o 
lib/replace.o lib/replace1.o lib/signal.o lib/system.o lib/sendfile.o 
lib/time.o lib/ufc.o lib/genrand.o lib/username.o lib/util_getent.o 
lib/util_pw.o lib/access.o lib/smbrun.o lib/bitmap.o lib/crc32.o lib/snprintf.o 
lib/dprintf.o lib/xfile.o lib/wins_srv.o lib/util_str.o lib/clobber.o 
lib/util_sid.o lib/util_uuid.o lib/util_unistr.o lib/util_file.o 
lib/data_blob.o lib/util.o lib/util_sock.o lib/sock_exec.o lib/util_sec.o 
lib/talloc.o lib/hash.o lib/substitute.o lib/fsusage.o lib/ms_fnmatch.o 
lib/select.o lib/messages.o lib/tallocmsg.o lib/dmallocmsg.o 
libsmb/smb_signing.o lib/md5.o lib/hmacmd5.o lib/iconv.o lib/smbpasswd.o 
nsswitch/wb_client.o nsswitch/wb_common.o lib/pam_errors.o intl/lang_tdb.o 
lib/account_pol.o lib/adt_tree.o lib/gencache.o tdb/tdb.o tdb/spinlock.o 
tdb/tdbutil.o tdb/tdbback.o lib/module.o lib/ldap_escape.o libsmb/clientgen.o 
libsmb/cliconnect.o libsmb/clifile.o libsmb/clikrb5.o libsmb/clispnego.o 
libsmb/asn1.o libsmb/clirap.o libsmb/clierror.o libsmb/climessage.o 
libsmb/clireadwrite.o libsmb/clilist.o libsmb/cliprint.o libsmb/clitrans.o 
libsmb/clisecdesc.o libsmb/clidgram.o libsmb/clistr.o libsmb/cliquota.o 
libsmb/clifsinfo.o libsmb/smberr.o libsmb/credentials.o libsmb/pwd_cache.o 
libsmb/clioplock.o libsmb/errormap.o libsmb/clirap2.o libsmb/passchange.o 
libsmb/doserr.o rpc_parse/parse_prs.o rpc_parse/parse_sec.o 
rpc_parse/parse_misc.o libsmb/nterr.o libsmb/smbdes.o libsmb/smbencrypt.o 
libsmb/ntlmssp.o libsmb/ntlmssp_parse.o libsmb/ntlmssp_sign.o 
libsmb/unexpected.o libsmb/namecache.o libsmb/nmblib.o libsmb/namequery.o 
libsmb/conncache.o smbwrapper/smbw.o smbwrapper/smbw_dir.o 
smbwrapper/smbw_stat.o smbwrapper/realcalls.o smbwrapper/shared.o 
smbwrapper/smbw_cache.o smbwrapper/wrapped.o torture/torture.o torture/nbio.o 
torture/scanner.o torture/utable.o torture/denytest.o torture/mangle_test.o 
rpcclient/rpcclient.o rpcclient/cmd_lsarpc.o rpcclient/cmd_samr.o 
rpcclient/cmd_spoolss.o rpcclient/cmd_netlogon.o rpcclient/cmd_srvsvc.o 
rpcclient/cmd_dfs.o rpcclient/cmd_reg.o rpcclient/display_sec.o 
rpcclient/cmd_ds.o

I have had this problem with 3.0.0.rc1 .rc2 and even a beta version.  Samba 
version 2.2.8a conpiles/make and runs with a problem on the same Solaris 
systems.
Comment 1 Brian Dudek 2003-08-29 13:56:44 UTC
Corrections to my last statement:

I have had this problem with 3.0.0.rc1 .rc2 and even a beta version.  Samba 
version 2.2.8a compiles/makes and runs withOUT a problem on the same Solaris 
systems.  2.2.8a does work correctly.

Sorry for any confusion.
Comment 2 Tim Potter 2003-08-29 21:46:32 UTC
Is there any chance you could try building with a different version of awk?  If
you could download and install GNU awk it would help in diagnosing whether
Solaris nawk has a problem with the current mkproto script.
Comment 3 Tim Potter 2003-09-01 02:27:10 UTC
*** Bug 379 has been marked as a duplicate of this bug. ***
Comment 4 Suresh Khatry 2003-09-01 14:31:36 UTC
Have tried with GNU gawk versions 3.1.0 & 3.1.1, Solaris 7 & 9 nawk.  All have
the same result - hangs at the same location.
Comment 5 CraigN 2003-09-02 21:48:09 UTC
I tried this out on mawk as well but to no avail.
Comment 6 Brian King 2003-09-04 07:40:28 UTC
I tried cutting and pasting your exact command listed as process 2297 below, on 
a solaris 9 box. It executes without an issue.

I do have a question about what's below though. Through your truss, you show 
that 2296 is waiting on 2297; 2297 is waiting on 2306; 2306 is waiting on some 
input from STDIN. You don't show what process 2306 is. Maybe if you repeat the 
experiment and we can see which process is waiting on STDIN, we might have a 
better idea of what's happening? Also, a 'ptree' output on the make might be 
usefull (it will probably show the dependancy tree you've already discovered 
with truss, but it can't hurt).

Comment 7 Brian Dudek 2003-09-04 11:17:30 UTC
This was process 2306 from the origonal post:
nawk -v headername=_PROTO_H_ -f script/mkproto.awk

This is a 'ptree' of a new 'make' run that hung on a Solaris 9 box where nawk 
points to the default Solaris 9 /bin/nawk; make is GNU Make 3.80 and GCC 3.2.3 
is NFS mounted off a Solaris 8 box.

139   /usr/sbin/inetd -s
    11310 in.rlogind
      11312 -tcsh
        22459 make
          22468 /bin/sh -c cd /tmp/samba-3.0.0rc2/source && /bin/sh /tmp/samba-
3.0.0rc2/source/
            22469 /bin/sh /tmp/samba-3.0.0rc2/source/script/mkproto.sh nawk -h 
_PROTO_H_ /tmp/sam
              22478 nawk -v headername=_PROTO_H_ -f script/mkproto.awk
    18551 in.rlogind
      18553 -tcsh
        22487 ptree -a
Comment 8 Tim Potter 2003-09-04 17:01:33 UTC
Perhaps the complete truss output of the nawk process would be useful here.  I
can't see how nawk could be getting stuck reading from stdin, unless "-" appears
as a filename on the commandline.
Comment 9 Brian King 2003-09-05 05:21:55 UTC
As well as the truss, perhaps the full command line capture as you did before 
( "/usr/ucb/ps ewwwww PID" )

BTW, it doesn't appear to make a difference, but the first line in the 
mkproto.sh script is:

#! /bin/sh

When it should be

#!/bin/sh

It doesn't make a difference right now because the Makefile calls it by 
specifying the shell instead of executing it directly:


@cd $(srcdir) && $(SHELL) $(MKPROTO_SH) $(AWK) \ .....
Comment 10 Suresh Khatry 2003-09-05 06:06:38 UTC
I found that doing make <enter> <enter> sets the ball rolling but then I get a 
lot of errors reporting missing files and make fails with a fatal error.  Do 
you want me to list the whole output of make?
Comment 11 Tim Potter 2003-09-05 17:34:40 UTC
Yes please.  You can upload it as a compressed attachment if you think it's too
large to cut and paste.

BTW I couldn't reproduce this yesterday on the Solaris system I have access to.
 It's only Solaris 5.8 though.
Comment 12 Brian Dudek 2003-09-09 08:25:51 UTC
same problem with rc3

I think the problem is with script/mkproto.awk - there is even a comment in 
this file regarding awk/nawk choking:

I'm including a truss of make after the mkproto.awk call

28196:	open64("script/mkproto.awk", O_RDONLY)		= 3
28196:	fstat64(3, 0xFFBFF7E0)				= 0
28196:	brk(0x00060988)					= 0
28196:	brk(0x00062988)					= 0
28196:	fstat64(3, 0xFFBFF688)				= 0
28196:	ioctl(3, TCGETA, 0xFFBFF76C)			Err#25 ENOTTY
28196:	read(3, " B E G I N   {\n     i n".., 8192)	= 3202
28196:	brk(0x00062988)					= 0
28196:	brk(0x00064988)					= 0
28196:	brk(0x00064988)					= 0
28196:	brk(0x00066988)					= 0
28196:	brk(0x00066988)					= 0
28196:	brk(0x00068988)					= 0
28196:	brk(0x00068988)					= 0
28196:	brk(0x0006A988)					= 0
28196:	brk(0x0006A988)					= 0
28196:	brk(0x0006C988)					= 0
28196:	brk(0x0006C988)					= 0
28196:	brk(0x0006E988)					= 0
28196:	brk(0x0006E988)					= 0
28196:	brk(0x00070988)					= 0
28196:	brk(0x00070988)					= 0
28196:	brk(0x00072988)					= 0
28196:	brk(0x00072988)					= 0
28196:	brk(0x00074988)					= 0
28196:	brk(0x00074988)					= 0
28196:	brk(0x00078988)					= 0
28196:	brk(0x00078988)					= 0
28196:	brk(0x0007A988)					= 0
28196:	brk(0x0007A988)					= 0
28196:	brk(0x0007C988)					= 0
28196:	brk(0x0007C988)					= 0
28196:	brk(0x00080988)					= 0
28196:	brk(0x00080988)					= 0
28196:	brk(0x00082988)					= 0
28196:	brk(0x00082988)					= 0
28196:	brk(0x00084988)					= 0
28196:	brk(0x00084988)					= 0
28196:	brk(0x00086988)					= 0
28196:	brk(0x00086988)					= 0
28196:	brk(0x00088988)					= 0
28196:	brk(0x00088988)					= 0
28196:	brk(0x0008A988)					= 0
28196:	brk(0x0008A988)					= 0
28196:	brk(0x0008C988)					= 0
28196:	brk(0x0008C988)					= 0
28196:	brk(0x0008E988)					= 0
28196:	brk(0x0008E988)					= 0
28196:	brk(0x00090988)					= 0
28196:	brk(0x00090988)					= 0
28196:	brk(0x00092988)					= 0
28196:	brk(0x00092988)					= 0
28196:	brk(0x00094988)					= 0
28196:	brk(0x00094988)					= 0
28196:	brk(0x00096988)					= 0
28196:	brk(0x00096988)					= 0
28196:	brk(0x00098988)					= 0
28196:	brk(0x00098988)					= 0
28196:	brk(0x0009A988)					= 0
28196:	brk(0x0009A988)					= 0
28196:	brk(0x0009C988)					= 0
28196:	brk(0x0009C988)					= 0
28196:	brk(0x0009E988)					= 0
28196:	brk(0x0009E988)					= 0
28196:	brk(0x000A0988)					= 0
28196:	read(3, 0x0005ED94, 8192)			= 0
28196:	ioctl(1, TCGETA, 0xFFBFF72C)			Err#25 ENOTTY
28196:	fstat64(1, 0xFFBFF7A0)				= 0
28196:	brk(0x000A0988)					= 0
28196:	brk(0x000A2988)					= 0
28196:	fstat64(1, 0xFFBFF648)				= 0
28196:	ioctl(0, TCGETA, 0xFFBFF77C)			= 0
28196:	fstat64(0, 0xFFBFF698)				= 0
28159:	wait()				(sleeping...)
28176:	waitid(P_PID, 28178, 0xFFBFDFF8, WEXITED|WTRAPPED|WNOWAIT) (sleeping...)
28178:	waitid(P_PID, 28196, 0xFFBFDB68, WEXITED|WTRAPPED|WNOWAIT) (sleeping...)
28196:	read(0, 0xFF343534, 1024)	(sleeping...)
28196:	    Received signal #2, SIGINT, in read() [default]
28196:	read(0, 0xFF343534, 1024)			Err#4 EINTR
28178:	    Received signal #2, SIGINT, in waitid() [caught]
28178:	waitid(P_PID, 28196, 0xFFBFDB68, WEXITED|WTRAPPED|WNOWAIT) Err#4 EINTR
28178:	setcontext(0xFFBFD850)
28178:	waitid(P_PID, 28196, 0xFFBFDB68, WEXITED|WTRAPPED|WNOWAIT) = 0
28178:	ioctl(0, TIOCGPGRP, 0xFFBFDB24)			= 0
28178:	ioctl(0, TCGETS, 0x000391D4)			= 0
28178:	waitid(P_PID, 28196, 0xFFBFDB68, WEXITED|WTRAPPED) = 0
28178:	_exit(130)
28176:	    Received signal #2, SIGINT, in waitid() [caught]
28176:	waitid(P_PID, 28178, 0xFFBFDFF8, WEXITED|WTRAPPED|WNOWAIT) Err#4 EINTR
28176:	setcontext(0xFFBFDCE0)
28176:	waitid(P_PID, 28178, 0xFFBFDFF8, WEXITED|WTRAPPED|WNOWAIT) = 0
28176:	ioctl(0, TIOCGPGRP, 0xFFBFDFB4)			= 0
28176:	ioctl(0, TCGETS, 0x000391D4)			= 0
28176:	waitid(P_PID, 28178, 0xFFBFDFF8, WEXITED|WTRAPPED) = 0
28176:	_exit(130)
28159:	    Received signal #2, SIGINT, in wait() [caught]
28159:	wait()						Err#91 ERESTART
28159:	sigaction(SIGINT, 0xFFBFE570, 0xFFBFE5F0)	= 0
28159:	    Received signal #18, SIGCLD [caught]
28159:	      siginfo: SIGCLD CLD_EXITED pid=28176 status=0x0082
28159:	setcontext(0xFFBFE258)
28159:	stat64("include/proto.h", 0xFFBFE518)		Err#2 ENOENT
28159:	wait()						= 28176 [0x8200]
28159:	fstat64(2, 0xFFBFD648)				= 0
28159:	write(2, " m a k e", 4)				= 4
28159:	write(2, " :  ", 2)				= 2
28159:	write(2, " * * *   [", 5)			= 5
28159:	write(2, " i n c l u d e / p r o t".., 15)	= 15
28159:	write(2, " ]   E r r o r  ", 8)			= 8
28159:	write(2, " 1 3 0", 3)				= 3
28159:	write(2, "\n", 1)				= 1
28159:	sigprocmask(SIG_BLOCK, 0x00046310, 0x00000000)	= 0
28159:	sigprocmask(SIG_SETMASK, 0xFFBFE590, 0x00000000) = 0
28159:	getpid()					= 28159 [28158]
28159:	kill(28159, SIGINT)				= 0
28159:	    Received signal #2, SIGINT [default]
28159:	      siginfo: SIGINT pid=28159 uid=5076
Comment 13 Brian King 2003-09-09 10:19:40 UTC
Can you also capture the full command line arguments to all the processes 
involved while it is stuck waiting for input from STDIN?

The truss only shows:

28159 = waiting on 28176
 28176 = waiting on 28178
   28178 = waiting on 28196
     28196 = waiting to read from STDIN
CTRL-C is sent (or a SIGINT), and then 28196 exits, the processes waiting onit 
exit, and 28159 then tries to read from include/proto.h, but it hasn't been 
created because 28196 didn't sucessfully complete.

(or at least that's all I can clean from it)

If we could see the command line arguments for each of the processes, _maybe_ 
we could figure out why it's waiting on input from STDIN?

Something else that _might_ reveal more information is putting a "set -x" near 
the top of the mkproto.sh script. Then your "make" output should show more 
(like what variables are set at, etc.)
Comment 14 Brian Dudek 2003-09-15 07:53:12 UTC
now using rc4

this output is with a "set -x" in mkproto.sh


owl /tmp/samba-3.0.0rc4/source make
Using FLAGS =  -g -O2 -I./popt -Iinclude -I/tmp/samba-3.0.0rc4/source/include
-I/tmp/samba-3.0.0rc4/source/ubiqx -I/tmp/samba-3.0.0rc4/source/smbwrapper  -I.
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/tmp/samba-3.0.0rc4/source    
      LIBS = -lsendfile -lsec -lgen -lresolv -lsocket -lnsl -ldl
      LDSHFLAGS = -G 
      LDFLAGS = 
Generating smbd/build_options.c
Building include/proto.h
LANG=C
+ export LANG 
LC_ALL=C
+ export LC_ALL 
LC_COLLATE=C
+ export LC_COLLATE 
+ [ 338 -lt 3 ] 
awk=nawk
+ shift 
+ [ x-h = x-h ] 
headeropt=-v headername=_PROTO_H_
+ shift 
+ shift 
header=/tmp/samba-3.0.0rc4/source/include/proto.h
+ shift 
headertmp=/tmp/samba-3.0.0rc4/source/include/proto.h.12385.tmp~
+ echo smbd/server.o smbd/files.o smbd/chgpasswd.o smbd/connection.o smbd/utmp.o
smbd/session.o smbd/dfree.o smbd/dir.o smbd/password.o smbd/conn.o smbd/fileio.o
smbd/ipc.o smbd/lanman.o smbd/negprot.o smbd/message.o smbd/nttrans.o
smbd/pipes.o smbd/reply.o smbd/sesssetup.o smbd/trans2.o smbd/uid.o
smbd/dosmode.o smbd/filename.o smbd/open.o smbd/close.o smbd/blocking.o
smbd/sec_ctx.o smbd/srvstr.o smbd/vfs.o smbd/vfs-wrap.o smbd/statcache.o
smbd/posix_acls.o lib/sysacls.o lib/server_mutex.o smbd/process.o smbd/service.o
smbd/error.o printing/printfsp.o lib/util_seaccess.o lib/sysquotas.o
smbd/change_trust_pw.o smbd/fake_file.o smbd/quotas.o smbd/ntquotas.o lib/afs.o
smbd/mangle.o smbd/mangle_hash.o smbd/mangle_map.o smbd/mangle_hash2.o
nmbd/asyncdns.o nmbd/nmbd.o nmbd/nmbd_become_dmb.o nmbd/nmbd_become_lmb.o
nmbd/nmbd_browserdb.o nmbd/nmbd_browsesync.o nmbd/nmbd_elections.o
nmbd/nmbd_incomingdgrams.o nmbd/nmbd_incomingrequests.o nmbd/nmbd_lmhosts.o
nmbd/nmbd_logonnames.o nmbd/nmbd_mynames.o nmbd/nmbd_namelistdb.o
nmbd/nmbd_namequery.o nmbd/nmbd_nameregister.o nmbd/nmbd_namerelease.o
nmbd/nmbd_nodestatus.o nmbd/nmbd_packets.o nmbd/nmbd_processlogon.o
nmbd/nmbd_responserecordsdb.o nmbd/nmbd_sendannounce.o nmbd/nmbd_serverlistdb.o
nmbd/nmbd_subnetdb.o nmbd/nmbd_winsproxy.o nmbd/nmbd_winsserver.o
nmbd/nmbd_workgroupdb.o nmbd/nmbd_synclists.o web/cgi.o web/diagnose.o
web/startstop.o web/statuspage.o web/swat.o web/neg_lang.o lib/version.o
lib/charcnv.o lib/debug.o lib/fault.o lib/getsmbpass.o lib/interface.o lib/md4.o
lib/interfaces.o lib/pidfile.o lib/replace.o lib/replace1.o lib/signal.o
lib/system.o lib/sendfile.o lib/time.o lib/ufc.o lib/genrand.o lib/username.o
lib/util_getent.o lib/util_pw.o lib/access.o lib/smbrun.o lib/bitmap.o
lib/crc32.o lib/snprintf.o lib/dprintf.o lib/xfile.o lib/wins_srv.o
lib/util_str.o lib/clobber.o lib/util_sid.o lib/util_uuid.o lib/util_unistr.o
lib/util_file.o lib/data_blob.o lib/util.o lib/util_sock.o lib/sock_exec.o
lib/util_sec.o lib/talloc.o lib/hash.o lib/substitute.o lib/fsusage.o
lib/ms_fnmatch.o lib/select.o lib/messages.o lib/tallocmsg.o lib/dmallocmsg.o
libsmb/smb_signing.o lib/md5.o lib/hmacmd5.o lib/iconv.o lib/smbpasswd.o
nsswitch/wb_client.o nsswitch/wb_common.o lib/pam_errors.o intl/lang_tdb.o
lib/account_pol.o lib/adt_tree.o lib/gencache.o tdb/tdb.o tdb/spinlock.o
tdb/tdbutil.o tdb/tdbback.o lib/module.o lib/ldap_escape.o libsmb/clientgen.o
libsmb/cliconnect.o libsmb/clifile.o libsmb/clikrb5.o libsmb/clispnego.o
libsmb/asn1.o libsmb/clirap.o libsmb/clierror.o libsmb/climessage.o
libsmb/clireadwrite.o libsmb/clilist.o libsmb/cliprint.o libsmb/clitrans.o
libsmb/clisecdesc.o libsmb/clidgram.o libsmb/clistr.o libsmb/cliquota.o
libsmb/clifsinfo.o libsmb/smberr.o libsmb/credentials.o libsmb/pwd_cache.o
libsmb/clioplock.o libsmb/errormap.o libsmb/clirap2.o libsmb/passchange.o
libsmb/doserr.o rpc_parse/parse_prs.o rpc_parse/parse_sec.o
rpc_parse/parse_misc.o libsmb/nterr.o libsmb/smbdes.o libsmb/smbencrypt.o
libsmb/ntlmssp.o libsmb/ntlmssp_parse.o libsmb/ntlmssp_sign.o
libsmb/unexpected.o libsmb/namecache.o libsmb/nmblib.o libsmb/namequery.o
libsmb/conncache.o smbwrapper/smbw.o smbwrapper/smbw_dir.o
smbwrapper/smbw_stat.o smbwrapper/realcalls.o smbwrapper/shared.o
smbwrapper/smbw_cache.o smbwrapper/wrapped.o torture/torture.o torture/nbio.o
torture/scanner.o torture/utable.o torture/denytest.o torture/mangle_test.o
rpcclient/rpcclient.o rpcclient/cmd_lsarpc.o rpcclient/cmd_samr.o
rpcclient/cmd_spoolss.o rpcclient/cmd_netlogon.o rpcclient/cmd_srvsvc.o
rpcclient/cmd_dfs.o rpcclient/cmd_reg.o rpcclient/display_sec.o
rpcclient/cmd_ds.o rpcclient/cmd_echo.o rpc_client/cli_lsarpc.o
rpc_client/cli_samr.o rpc_client/cli_netlogon.o rpc_client/cli_srvsvc.o
rpc_client/cli_wkssvc.o rpc_client/cli_dfs.o rpc_client/cli_reg.o
rpc_client/cli_pipe.o rpc_client/cli_spoolss.o rpc_client/cli_spoolss_notify.o
rpc_client/cli_ds.o rpc_client/cli_echo.o rpc_client/cli_pipe.o
rpc_server/srv_pipe_hnd.o rpc_server/srv_util.o rpc_server/srv_pipe.o
rpc_server/srv_lsa_hnd.o rpc_parse/parse_lsa.o rpc_parse/parse_net.o
rpc_parse/parse_reg.o rpc_parse/parse_rpc.o rpc_parse/parse_samr.o
rpc_parse/parse_srv.o rpc_parse/parse_wks.o rpc_parse/parse_ds.o
rpc_parse/parse_spoolss.o rpc_parse/parse_dfs.o rpc_parse/parse_echo.o
registry/reg_objects.o libads/kerberos.o auth/auth.o auth/auth_util.o
auth/auth_compat.o auth/auth_ntlmssp.o auth/pampass.o auth/pass_check.o
libsmb/samlogon_cache.o libsmb/namequery_dc.o libsmb/trustdom_cache.o
libsmb/trusts_util.o dynconfig.o param/loadparm.o param/params.o
locking/locking.o locking/brlock.o locking/posix.o passdb/secrets.o
printing/pcap.o printing/print_svid.o printing/print_cups.o
printing/print_generic.o printing/lpq_parse.o printing/load.o
printing/printing.o printing/nt_printing.o printing/notify.o
printing/printing_db.o smbd/oplock.o smbd/oplock_irix.o smbd/oplock_linux.o
smbd/notify.o smbd/notify_hash.o smbd/notify_kernel.o passdb/pdb_get_set.o
passdb/passdb.o passdb/pdb_interface.o passdb/machine_sid.o
passdb/util_sam_sid.o passdb/pdb_compat.o passdb/privileges.o
passdb/lookup_sid.o passdb/pdb_guest.o groupdb/mapping.o msdfs/msdfs.o
lib/readline.o profile/profile.o libads/ldap.o libads/ldap_printer.o
libads/sasl.o libads/krb5_setpw.o libads/ldap_user.o libads/ads_struct.o
libads/ads_status.o libads/disp_sec.o libads/ads_utils.o libads/ldap_utils.o
libads/ads_ldap.o libads/authdata.o libads/util.o libads/kerberos_verify.o
lib/system_smbd.o lib/util_smbd.o registry/reg_frontend.o
registry/reg_cachehook.o registry/reg_printing.o registry/reg_db.o
lib/popt_common.o rpc_server/srv_lsa.o rpc_server/srv_lsa_nt.o
rpc_server/srv_netlog.o rpc_server/srv_netlog_nt.o rpc_server/srv_samr.o
rpc_server/srv_samr_nt.o rpc_server/srv_samr_util.o rpc_server/srv_reg.o
rpc_server/srv_reg_nt.o rpc_server/srv_lsa_ds.o rpc_server/srv_lsa_ds_nt.o
rpc_server/srv_srvsvc.o rpc_server/srv_srvsvc_nt.o rpc_server/srv_wkssvc.o
rpc_server/srv_wkssvc_nt.o rpc_server/srv_dfs.o rpc_server/srv_dfs_nt.o
rpc_server/srv_spoolss.o rpc_server/srv_spoolss_nt.o rpc_server/srv_echo.o
rpc_server/srv_echo_nt.o sam/idmap.o sam/idmap_util.o sam/idmap_tdb.o
libsmb/spnego.o 
+ tr   \n 
+ sed -e s/\.o/\.c/g 
+ sort 
+ uniq 
+ egrep -v ubiqx/|wrapped|modules/getdate 
proto_src=
+ echo creating /tmp/samba-3.0.0rc4/source/include/proto.h 
creating /tmp/samba-3.0.0rc4/source/include/proto.h
+ dirname /tmp/samba-3.0.0rc4/source/include/proto.h 
+ mkdir -p /tmp/samba-3.0.0rc4/source/include 
+ nawk -v headername=_PROTO_H_ -f script/mkproto.awk 
Comment 15 Brian King 2003-09-15 10:05:11 UTC
That is a little revealing. I don't see the cause yet, but it looks like 
somehow you have a CR (or other special character) in your command line 
arguments somehow.

+ echo smbd/server.o smbd/files.o smbd/chgpasswd.o smbd/connection.o 
+ smbd/utmp.o

the '+' symbol should start each shell command, so in the above, you echo 4 
items, then try to "run" the rest, which gives an error, instead of the proper 
output into the pipe:

proto_src="`echo $@ | tr ' ' '\n' | sed -e 's/\.o/\.c/g' | sort | uniq | egrep -
v 'ubiqx/|wrapped|modules/getdate'`"

Since nothing goes into the pipe, proto_src gets set to nothing, and that would 
explain why you are stuck waiting for input from STDIN.

Just a guess, but look in the Makefile and check the lines:

SMBD_OBJ_SRV = smbd/files.o smbd/chgpasswd.o smbd/connection.o \
               smbd/utmp.o smbd/session.o \


Make sure that the last character on the first line is the backslash character.
Also check Makefile.in. Maybe delete Makefile and Makefile.in and redownload 
Makefile.in? Rerun autogen.sh and configure.

For reference, this is what the 'set -x' output looks like when it's working:

+ echo smbd/server.o smbd/files.o smbd/chgpasswd.o smbd/connection.o 
smbd/utmp.o smbd/session.o smbd/dfree.o smbd/dir.o smbd/password.o smbd/conn.o 
smbd/fileio.o smbd/ipc.o .... Stuff Cut ..... rpc_server/srv_echo_nt.o 
lib/smbldap.o sam/idmap.o sam/idmap_util.o sam/idmap_ldap.o sam/idmap_tdb.o 
libsmb/spnego.o
+ tr   \n
+ sed -e s/\.o/\.c/g
+ sort
+ uniq
+ egrep -v ubiqx/|wrapped|modules/getdate
proto_src=auth/auth.c
auth/auth_builtin.c
auth/auth_compat.c
auth/auth_domain.c
auth/auth_ntlmssp.c
auth/auth_rhosts.c
auth/auth_sam.c
auth/auth_server.c
auth/auth_unix.c
auth/auth_util.c
auth/auth_winbind.c
auth/pampass.c
auth/pass_check.c
dynconfig.c
groupdb/mapping.c
intl/lang_tdb.c
.....Stuff Cut ....
web/startstop.c
web/statuspage.c
web/swat.c
+ echo creating /export/home/bking/samba/source/include/proto.h
creating /export/home/bking/samba/source/include/proto.h
+ dirname /export/home/bking/samba/source/include/proto.h
+ mkdir -p /export/home/bking/samba/source/include
+ nawk -v headername=_PROTO_H_ -f script/mkproto.awk auth/auth.c 
auth/auth_builtin.c auth/auth_compat.c auth/auth_domain.c auth/auth_ntlmssp.c 
auth/auth_rhosts.c auth/auth_sam.c auth/auth_server.c auth/auth_unix.c 
auth/auth_util.c auth/auth_winbind.c auth/pampass.c auth/pass_check.c 
dynconfig.c groupdb/mapping.c intl/lang_tdb.c lib/access.c lib/account_pol.c 
lib/adt_tree.c lib/afs.c lib/bitmap.c lib/charcnv.c lib/clobber.c lib/crc32.c 
lib/data_blob.c lib/debug.c lib/dmallocmsg.c lib/dprintf.c lib/fault.c 
lib/fsusage.c lib/gencache.c .... Stuff Cut .... web/neg_lang.c web/startstop.c 
web/statuspage.c web/swat.c

+ cmp -
s /export/home/bking/samba/source/include/proto.h /export/home/bking/samba/sourc
e/include/proto.h.15909.tmp~
+ 
mv /export/home/bking/samba/source/include/proto.h.15909.tmp~ /export/home/bking
/samba/source/include/proto.h
Comment 16 Tim Potter 2003-09-15 20:08:09 UTC
Created attachment 141 [details]
Fix make proto argument bug

OK I think I've found it.  One of the statements in the pipeline was in the
wrong place.  The 'egrep -v' part was assuming the input was newline separated
but by that part of the process it was space separated.

I don't understand why I haven't seen this before though.

Guys, let me know if this fixes it for everyone and I'll commit it.
Comment 17 Brian Dudek 2003-09-16 08:06:02 UTC

If this is only a recode of proto_src (line 28) in mkproto.sh it does not help.
Comment 18 Brian King 2003-09-16 10:34:17 UTC
That patch shouldn't affect anything. All parts of the pipeline after the 'tr' 
are newline delimited (assuming the tr worked).

As for my comment, about the extra "+" between smbd/connection.o and 
smbd/utmp.o meaning that you have an extra newline that you shouldn't, I'm 
looking back over your output, and I don't see the extra plus today. I have no 
idea where I cut and paste that from?!?

If I cut and paste your "echo" line, and pipe that through the tr, sort, sed, 
and egrep, I get the proper output for proto_src.

Does it work for you if you try it manually?

try:
echo "---cut--and--paste--your--list--below--" | tr ' ' '\n' | sort -u 

If that appears to work, try throwing in the sed and the egrep. See at which 
point it breaks. It _could_ be that the 'tr' is not working for some reason, 
and they are all staying on one line. If that's the case, then the egrep would 
eliminate the only line you have. Is the first parameter to 'tr' in your 
mkproto.sh definitely a space? If so, is there something different about your 
shell? Maybe it's not using spaces to delimit parameters? You could check by 
piping $@ through od. (e.g. echo $@ | od -cx ;# Spaces should show up as hex 
value '20'.)

You could also try to break apart the steps in the pipeline into individual 
lines for debugging:

e.g.
tmp1="`echo $@ | tr ' ' '\n'"
echo "$tmp1">/tmp/tmp1.txt
tmp2=`echo "$tmp1" | sort -u | sed -e 's/\.o/\.c/g'`
echo "$tmp2">/tmp/tmp2.txt
tmp3=`echo "$tmp2" | egrep -v 'ubiqx/|wrapped|modules/getdate'`
echo "$tmp3">/tmp/tmp3.txt
proto_src=$tmp3

tmp1.txt should be all the .o files 1 per line
tmp2.txt should be all the .c files sorted and uniq-ed
tmp3.txt should be tmp2.txt with some lines removed

Brian
Comment 19 Tim Potter 2003-09-16 22:11:15 UTC
D'oh.  If you break the pipeline down in to stages and assign to shell variables
sh folds the strings back into a space separated list.  This is why I
incorrectly proposed moving the egrep further up the pipeline.  )-:

Another debugging technique would be to remove sections of the pipeline and see
which one is eating all the filenames.  The make proto wouldn't work but at
least you might be able to narrow down which command is not working correctly.
Comment 20 Brian King 2003-09-17 04:28:53 UTC
Actually, the folding only happens if you don't put double quotes around the 
variable. So the quotes in my comments (comment 18) are important.

e.g.
# tmp="1 2 3
4 5 6"
# echo $tmp
1 2 3 4 5 6
# echo "$tmp"
1 2 3
4 5 6
Comment 21 Geoff Gibbs 2003-10-13 02:08:04 UTC
I believe that this is caused by the Berkeley tr being picked up
rather than the SVR4 tr. When I changed my path so that /usr/ucb
came after /usr/bin, the make worked.

ggibbs@gold% which tr
/usr/ucb/tr
ggibbs@gold% echo 'a b c' | /usr/ucb/tr ' ' '\n'
anbnc
ggibbs@gold% echo 'a b c' | /usr/bin/tr ' ' '\n'
a
b
c

This was under Solaris 9 and with Samba 3.0.0
Comment 22 Brian Dudek 2003-10-13 11:30:12 UTC
Removing /usr/bin from $PATH worked!  Is this something that SAMBA should
accommodate for or just be listed as a build note for Solaris?

What tipped you of to the tr differences?
Comment 23 Brian King 2003-10-13 12:38:54 UTC
Created attachment 197 [details]
Replace 'tr' with sed

If different versions of tr is the problem, then let's do the whole thing with
sed. This patch also replaces "sort | uniq" with simply sort -u.
Comment 24 Brian Dudek 2003-10-13 14:46:55 UTC
It does look like the tr program is the problem as I can use the original
mkproto.sh, hard coded to /bin/tr and things work. However the patch code does
not work either - even adding the missing end quote.  Solaris has both a
/bin/sed and /usr/usb/sed but neither work.
Comment 25 Geoff Gibbs 2003-10-14 00:58:20 UTC
Should configure check the action of tr and if it gets the Berkeley result
put out a messaage to remove /usr/ucb from the path? Then if there are
other Berkely commands which don't do what you want, this gets round
the problem.
Comment 26 Tim Potter 2003-10-14 04:18:14 UTC
Writing a configure check to test for broken tr behaviour is probably the best
way to go.  I wonder if this is a known problem with Berkeley tr?
Comment 27 Tim Potter 2003-10-14 04:20:19 UTC
We can always check for an environment variable $TR or make the user adjust
their path.  I don't think it's appropriate for configure to mess with the path.
Comment 28 Brian King 2003-10-14 06:18:00 UTC
How about not using '\n' notation? 

*** The way we do it now ****
bash-2.05$ echo 'hi there' | tr ' ' '\n' | od -c
0000000   h   i  \n   t   h   e   r   e  \n
0000011

*** Not using \n but "regular" tr ***
bash-2.05$ echo 'hi there' | tr ' ' '
' | od -c
0000000   h   i  \n   t   h   e   r   e  \n
0000011

*** Using /usr/ucb/tr without \n ***
bash-2.05$ echo 'hi there' | /usr/ucb/tr ' ' '
' | od -c
0000000   h   i  \n   t   h   e   r   e  \n
0000011


All the results are the same if you use an actual newline instead of the \n 
notation.
Comment 29 Gerald (Jerry) Carter (dead mail address) 2003-12-07 21:14:53 UTC
any updates on this?  We have another report from a Solaris user 
on the samba ml.
Comment 30 Brian King 2003-12-08 05:15:12 UTC
Another possible suggestion to convert the spaces to newlines. If sed and tr 
behavior is not the same everywhere, how about xargs?

Intead of "|tr ' ' '\n'"  how about ... " | xargs -n1 | " ...

e.g.

proto_src="`echo $@ | xargs -n1 | sed -e 's/\.o/\.c/g' | sort -u | egrep -
v 'ubiqx/|wrapped|modules/getdate'`"
Comment 31 Gerald (Jerry) Carter (dead mail address) 2003-12-08 08:12:28 UTC
Message from Brian D.:

  My issue was in the different output results from /usr/ucb/tr vs 
  that of /bin/tr - I removed /usr/ucb from the $PATH - problem 
  solved.  Not sure if there is a bug in /usr/ucb/tr or what but 
  non of us can seem to write a new line of code to correct 
  the problem.  Hope this helps. 

Tim, do you think this is worth fixing in configure.in ?
Comment 32 Brian Dudek 2003-12-08 15:26:29 UTC
The code in Comment #30 does correct the problem in script/mkproto.sh however
there still is a /usr/ucb problem - the /usr/ucb/ld linker I think. 
Comment 33 Gerald (Jerry) Carter (dead mail address) 2004-01-14 13:03:36 UTC
CLosing this on out.  The official stance /usr/ucb is 
"don't use /usr/ucb/* when building Samba"
Comment 34 Gerald (Jerry) Carter (dead mail address) 2005-02-07 09:05:49 UTC
originally reported against one of the 3.0.0rc[1-4] releases.
Cleaning up non-production versions.
Comment 35 Gerald (Jerry) Carter (dead mail address) 2005-11-14 09:26:58 UTC
database cleanup