From owner-freebsd-stable Tue Oct 16 9:46:13 2001 Delivered-To: freebsd-stable@freebsd.org Received: from web14702.mail.yahoo.com (web14702.mail.yahoo.com [216.136.224.119]) by hub.freebsd.org (Postfix) with SMTP id 8B39A37B405 for ; Tue, 16 Oct 2001 09:46:10 -0700 (PDT) Message-ID: <20011016164610.95419.qmail@web14702.mail.yahoo.com> Received: from [192.9.25.11] by web14702.mail.yahoo.com via HTTP; Tue, 16 Oct 2001 09:46:10 PDT Date: Tue, 16 Oct 2001 09:46:10 -0700 (PDT) From: David Marker Subject: Re: SIGSEGV not blocked in gdm [was Re: setenv() cores with NULL value] To: freebsd-stable@freebsd.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Well, I didn't mean to start a discussion about NULL pointers. I believe setenv() should core in the test program sent in by Heath Nielson. The interesting thing about gdm is that it does _not_ core dump. Furthermore, I can't find it ever blocking SIGSEGV in its source. Which is why I referenced this post (there is a whole thread): http://www.freebsd.org/cgi/getmsg.cgi?fetch=158037+0+/usr/local/www/db/text/2001/freebsd-stable/20010114.freebsd-stable Before reading that I was not aware you could block a SIGSEGV. But gdm doesn't even appear to block that signal. (grep for sigation, then SIGSEGV, didn't find anything to suggest it blocks SIGSEGV.) So my question is why does Mr. Nielson's program dump core and gdm does not? -dave > While I don't know if gdm should be setting a NULL > value or not, I ran this simple program: > > #include > #include > > int main(int argc, char* argv[]) > { > char* name = "TEST"; > char* value = NULL; > int ret; > > printf("value: %s\n", value); > ret = setenv(name, value, 1); > printf("ret: %d\n", ret); > return 0; > } > > On FreeBSD I get: > hershey:~$ ./a.out > value: (null) > Segmentation fault (core dumped) > > On Linux: > catskill 23: ./a.out > value: (null) > ret: 0 __________________________________________________ Do You Yahoo!? Make a great connection at Yahoo! Personals. http://personals.yahoo.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message