You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Ben Collins-Sussman <su...@newton.collab.net> on 2000/11/30 16:11:11 UTC

bug in xml-output-editor (?)

Hey Greg H. --

I found a repeatable segfault bug in xml_output.c when I try to commit
under certain simple circumstances.

Specifically, I check out the "t1" subdir, append to one file, and
replace the contents of a second file.  When I commit, the segfault
happens in xml_output.c (get_to_elem), line 169 -- attempting to
dereference a NULL value of fb.  fb is NULL because eb->curfile is
NULL.  

Beyond that, it's hard for me to understand what's wrogn, only because
I don't feel like taking the time to understand all of your code.  I
have a million other things on my to-do list.  :)

Here's the script I'm using;  segfaults every time:

------------------------------------------------------------------
#!/bin/sh

# Testing merging and conflict resolution. 

SVN_PROG=../svn
TEST_DIR_1=t1
TEST_DIR_2=t2
COMMIT_RESULTFILE_NAME=commit3
ANCESTOR_PATH=anni       # See if Greg Stein notices. :-) 

check_status()
{
    res=$?
    if [ $res -ne 0 ]; then
      echo Oops, problem: ${@-"(no further details)"}
      exit $res
    fi
}

# Remove the testing trees
rm -rf ${TEST_DIR_1} ${TEST_DIR_2} ${COMMIT_RESULTFILE_NAME}*

echo

##### Run tests: #####

### Check out t1/
echo "Checking out ${TEST_DIR_1}."
${SVN_PROG} checkout                                      \
      --target-dir ${TEST_DIR_1}                          \
      --xml-file ../../tests-common/xml/co1-inline.xml    \
      --revision 1                                        \
      --ancestor-path ${ANCESTOR_PATH}

check_status 1

### Make local changes to pi's and rho's text.
echo "Making local text changes on pi and rho."
echo "new text for pi" >> ${TEST_DIR_1}/A/D/G/pi
echo "z" > ${TEST_DIR_1}/A/D/G/rho
check_status 2

### Examine status; we should see local mods present.
echo "Status of directory:"
${SVN_PROG} status ${TEST_DIR_1}
check_status 3

### Try to commit.
echo "Attempting to commit."
${SVN_PROG} commit --target-dir ${TEST_DIR_1} \
                   --xml-file ${COMMIT_RESULTFILE_NAME}-1.xml \
                   --revision 22
check_status 4

### Examine status; everything should be up-to-date.
echo "Status of directory:"
${SVN_PROG} status ${TEST_DIR_1}
check_status 5


exit 0

Re: bug in xml-output-editor (?)

Posted by Ben Collins-Sussman <su...@newton.collab.net>.
Ben Collins-Sussman <su...@newton.collab.net> writes:

> Perhaps I'll chase this bug down after all... it might not be in your
> editor, Greg.  It's possible that it could be in my editor-driver
> (adm_crawler.c).  I'll keep you posted.

OK, I just carefully stepped through adm_crawler, and it seems to be
driving the editor correctly.   

Then I did another experiment: I made the commit command use the
"test-editor" in tests-common/, the one that prints plain english,
instead of the xml-output editor.  The normally-segfaulting commit
now works fine, and looks kosher:

-----------------------------------
Attempting to commit.
REPLACE_ROOT:  name '/blah', revision '37'
  REPLACE_DIR:  name 'A', ancestor 'anni/A' revision 1
    REPLACE_DIR:  name 'D', ancestor 'anni/A/D' revision 1
      REPLACE_DIR:  name 'H', ancestor 'anni/A/D/H' revision 1
        REPLACE_FILE:  name 'omega', ancestor 'anni/A/D/H/omega' revision 1
        REPLACE_FILE:  name 'psi', ancestor 'anni/A/D/H/psi' revision 1
      CLOSE_DIR '/blah/A/D/H'
    CLOSE_DIR '/blah/A/D'
  CLOSE_DIR '/blah/A'
CLOSE_DIR '/blah'
          TEXT-DELTA on file 'omega':
          txdelta window: source text: offset 0, length 25
          txdelta window: new text (2 bytes): z

          end of windows
        CLOSE_FILE 'omega'
          TEXT-DELTA on file 'psi':
          txdelta window: source text: offset 0, length 23
          txdelta window: new text (16 bytes): new text for pi

          end of windows
        CLOSE_FILE 'psi'
EDIT COMPLETE.
------------------------------------

(Man, I *love* being able to just swap editors in a pinch!)

Anyway -- Greg H. -- I'm now pretty convinced that there's something wrong
in xml_output.c.  The ball's in your court.

Enough of this;  I've got other stuff to do.  :)

Re: bug in xml-output-editor (?)

Posted by Ben Collins-Sussman <su...@newton.collab.net>.
Ben Collins-Sussman <su...@newton.collab.net> writes:

> Specifically, I check out the "t1" subdir, append to one file, and
> replace the contents of a second file.  When I commit, the segfault
> happens in xml_output.c (get_to_elem), line 169 -- attempting to
> dereference a NULL value of fb.  fb is NULL because eb->curfile is
> NULL.  

I've generalized the bug: the commit segfaults if and *only* if there
are two locally modified files in the *same* directory.  At least that
I'm discovering by experimentation.

Perhaps I'll chase this bug down after all... it might not be in your
editor, Greg.  It's possible that it could be in my editor-driver
(adm_crawler.c).  I'll keep you posted.