in reply to Re: Segmentation fault during file open
in thread Segmentation fault during file open

OK, fixed the undefined value problem (someone else had commented out one of my lines of code). Now the tail end of the strace output is
read(5, "\n2002-02-28\0050.020\0050.020\0050.020\0050."..., 92) = 92 read(5, "\\\0\0?", 4) = 4 read(5, "\n2002-03-05\0050.020\0050.020\0050.020\0050."..., 92) = 92 read(5, "\1\0\0@", 4) = 4 read(5, "\376", 1) = 1 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 write(9, "# dograph version 12:51 2 Novemb"..., 4002) = 4002 close(9) = 0 munmap(0x2aac0000, 4096) = 0 open("/var/MPL/tmp/dailyen/C/CYS04.gp", O_WRONLY|O_CREAT|O_TRUNC, 0666 + <unfinished ...> +++ killed by SIGSEGV +++
Thoughts?

Update at 2222: Also tried changing the unless to an open .. || return .. in the extremely unlikely event that that would make a difference. No dice.

--t. alex

"There was supposed to be an earth-shattering kaboom!" --Marvin the Martian

Replies are listed 'Best First'.
Re: Re: (2) Segmentation fault during file open
by Zaxo (Archbishop) on Mar 06, 2002 at 04:04 UTC

    That's coming from within the libc open call. If you have debugging libc installed, running under gdb may help. Perl should not be able to do this to the system.1 What is your libc, OS and their patchlevels? One recent Linux release "featured" an fs corruption bug, so maybe booting a known good kernel is called for. A bad sector or corrupt inode could do this, so I think ehdonhon's suggestion of a fsck is a good idea at this point.

    If you're not getting core dumps for gdb, you can try $SIG{SEGV} = sub{abort};. You will want the source of libc open() to know what names to look at.

    The filesystem theory really doesn't fit crashing on the same file each time. I am puzzled..

    1 Update: Overstated, withdrawn.

    After Compline,
    Zaxo

      I have
      887712 Mar 25 2001 /lib/libc-2.1.3.so
      in my /lib directory. We're running version Debian GNU/Linux 2.2.15.

      I remain puzzled.

      --t. alex

      "There was supposed to be an earth-shattering kaboom!" --Marvin the Martian