You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Blair Zajac <bl...@orcaware.com> on 2008/08/23 19:28:27 UTC

svn_checksum_to_cstring() core dump; trying to deference NULL

Using r32663:

$ ./checkout_tests.py -v 9

#0  0x000df0de in svn_checksum_to_cstring (checksum=0x0, pool=0x1021a18) at 
subversion/libsvn_subr/checksum.c:119
119       switch (checksum->kind)

Details below.

Blair



$ ./checkout_tests.py -v 9
CMD: svnadmin create svn-test-work/local_tmp/repos --bdb-txn-nosync <TIME = 
0.114519>
CMD: svn import -m "Log message for revision 1." 
svn-test-work/local_tmp/greekfiles 
file:///Users/blair/Code/Subversion/svn-trunk-build-no-mods/subversion/tests/cmdline/svn-test-work/local_tmp/repos 
--config-dir 
/Users/blair/Code/Subversion/svn-trunk-build-no-mods/subversion/tests/cmdline/svn-test-work/local_tmp/config 
--password rayjandom --no-auth-cache --username jrandom <TIME = 0.230373>
Adding         svn-test-work/local_tmp/greekfiles/A
Adding         svn-test-work/local_tmp/greekfiles/A/B
Adding         svn-test-work/local_tmp/greekfiles/A/B/lambda
Adding         svn-test-work/local_tmp/greekfiles/A/B/E
Adding         svn-test-work/local_tmp/greekfiles/A/B/E/alpha
Adding         svn-test-work/local_tmp/greekfiles/A/B/E/beta
Adding         svn-test-work/local_tmp/greekfiles/A/B/F
Adding         svn-test-work/local_tmp/greekfiles/A/mu
Adding         svn-test-work/local_tmp/greekfiles/A/C
Adding         svn-test-work/local_tmp/greekfiles/A/D
Adding         svn-test-work/local_tmp/greekfiles/A/D/gamma
Adding         svn-test-work/local_tmp/greekfiles/A/D/G
Adding         svn-test-work/local_tmp/greekfiles/A/D/G/pi
Adding         svn-test-work/local_tmp/greekfiles/A/D/G/rho
Adding         svn-test-work/local_tmp/greekfiles/A/D/G/tau
Adding         svn-test-work/local_tmp/greekfiles/A/D/H
Adding         svn-test-work/local_tmp/greekfiles/A/D/H/chi
Adding         svn-test-work/local_tmp/greekfiles/A/D/H/omega
Adding         svn-test-work/local_tmp/greekfiles/A/D/H/psi
Adding         svn-test-work/local_tmp/greekfiles/iota

Committed revision 1.
CMD: svnadmin create svn-test-work/repositories/checkout_tests-9 
--bdb-txn-nosync <TIME = 0.107739>
CMD: 
/Users/blair/Code/Subversion/svn-trunk-build-no-mods/subversion/svnadmin/svnadmin 
load --force-uuid --quiet svn-test-work/repositories/checkout_tests-9 terminated 
by signal 10
CMD: svnadmin load --force-uuid --quiet 
svn-test-work/repositories/checkout_tests-9EXCEPTION: SVNProcessTerminatedBySignal
Traceback (most recent call last):
   File 
"/Users/blair/Code/Subversion/svn-trunk-build-no-mods/subversion/tests/cmdline/svntest/main.py", 
line 1116, in run
     rc = apply(self.pred.run, (), kw)
   File 
"/Users/blair/Code/Subversion/svn-trunk-build-no-mods/subversion/tests/cmdline/svntest/testcase.py", 
line 121, in run
     return self.func(sandbox)
   File "./checkout_tests.py", line 356, in checkout_broken_eol
     'checkout_broken_eol.dump'))
   File 
"/Users/blair/Code/Subversion/svn-trunk-build-no-mods/subversion/tests/cmdline/svntest/actions.py", 
line 325, in load_repo
     run_and_verify_load(sbox.repo_dir, dump_str)
   File 
"/Users/blair/Code/Subversion/svn-trunk-build-no-mods/subversion/tests/cmdline/svntest/actions.py", 
line 300, in run_and_verify_load
     'load', '--force-uuid', '--quiet', repo_dir)
   File 
"/Users/blair/Code/Subversion/svn-trunk-build-no-mods/subversion/tests/cmdline/svntest/main.py", 
line 442, in run_command_stdin
     *varargs)
   File 
"/Users/blair/Code/Subversion/svn-trunk-build-no-mods/subversion/tests/cmdline/svntest/main.py", 
line 422, in spawn_process
     exit_code = wait_on_pipe(kid, stdout_lines, stderr_lines)
   File 
"/Users/blair/Code/Subversion/svn-trunk-build-no-mods/subversion/tests/cmdline/svntest/main.py", 
line 389, in wait_on_pipe
     raise SVNProcessTerminatedBySignal
SVNProcessTerminatedBySignal
FAIL:  checkout_tests.py 9: checkout file with broken eol style



orca1-internal:cmdline blair$ gdb ../../svn/.libs/svn /cores/core.24128
GNU gdb 6.3.50-20050815 (Apple version gdb-960) (Sun May 18 18:38:33 UTC 2008)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-apple-darwin"...Reading symbols for shared 
libraries ................................... done

Core was generated by 
`/Users/blair/Code/Subversion/svn-trunk-build-no-mods/subversion/svnadmin/.libs/svnadmin'.
Reading symbols for shared libraries . done
Reading symbols for shared libraries 
............................................... done
#0  0x000df0de in svn_checksum_to_cstring (checksum=0x0, pool=0x1021a18) at 
subversion/libsvn_subr/checksum.c:119
119       switch (checksum->kind)
(gdb) bt
#0  0x000df0de in svn_checksum_to_cstring (checksum=0x0, pool=0x1021a18) at 
subversion/libsvn_subr/checksum.c:119
#1  0x00040e09 in set_fulltext (stream=0xbfffea90, node_baton=0x1021a58) at 
subversion/libsvn_repos/load.c:1286
#2  0x0003eb03 in parse_text_block (stream=0x101b1d8, content_length=12, 
is_delta=0, parse_fns=0x101b2b0, record_baton=0x1021a58, buffer=0x92e018 "### 
This file controls the configuration of the FSFS 
filesystem.\n\n[memcached-servers]\n### These options name memcached servers 
used to cache internal FSFS\n### data.  See http://www.danga.com/memcached"..., 
buflen=16384, pool=0x1021a18) at subversion/libsvn_repos/load.c:465
#3  0x0003f6aa in svn_repos_parse_dumpstream2 (stream=0x101b1d8, 
parse_fns=0x101b2b0, parse_baton=0x101b210, cancel_func=0x2967, 
cancel_baton=0x0, pool=0x100fa18) at subversion/libsvn_repos/load.c:733
#4  0x000414be in svn_repos_load_fs2 (repos=0x100fc18, dumpstream=0x101b1d8, 
feedback_stream=0x0, uuid_action=svn_repos_load_uuid_force, parent_dir=0x0, 
use_pre_commit_hook=0, use_post_commit_hook=0, cancel_func=0x2967, 
cancel_baton=0x0, pool=0x100fa18) at subversion/libsvn_repos/load.c:1497
#5  0x000037d6 in svn_cl__blame (os=0x100fb38, baton=0xbfffed8c, pool=0x100fa18) 
at subversion/svn/blame-cmd.c:318
#6  0x00005f56 in svn_cl__conflict_handler (result=0x5, desc=0xbfffee60, 
baton=0xbfffee78, pool=0xbfffeef4) at subversion/svn/conflict-callbacks.c:547
#7  0x000028c6 in ?? ()

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn_checksum_to_cstring() core dump; trying to deference NULL

Posted by Karl Fogel <kf...@red-bean.com>.
Blair Zajac <bl...@orcaware.com> writes:
> Using r32663:
>
> $ ./checkout_tests.py -v 9
>
> #0  0x000df0de in svn_checksum_to_cstring (checksum=0x0,
> pool=0x1021a18) at subversion/libsvn_subr/checksum.c:119
> 119       switch (checksum->kind)
>
> Details below.

Got a fix for this; running 'make check', will commit when done.

[[[
Don't segfault when loading a dumpfile that does not contain checksums.

This fixes the crash reported by Blair Zajac for checkout_tests 9,
"checkout file with broken eol style".

* subversion/libsvn_repos/load.c
  (apply_textdelta, set_fulltext): Any of the checksums in struct
    node_baton can be NULL, so check before using them.
]]]

Index: subversion/libsvn_repos/load.c
===================================================================
--- subversion/libsvn_repos/load.c	(revision 32670)
+++ subversion/libsvn_repos/load.c	(working copy)
@@ -1268,10 +1268,12 @@
 
   return svn_fs_apply_textdelta(handler, handler_baton,
                                 rb->txn_root, nb->path,
+                                nb->base_checksum ?
                                 svn_checksum_to_cstring(nb->base_checksum,
-                                                        nb->pool),
+                                                        nb->pool) : NULL,
+                                nb->result_checksum ?
                                 svn_checksum_to_cstring(nb->result_checksum,
-                                                        nb->pool),
+                                                        nb->pool) : NULL,
                                 nb->pool);
 }
 
@@ -1285,8 +1287,9 @@
 
   return svn_fs_apply_text(stream,
                            rb->txn_root, nb->path,
+                           nb->result_checksum ?
                            svn_checksum_to_cstring(nb->result_checksum,
-                                                   nb->pool),
+                                                   nb->pool) : NULL,
                            nb->pool);
 }
 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org