From owner-freebsd-hackers@FreeBSD.ORG Wed Oct 12 21:39:42 2005 Return-Path: X-Original-To: hackers@freebsd.org Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 11AAA16A41F for ; Wed, 12 Oct 2005 21:39:42 +0000 (GMT) (envelope-from ringworm01@gmail.com) Received: from qproxy.gmail.com (qproxy.gmail.com [72.14.204.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id 470E243D45 for ; Wed, 12 Oct 2005 21:39:40 +0000 (GMT) (envelope-from ringworm01@gmail.com) Received: by qproxy.gmail.com with SMTP id e11so112310qbe for ; Wed, 12 Oct 2005 14:39:35 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:from:to:subject:date:user-agent:references:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:message-id; b=nawYVb1LFnJ28hvnvklW9mcKAyZkpFkjCbYwcHYUFuCGMKPiSzf6Kf2ooy/oWYYsZtWsZgCLHMi24Bg24vaUI4RylKwfJeqHwP0yv66fkQTDy9hPiCIgcYJAi3u5NSnb1neKOw1OLkGwcEWPrFHYRUF+WfKNJJGUepN5XNtcqb8= Received: by 10.65.242.3 with SMTP id u3mr653395qbr; Wed, 12 Oct 2005 14:39:34 -0700 (PDT) Received: from ?192.168.1.10? ( [71.102.45.234]) by mx.gmail.com with ESMTP id q16sm4496991qbq.2005.10.12.14.39.31; Wed, 12 Oct 2005 14:39:33 -0700 (PDT) From: "Michael C. Shultz" To: "Mark J. Sommer" , hackers@freebsd.org, RW Date: Wed, 12 Oct 2005 14:41:17 -0700 User-Agent: KMail/1.8.2 References: <200510122033.j9CKX5uo040708@argotsoft.com> In-Reply-To: <200510122033.j9CKX5uo040708@argotsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200510121441.18997.ringworm01@gmail.com> Cc: Subject: Re: portmanager X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Oct 2005 21:39:42 -0000 On Wednesday 12 October 2005 13:33, you wrote: > Just a comment from an on-looker to this post. From the getenv > > The getenv() function obtains the current value of the environment vari- > able, name. If the variable name is not in the current environment, a > null pointer is returned. > > So it could potentially be passing in a null pointer to strncmp which is > not good. Is that the problem you're seeing. Easy enough to test the > return from getenv before using it. I tried wrapping it with if ( getenv("TERM") ) { . . . } made no difference. What is really frustrating is I can't get gdb to step through anything in function main ie. whatever is in portmanager.c, every function located in a library is no problem, this also renders the core file useless Guess I'll shift the guts from portmanager.c to a library function then see what gdb says. > > -----Original Message----- > From: owner-freebsd-questions@freebsd.org > [mailto:owner-freebsd-questions@freebsd.org] On Behalf Of Michael C. Shultz > Sent: 10/12/2005 1:43 PM > To: Michael Lednev; freebsd-questions@freebsd.org; hackers@freebsd.org > Subject: Re: portmanager > > On Sunday 09 October 2005 07:53, Michael Lednev wrote: > > Hello, freebsd-questions. > > > > anyone tried to run portmanager from crontab? as for me it just > > coredumps, what am i doing wrong? its simply 0 0 * * * portmanager -s > > I'm not sure how to fix it but I've found where portmanager crashes when > run from cron, the code is: > > > if( !strncmp( getenv("TERM"), "xterm", 5 ) && isatty(fileno(stdout)) > ) > { > stringSize = strlen( id ) > + 1 > + strlen( VERSION ) > + 1; > xtermTitle = malloc( stringSize ); > xtermTitle[0] = 0; > strcat( xtermTitle, id ); > strcat( xtermTitle, " " ); > strcat( xtermTitle, VERSION ); > printf( "%c]0;%s%c", '\033', xtermTitle, '\007' ); > free( xtermTitle ); > } > > > This is used to put information in the xterm title screen while portmanager > is running, I don't know enough about cron to have a clue how to fix this > except to remove it and I don't want to do that. Anyone have any ideas? > This particualr code snippet is from portmanager/portmanager.c around line > 137.... > > -Mike > > ps. I've cross posted this to freebsd-hackers because it is a coding > problem, so you may want to remove freebsd-questions from any replies. > . > > > > > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to > "freebsd-questions-unsubscribe@freebsd.org"