*BSD News Article 44786


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!simtel!news.sprintlink.net!gatech!swrinde!cs.utexas.edu!venus.sun.com!news2me.EBay.Sun.COM!engnews2.Eng.Sun.COM!usenet
From: denny@eng.sun.com (Denton Gentry)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: Major strcmp bug under BSD 2.0?
Date: 1 Jun 1995 00:12:37 GMT
Organization: Sun Microsystems Computer Corp
Lines: 23
Message-ID: <3qj0ll$h3l@engnews2.Eng.Sun.COM>
References: <id.CQCK1.FCH@nmti.com>
Reply-To: denny@eng.sun.com
NNTP-Posting-Host: cthulhu.eng.sun.com

In article <id.CQCK1.FCH@nmti.com>, peter@nmti.com (Peter da Silva) writes:
>They'll dump core on OSF/1 and a number of other unixes. On others they
>will see garbage strings (the classic is the PDP-11 death cry of
>^G^IP@P6). SunOS has a kludge of putting 0 at 0 to let you get away
>with this... one of their many sins.

  You get a segmentation fault on SunOS 4.x and Solaris 2.x.
  Sun is not guilty of this particular sin.

#include <string.h>
main() {
  strcmp(0, 0);
}

SunOS 4.1.3:
[108] nted1% ./a.out
Segmentation fault

Solaris 2.4:
[383] cthulhu% ./a.out
Segmentation Fault (core dumped)