Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 25 Mar 2006 17:20:17 GMT
From:      Adrian Steinmann <ast@marabu.ch>
To:        freebsd-rc@FreeBSD.org
Subject:   Re: bin/94767: [patch] rcorder(8) dumps core when does not use a proper RCng script (dansguardian)
Message-ID:  <200603251720.k2PHKHNM091528@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/94767; it has been noted by GNATS.

From: Adrian Steinmann <ast@marabu.ch>
To: bug-followup@FreeBSD.org
Cc: ganbold@micom.mng.net
Subject: Re: bin/94767: [patch] rcorder(8) dumps core when does not use a
 proper RCng script (dansguardian)
Date: Sat, 25 Mar 2006 18:13:54 +0100 (CET)

   This message is in MIME format.  The first part should be readable text,
   while the remaining parts are likely unreadable without MIME-aware tools.
 
 --0-674585855-1143306834=:31295
 Content-Type: TEXT/PLAIN; charset=iso-8859-1; format=flowed
 Content-Transfer-Encoding: 8BIT
 
 
 I've run into this problem on -current too and have created three
 test cases which dump core. With the mentioned patch two of the
 cases are fixed, but one remains: It seems the "don't nuke unless
 last node" patch works when no third "stub dependancy" interferes.
 
 On 6.1-PRERELEASE all three test cases pass.
 
 Adrian
 
 Details:
 
 #!/bin/sh
 
 try()
 {
      [ $# -lt 2 ] && return
      echo "=============== TEST rcorder $@"
      files=$@
      cmd="rcorder $files"
      for f in $files
      do
          echo === cat $f:
          cat $f
      done
      rm -f rcorder.core
      echo === $cmd:
      eval $cmd
      [ -e rcorder.core ] && echo "DUMPED CORE - ^C to stop" && read a
      rm -f rcorder.core $@
      echo
 }
 
 { echo "# PROVIDE: A"; echo "# REQUIRE: B"; } >A
 { echo "# PROVIDE: B"; echo "# REQUIRE: A"; } >B
 try A B
 
 { echo "# PROVIDE: A"; echo "# REQUIRE: B C"; } >A
 { echo "# PROVIDE: B"; echo "# REQUIRE: A C"; } >B
 { echo "# PROVIDE: C"; } > C
 try A B C
 
 { echo "# PROVIDE: A"; echo "# REQUIRE: B"; } >A
 { echo "# PROVIDE: B"; echo "# REQUIRE: C"; } >B
 { echo "# PROVIDE: C"; echo "# REQUIRE: A"; } >C
 try A B C
 
 exit 0
 
 
 Index: rcorder.c
 ===================================================================
 RCS file: /usr/cvs/src/sbin/rcorder/rcorder.c,v
 retrieving revision 1.2
 diff -u -r1.2 rcorder.c
 --- rcorder.c   17 Jan 2006 08:01:00 -0000      1.2
 +++ rcorder.c   25 Mar 2006 16:40:33 -0000
 @@ -51,8 +51,9 @@
   #include "sprite.h"
   #include "hash.h"
 
 +#define DEBUG 1
   #ifdef DEBUG
 -int debug = 0;
 +int debug = 1;
   # define       DPRINTF(args) if (debug) { fflush(stdout); fprintf args; }
   #else
   # define       DPRINTF(args)
 
 here, all three test cases dump core, apparently the stack is being hit
 in the first and third case:
 
 =============== TEST1 rcorder A B
 ...
 generate on ZZZZZZZZZZZZZZZZZZZZ
 do_file on ZZZZZZZZZZZZZZZZZZZZ.
 Segmentation fault (core dumped)
 DUMPED CORE - ^C to stop
 
 Core was generated by `rcorder'.
 Program terminated with signal 11, Segmentation fault.
 #0  0x080493ac in satisfy_req (rnode=0x5a5a5a5a,
      filename=0xbfbfe7b0 "?㿿\003\001") at /usr/src/sbin/rcorder/rcorder.c:655
 655             entry = rnode->entry;
 (gdb) where
 #0  0x080493ac in satisfy_req (rnode=0x5a5a5a5a,
      filename=0xbfbfe7b0 "?㿿\003\001") at /usr/src/sbin/rcorder/rcorder.c:655
 #1  0x08048fa3 in do_file (fnode=0xa000110)
      at /usr/src/sbin/rcorder/rcorder.c:759
 #2  0x0804917b in generate_ordering () at /usr/src/sbin/rcorder/rcorder.c:827
 #3  0x08049369 in main (argc=2, argv=0x1)
      at /usr/src/sbin/rcorder/rcorder.c:193
 
 =============== TEST2 rcorder A B C
 Program terminated with signal 11, Segmentation fault.
 #0  satisfy_req (rnode=0xa000374, filename=0xa0001a0 "B")
      at /usr/src/sbin/rcorder/rcorder.c:666
 666             if (head->next == NULL)
 (gdb) where
 #0  satisfy_req (rnode=0xa000374, filename=0xa0001a0 "B")
      at /usr/src/sbin/rcorder/rcorder.c:666
 #1  0x08048fa3 in do_file (fnode=0xa0003e0)
      at /usr/src/sbin/rcorder/rcorder.c:759
 #2  0x080493d7 in satisfy_req (rnode=0xa000374, filename=0xa0001a0 "B")
      at /usr/src/sbin/rcorder/rcorder.c:687
 #3  0x08048fa3 in do_file (fnode=0xa000110)
      at /usr/src/sbin/rcorder/rcorder.c:759
 #4  0x080493d7 in satisfy_req (rnode=0xa000374, filename=0xa0001a0 "B")
      at /usr/src/sbin/rcorder/rcorder.c:687
 #5  0x08048fa3 in do_file (fnode=0xa0003e0)
      at /usr/src/sbin/rcorder/rcorder.c:759
 #6  0x0804917b in generate_ordering () at /usr/src/sbin/rcorder/rcorder.c:827
 #7  0x08049369 in main (argc=3, argv=0x1)
      at /usr/src/sbin/rcorder/rcorder.c:193
 
 =============== TEST3 rcorder A B C
 Program terminated with signal 11, Segmentation fault.
 #0  0x080493ac in satisfy_req (rnode=0x5a5a5a5a,
      filename=0xbfbfe7b0 "?㿿???\n") at /usr/src/sbin/rcorder/rcorder.c:655
 655             entry = rnode->entry;
 (gdb) where
 #0  0x080493ac in satisfy_req (rnode=0x5a5a5a5a,
      filename=0xbfbfe7b0 "?㿿???\n") at /usr/src/sbin/rcorder/rcorder.c:655
 #1  0x08048fa3 in do_file (fnode=0xa000360)
      at /usr/src/sbin/rcorder/rcorder.c:759
 #2  0x0804917b in generate_ordering () at /usr/src/sbin/rcorder/rcorder.c:827
 #3  0x08049369 in main (argc=3, argv=0x1)
      at /usr/src/sbin/rcorder/rcorder.c:193
 
 
 with the patch proposed earlier (skip nuking)
 
 Index: rcorder.c
 ===================================================================
 RCS file: /usr/cvs/src/sbin/rcorder/rcorder.c,v
 retrieving revision 1.2
 diff -u -r1.2 rcorder.c
 --- rcorder.c   17 Jan 2006 08:01:00 -0000      1.2
 +++ rcorder.c   25 Mar 2006 16:45:38 -0000
 @@ -51,8 +51,9 @@
   #include "sprite.h"
   #include "hash.h"
 
 +#define DEBUG 1
   #ifdef DEBUG
 -int debug = 0;
 +int debug = 1;
   # define       DPRINTF(args) if (debug) { fflush(stdout); fprintf args; }
   #else
   # define       DPRINTF(args)
 @@ -796,10 +797,14 @@
                  fnode->last->next = fnode->next;
          }
 
 -       DPRINTF((stderr, "nuking %s\n", fnode->filename));
          if (was_set == 0) {
 +               DPRINTF((stderr, "nuking %s\n", fnode->filename));
 +#if 0
                  free(fnode->filename);
                  free(fnode);
 +#else
 +               DPRINTF((stderr, "but skipping it for now\n"));
 +#endif
          }
   }
 
 only TEST2 dumps core:
 
 =============== TEST2 rcorder A B C
 === cat A:
 # PROVIDE: A
 # REQUIRE: B C
 === cat B:
 # PROVIDE: B
 # REQUIRE: A C
 === cat C:
 # PROVIDE: C
 === rcorder A B C:
 parse_args
 initialize
 crunch_all_files
 generate on C
 do_file on C.
 next do: C
 nuking C
 but skipping it for now
 generate on B
 do_file on B.
 do_file on A.
 do_file on B.
 rcorder: Circular dependency on file `B'.
 Segmentation fault (core dumped)
 
 Program terminated with signal 11, Segmentation fault.
 #0  0x080493d0 in satisfy_req ()
 (gdb) where
 #0  0x080493d0 in satisfy_req ()
 #1  0x08048fa3 in do_file ()
 #2  0x080493ef in satisfy_req ()
 #3  0x08048fa3 in do_file ()
 #4  0x080493ef in satisfy_req ()
 #5  0x08048fa3 in do_file ()
 #6  0x08049193 in generate_ordering ()
 #7  0x08049381 in main ()
 
 --0-674585855-1143306834=:31295--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200603251720.k2PHKHNM091528>