From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10d4db,41ef063bd6dbe977,start X-Google-Attributes: gid10d4db,public From: burley@cygnus.com (Craig Burley) Subject: IMPORTANT: WARNING ABOUT g77-0.5.16!!! Date: 1995/11/23 Message-ID: #1/1 X-Deja-AN: 120008124 references: <48fp3b$16s@hecate.umd.edu> followup-to: comp.os.linux.misc content-type: text/plain; charset=ISO-8859-1 organization: Free Software Foundation 545 Tech Square Cambridge, MA 02139 mime-version: 1.0 newsgroups: comp.os.linux.announce -----BEGIN PGP SIGNED MESSAGE----- [Was Re: g77 and large arrays and segmentation faults] In article <48fp3b$16s@hecate.umd.edu> jf95@umail.umd.edu (Jeff Forbes) writes: This is a followup to my previous inquiry about segmentation faults with large arrays and f2c/gcc. I obtained g77 and it does compile my program with large arrays and the executable usually runs without segmentation faults. A couple of times (when other large programs were running) it loaded and immediately gave seg-fault. OK, now for the weirdness. When I ran top after this happened, it cleared the screen and then the prompt reappeared. Additionally, the echo was turned off. Switching to a different xterm or virtual terminal brings the echo back, but top then gives the same result. Rebooting Linux does not correct the problem and the top binary is not corrupted. Does anyone know what the problem might be? A serious bug in g77-0.5.16 (ONLY) has been reported to me that I am very sorry about, and which 0.5.17 fixes, and which might cause all sorts of weird behaviors. The bug is this: When using the "g77 -v" command while logged in as `root' (or some equally powerful user), the file name "/dev/null" is REMOVED from the system. The reason is that "g77 -v" is implemented, in 0.5.16, by a command which ultimates in "ld -o /dev/null ...", and because this command (intentionally) results in ld complaining about unresolved references, ld apparently decides to REMOVE the executable it was asked to create (which is /dev/null). And, when logged in as root, removing /dev/null actually WORKS!! After doing this the first time, any command or shell script that writes to /dev/null will actually write stuff there as a normal file, and then anything that reads from /dev/null expecting to find an EOF will NOT find one! Instead it'll find whatever stuff happens to be sitting there at the time. To see if this has happened on your Linux system: cd /dev ls -l null zero The entries for these two names should look basically the same, except the "magic numbers" for `null' should be "1,3" while for `zero' they should be "1,5". IF `null' IS MISSING OR IS NOT A "crw-rw-rw- ... 1, 3" FILE (almost exactly like the entry for `zero'), THEN YOUR `/dev/null' HAS BEEN CORRUPTED (probably by doing "g77 -v" as user `root'), AND THIS IS WHAT I THINK YOU SHOULD DO (but please sanity-check it, as obviously I'm NOT an expert on UNIX sysadmin stuff): (login as `root') rm -f null mknod null c 1 3 chmod 666 null chgrp sys null (The chgrp command might not be necessary, or maybe you should change it so `null' and `zero' have identical user/group ownership as reported by "ls -l".) Until g77-0.5.17 is released, which fixes this bug, DO NOT USE "g77 -v" WHILE LOGGED IN AS `root'!!! After you fix this problem on your system, retry other things that seem to behave strangely. If they still do behave strangely, that probably means you have other problems.... I am really sorry for this bug! - -- James Craig Burley, Software Craftsperson burley@gnu.ai.mit.edu -----BEGIN PGP SIGNATURE----- Version: 2.6.2i iQCVAwUBMLTS3YQRll5MupLRAQFO3AP9EOnF4sq7Zj1hOV4l93rvwPg3Yy2LWh6q EV5hS0Rn1L8qy4QcgmI4sF/0xq9gyDzc6BoNxp5vi1OpyYiFYcwKqxJk4aCz85Ln YYrzCjcOukp7R5QE8kdQN22KV9HVSy+0viLonBPJvtvTv6dxZoI894ySZ5cz8ERJ HrRW/6UIQMg= =KTAb -----END PGP SIGNATURE----- -- This article has been digitally signed by the moderator, using PGP. Finger wirzeniu@kruuna.helsinki.fi for PGP key needed for validating signature. Send submissions for comp.os.linux.announce to: linux-announce@news.ornl.gov PLEASE remember a short description of the software and the LOCATION.