You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by "Hyrum K. Wright" <hy...@mail.utexas.edu> on 2009/01/21 14:59:20 UTC
segfault in 'svn up' on trunk
I updated my trunk client this morning to the latest HEAD (r35365) and then
tried to use that version to update another working copy. The following is the
result:
(gdb) r up
Reading symbols for shared libraries .. done
D build/transform-sql.py
A build/transform_sql.py
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x69737265
0x0014965a in canonicalize (type=type_uri, path=0x69737265 <Address 0x69737265
out of bounds>, pool=0x10b6818) at subversion/libsvn_subr/dirent_uri.c:191
/Users/Hyrum/dev/svn-trunk/subversion/libsvn_subr/dirent_uri.c:191:5791:beg:0x14965a
(gdb)
No source file named address.
(gdb) backtrace
#0 0x0014965a in canonicalize (type=type_uri, path=0x69737265 <Address
0x69737265 out of bounds>, pool=0x10b6818) at
subversion/libsvn_subr/dirent_uri.c:191
#1 0x0014acaa in svn_uri_canonicalize (uri=0x69737265 <Address 0x69737265 out
of bounds>, pool=0x10b6818) at subversion/libsvn_subr/dirent_uri.c:1108
#2 0x0014950c in local_style (type=type_uri, path=0x69737265 <Address
0x69737265 out of bounds>, pool=0x10b6818) at subversion/libsvn_subr/dirent_uri.c:92
#3 0x00149e0b in svn_uri_local_style (uri=0x69737265 <Address 0x69737265 out of
bounds>, pool=0x10b6818) at subversion/libsvn_subr/dirent_uri.c:630
#4 0x0015a1f7 in svn_path_local_style (path=0x69737265 <Address 0x69737265 out
of bounds>, pool=0x10b6818) at subversion/libsvn_subr/path.c:61
#5 0x0000fc78 in notify (baton=0x744a78, n=0x10cab18, pool=0x10b6818) at
subversion/svn/notify.c:143
#6 0x0008c373 in close_file (file_baton=0x10b6890, expected_hex_digest=0x9a7188
"1f55d0a0cfe2a7d443dd0eb08ad26229", pool=0x10b6818) at
subversion/libsvn_wc/update_editor.c:4093
#7 0x0005d5a3 in close_file (file_baton=0x10b6860, text_checksum=0x9a7188
"1f55d0a0cfe2a7d443dd0eb08ad26229", pool=0x10b6818) at
subversion/libsvn_wc/ambient_depth_filter_editor.c:450
#8 0x0013abc4 in close_file (file_baton=0x10b6858, text_checksum=0x9a7188
"1f55d0a0cfe2a7d443dd0eb08ad26229", pool=0x10b6818) at
subversion/libsvn_delta/cancel.c:229
#9 0x0010ca5f in end_element (userdata=0x105cf88, state=240, nspace=0x8102f0
"svn:", elt_name=0x8135b0 "open-file") at subversion/libsvn_ra_neon/fetch.c:2070
#10 0x0011d227 in wrapper_endelm_cb (baton=0x1071ad8, state=240, nspace=0x8102f0
"svn:", name=0x8135b0 "open-file") at subversion/libsvn_ra_neon/util.c:1067
#11 0x00400b27 in end_element ()
#12 0x005dbb1d in doContent ()
#13 0x005dc9de in contentProcessor ()
#14 0x005da631 in doProlog ()
#15 0x005db3b5 in prologProcessor ()
#16 0x005d3a16 in XML_ParseBuffer ()
#17 0x0040121c in ne_xml_parse ()
#18 0x0011d50d in cancellation_callback (userdata=0x1022720, block=0x108ea08
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<S:update-report xmlns:S=\"svn:\"
xmlns:V=\"http://subversion.tigris.org/xmlns/dav/\" xmlns:D=\"DAV:\"
send-all=\"true\">\n<S:target-revision rev=\"35365\"/>\n<S:open-direct"...,
len=8192) at subversion/libsvn_ra_neon/util.c:1148
#19 0x003ff900 in do_inflate ()
#20 0x003f3501 in ne_read_response_block ()
#21 0x003f39c4 in ne_discard_response ()
#22 0x003f4b2b in ne_request_dispatch ()
#23 0x0011dd99 in svn_ra_neon__request_dispatch (code_p=0x0, req=0x1071a58,
extra_headers=0x10225a0, body=0x0, okay_1=200, okay_2=0, pool=0x101f418) at
subversion/libsvn_ra_neon/util.c:1449
#24 0x0011d724 in parsed_request (req=0x1071a58, ras=0x7e7800, method=0x18f5ec
"REPORT", url=0x7e7c10 "/repos/svn/!svn/vcc/default", body=0x0,
body_file=0x105d648, set_parser=0, startelm_cb=0x10a513 <start_element>,
cdata_cb=0x10c3ef <cdata_handler>, endelm_cb=0x10c534 <end_element>,
baton=0x105cf88, extra_headers=0x10225a0, status_code=0x0, spool_response=0,
pool=0x101f418) at subversion/libsvn_ra_neon/util.c:1228
#25 0x0011d95c in svn_ra_neon__parsed_request (sess=0x7e7800, method=0x18f5ec
"REPORT", url=0x7e7c10 "/repos/svn/!svn/vcc/default", body=0x0,
body_file=0x105d648, set_parser=0, startelm_cb=0x10a513 <start_element>,
cdata_cb=0x10c3ef <cdata_handler>, endelm_cb=0x10c534 <end_element>,
baton=0x105cf88, extra_headers=0x10225a0, status_code=0x0, spool_response=0,
pool=0x101f418) at subversion/libsvn_ra_neon/util.c:1291
#26 0x0010d7cc in reporter_finish_report (report_baton=0x105cf88,
pool=0x101f418) at subversion/libsvn_ra_neon/fetch.c:2388
#27 0x000541a0 in svn_wc_crawl_revisions4 (path=0x744a70 "",
adm_access=0x101f5a8, reporter=0x1a27f0, report_baton=0x105cf88,
restore_files=1, depth=svn_depth_unknown, honor_depth_exclude=1,
depth_compatibility_trick=0, use_commit_times=0, notify_func=0xfbc5 <notify>,
notify_baton=0x744a78, traversal_info=0x101f458, pool=0x101f418) at
subversion/libsvn_wc/adm_crawler.c:711
#28 0x00051938 in svn_client__update_internal (result_rev=0xbffff488,
path=0x744a70 "", revision=0xbffff65c, depth=svn_depth_unknown,
depth_is_sticky=0, ignore_externals=0, allow_unver_obstructions=0,
timestamp_sleep=0xbffff48c, send_copyfrom_args=1, ctx=0x1011a38, pool=0x101f418)
at subversion/libsvn_client/update.c:254
#29 0x00051bce in svn_client_update3 (result_revs=0x0, paths=0x744a40,
revision=0xbffff65c, depth=svn_depth_unknown, depth_is_sticky=0,
ignore_externals=0, allow_unver_obstructions=0, ctx=0x1011a38, pool=0x1011418)
at subversion/libsvn_client/update.c:337
#30 0x000172aa in svn_cl__update (os=0x10115c0, baton=0xbffff648,
pool=0x1011418) at subversion/svn/update-cmd.c:84
#31 0x0000e47f in main (argc=2, argv=0xbffff814) at subversion/svn/main.c:2122
(gdb)
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1041272
Re: segfault in 'svn up' on trunk
Posted by Julian Foad <ju...@btopenworld.com>.
On Thu, 2009-01-22 at 15:49 +0000, Julian Foad wrote:
> Greg Stein wrote:
> > They should NOT be switched over without prejudice. Total -1 to that.
> >
> > Review them? Sure. But I'm very much against a simple search/replace.
> > That's bogus.
>
> Indeed. Execution time is not the primary consideration for switching to
> always-initialise-to-zero.
>
> Would the execution time be negligible? Yes, almost everywhere.
>
> Would the change prevent uninitialised fields? Fields that are not
> explicitly initialized would get the value 0 rather than an
> unpredictable value, and zero may be a "safe" and even the right value
> in many cases, and the predictability may help debugging in cases where
> it is not the right value.
>
> Would the change reduce the likelihood of us introducing bugs? If the
> programmer forgets to initialise a new field, the result would be the
> same as if he had chosen that its value should be zero, so the lack of
> thought is hidden and the code might work as intended... or might not.
> And there's a different kind of bug if we choose not to
> double-initialise fields that should be zero...
>
> The change in r35366:
>
> [[[
> ------------------------------------------------------------------------
> r35366 | rhuijben | 2009-01-21 15:07:05 +0000 (Wed, 21 Jan 2009) | 9 lines
>
> * subversion/libsvn_wc/util.c
> (svn_wc_create_notify): Use apr_pcalloc and only set fields that have a
> non null value.
>
> Found by: hwright
>
> Resolves the segfault reported in
> <http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1041272>
>
> ------------------------------------------------------------------------
> Index: subversion/libsvn_wc/util.c
> ===================================================================
> --- subversion/libsvn_wc/util.c (revision 35365)
> +++ subversion/libsvn_wc/util.c (revision 35366)
> @@ -116,19 +116,13 @@
> svn_wc_notify_action_t action,
> apr_pool_t *pool)
> {
> - svn_wc_notify_t *ret = apr_palloc(pool, sizeof(*ret));
> + svn_wc_notify_t *ret = apr_pcalloc(pool, sizeof(*ret));
> ret->path = path;
> ret->action = action;
> ret->kind = svn_node_unknown;
> - ret->mime_type = NULL;
> - ret->lock = NULL;
> - ret->err = SVN_NO_ERROR;
> ret->content_state = ret->prop_state = svn_wc_notify_state_unknown;
> ret->lock_state = svn_wc_notify_lock_state_unknown;
> ret->revision = SVN_INVALID_REVNUM;
> - ret->changelist_name = NULL;
> - ret->merge_range = NULL;
> - ret->path_prefix = NULL;
>
> return ret;
> }
> ]]]
>
> ... trades one kind of potential error (forgetting to initialize a new
> field) for another kind. The new code encodes the knowledge that
> SVN_INVALID_REVNUM and svn_wc_notify_lock_state_unknown have non-zero
> bit patterns, and that SVN_NO_ERROR has an all-zero bit pattern. This is
> not robust and, I assert, not good.
(I mean it's not a robust and good practice. In this particular
instance, the change is safe because null pointers are all-zeros on all
architectures to which we might want to be portable, and SVN_NO_ERROR is
already required to be zero.)
- Julian
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1043272
Re: segfault in 'svn up' on trunk
Posted by Julian Foad <ju...@btopenworld.com>.
Greg Stein wrote:
> They should NOT be switched over without prejudice. Total -1 to that.
>
> Review them? Sure. But I'm very much against a simple search/replace.
> That's bogus.
Indeed. Execution time is not the primary consideration for switching to
always-initialise-to-zero.
Would the execution time be negligible? Yes, almost everywhere.
Would the change prevent uninitialised fields? Fields that are not
explicitly initialized would get the value 0 rather than an
unpredictable value, and zero may be a "safe" and even the right value
in many cases, and the predictability may help debugging in cases where
it is not the right value.
Would the change reduce the likelihood of us introducing bugs? If the
programmer forgets to initialise a new field, the result would be the
same as if he had chosen that its value should be zero, so the lack of
thought is hidden and the code might work as intended... or might not.
And there's a different kind of bug if we choose not to
double-initialise fields that should be zero...
The change in r35366:
[[[
------------------------------------------------------------------------
r35366 | rhuijben | 2009-01-21 15:07:05 +0000 (Wed, 21 Jan 2009) | 9 lines
* subversion/libsvn_wc/util.c
(svn_wc_create_notify): Use apr_pcalloc and only set fields that have a
non null value.
Found by: hwright
Resolves the segfault reported in
<http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1041272>
------------------------------------------------------------------------
Index: subversion/libsvn_wc/util.c
===================================================================
--- subversion/libsvn_wc/util.c (revision 35365)
+++ subversion/libsvn_wc/util.c (revision 35366)
@@ -116,19 +116,13 @@
svn_wc_notify_action_t action,
apr_pool_t *pool)
{
- svn_wc_notify_t *ret = apr_palloc(pool, sizeof(*ret));
+ svn_wc_notify_t *ret = apr_pcalloc(pool, sizeof(*ret));
ret->path = path;
ret->action = action;
ret->kind = svn_node_unknown;
- ret->mime_type = NULL;
- ret->lock = NULL;
- ret->err = SVN_NO_ERROR;
ret->content_state = ret->prop_state = svn_wc_notify_state_unknown;
ret->lock_state = svn_wc_notify_lock_state_unknown;
ret->revision = SVN_INVALID_REVNUM;
- ret->changelist_name = NULL;
- ret->merge_range = NULL;
- ret->path_prefix = NULL;
return ret;
}
]]]
... trades one kind of potential error (forgetting to initialize a new
field) for another kind. The new code encodes the knowledge that
SVN_INVALID_REVNUM and svn_wc_notify_lock_state_unknown have non-zero
bit patterns, and that SVN_NO_ERROR has an all-zero bit pattern. This is
not robust and, I assert, not good.
- Julian
> Hyrum K. Wright wrote:
> > C. Michael Pilato wrote:
> >> Stefan Sperling wrote:
> >>> On Wed, Jan 21, 2009 at 11:11:59PM +0100, Bert Huijben wrote:
> >>>> Note that this was just a dangling pointer in a svn_wc_notify_t
> >>>> structure
> >>>> that wasn't initialized with apr_pcalloc as I expected, but with
> >>>> apr_palloc.
> >>>> See r35366.
> >>>
> >>> Maybe we should also do an apr_palloc -> apr_pcalloc sweep?
> >>
> >> +1. I know, I know, I know that careful coders shouldn't need to force a
> >> memset(0) on all their allocations. But sometimes we just aren't
> >> perfectly
> >> careful coders, and the cost of such runtime crutches approaches zero
> >> daily
> >> (and has already, in my opinion, dipped well below the threshold of
> >> user-visibility).
> >
> > FWIW, there are 403 locations of apr_palloc() in our code which will need to
> > be switched over.
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1043264
Re: segfault in 'svn up' on trunk
Posted by Greg Stein <gs...@gmail.com>.
They should NOT be switched over without prejudice. Total -1 to that.
Review them? Sure. But I'm very much against a simple search/replace.
That's bogus.
Cheers,
-g
On Thu, Jan 22, 2009 at 16:19, Hyrum K. Wright
<hy...@mail.utexas.edu> wrote:
> C. Michael Pilato wrote:
>>
>> Stefan Sperling wrote:
>>>
>>> On Wed, Jan 21, 2009 at 11:11:59PM +0100, Bert Huijben wrote:
>>>>>
>>>>> -----Original Message-----
>>>>> From: Stefan Sperling [mailto:stsp@elego.de]
>>>>> Sent: Wednesday, January 21, 2009 11:06 PM
>>>>> To: Greg Stein
>>>>> Cc: Hyrum K. Wright; dev@subversion.tigris.org
>>>>> Subject: Re: segfault in 'svn up' on trunk
>>>>>
>>>>> On Wed, Jan 21, 2009 at 04:02:54PM +0100, Greg Stein wrote:
>>>>>>
>>>>>> 0x69737265 looks like ascii characters: i s r e
>>>>>>
>>>>>> Somehow the path pointer is getting munged by some text?
>>>>>
>>>>> We need to audit that code more.
>>>>
>>>> Note that this was just a dangling pointer in a svn_wc_notify_t
>>>> structure
>>>> that wasn't initialized with apr_pcalloc as I expected, but with
>>>> apr_palloc.
>>>> See r35366.
>>>
>>> Thanks!
>>>
>>> Maybe we should also do an apr_palloc -> apr_pcalloc sweep?
>>
>> +1. I know, I know, I know that careful coders shouldn't need to force a
>> memset(0) on all their allocations. But sometimes we just aren't
>> perfectly
>> careful coders, and the cost of such runtime crutches approaches zero
>> daily
>> (and has already, in my opinion, dipped well below the threshold of
>> user-visibility).
>
> FWIW, there are 403 locations of apr_palloc() in our code which will need to
> be switched over.
>
> -Hyrum
>
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1043258
Re: segfault in 'svn up' on trunk
Posted by "Hyrum K. Wright" <hy...@mail.utexas.edu>.
C. Michael Pilato wrote:
> Stefan Sperling wrote:
>> On Wed, Jan 21, 2009 at 11:11:59PM +0100, Bert Huijben wrote:
>>>> -----Original Message-----
>>>> From: Stefan Sperling [mailto:stsp@elego.de]
>>>> Sent: Wednesday, January 21, 2009 11:06 PM
>>>> To: Greg Stein
>>>> Cc: Hyrum K. Wright; dev@subversion.tigris.org
>>>> Subject: Re: segfault in 'svn up' on trunk
>>>>
>>>> On Wed, Jan 21, 2009 at 04:02:54PM +0100, Greg Stein wrote:
>>>>> 0x69737265 looks like ascii characters: i s r e
>>>>>
>>>>> Somehow the path pointer is getting munged by some text?
>>>> We need to audit that code more.
>>> Note that this was just a dangling pointer in a svn_wc_notify_t structure
>>> that wasn't initialized with apr_pcalloc as I expected, but with apr_palloc.
>>> See r35366.
>> Thanks!
>>
>> Maybe we should also do an apr_palloc -> apr_pcalloc sweep?
>
> +1. I know, I know, I know that careful coders shouldn't need to force a
> memset(0) on all their allocations. But sometimes we just aren't perfectly
> careful coders, and the cost of such runtime crutches approaches zero daily
> (and has already, in my opinion, dipped well below the threshold of
> user-visibility).
FWIW, there are 403 locations of apr_palloc() in our code which will need to be
switched over.
-Hyrum
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1043251
Re: segfault in 'svn up' on trunk
Posted by "C. Michael Pilato" <cm...@collab.net>.
Stefan Sperling wrote:
> On Wed, Jan 21, 2009 at 11:11:59PM +0100, Bert Huijben wrote:
>>
>>> -----Original Message-----
>>> From: Stefan Sperling [mailto:stsp@elego.de]
>>> Sent: Wednesday, January 21, 2009 11:06 PM
>>> To: Greg Stein
>>> Cc: Hyrum K. Wright; dev@subversion.tigris.org
>>> Subject: Re: segfault in 'svn up' on trunk
>>>
>>> On Wed, Jan 21, 2009 at 04:02:54PM +0100, Greg Stein wrote:
>>>> 0x69737265 looks like ascii characters: i s r e
>>>>
>>>> Somehow the path pointer is getting munged by some text?
>>> We need to audit that code more.
>> Note that this was just a dangling pointer in a svn_wc_notify_t structure
>> that wasn't initialized with apr_pcalloc as I expected, but with apr_palloc.
>> See r35366.
>
> Thanks!
>
> Maybe we should also do an apr_palloc -> apr_pcalloc sweep?
+1. I know, I know, I know that careful coders shouldn't need to force a
memset(0) on all their allocations. But sometimes we just aren't perfectly
careful coders, and the cost of such runtime crutches approaches zero daily
(and has already, in my opinion, dipped well below the threshold of
user-visibility).
--
C. Michael Pilato <cm...@collab.net>
CollabNet <> www.collab.net <> Distributed Development On Demand
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1043240
Re: segfault in 'svn up' on trunk
Posted by Stefan Sperling <st...@elego.de>.
On Wed, Jan 21, 2009 at 11:11:59PM +0100, Bert Huijben wrote:
>
>
> > -----Original Message-----
> > From: Stefan Sperling [mailto:stsp@elego.de]
> > Sent: Wednesday, January 21, 2009 11:06 PM
> > To: Greg Stein
> > Cc: Hyrum K. Wright; dev@subversion.tigris.org
> > Subject: Re: segfault in 'svn up' on trunk
> >
> > On Wed, Jan 21, 2009 at 04:02:54PM +0100, Greg Stein wrote:
> > > 0x69737265 looks like ascii characters: i s r e
> > >
> > > Somehow the path pointer is getting munged by some text?
> >
> > We need to audit that code more.
>
> Note that this was just a dangling pointer in a svn_wc_notify_t structure
> that wasn't initialized with apr_pcalloc as I expected, but with apr_palloc.
> See r35366.
Thanks!
Maybe we should also do an apr_palloc -> apr_pcalloc sweep?
I.e. make sure all allocations we do will result in properly
initialised values (be it by using apr_pcalloc or initialising
allocated memory by other means)? A lot of our code seems to
assume that memory is always initalised (and why shouldn't it?).
This problem has happened a few times already. At least I remember
a few patches and commits by Stefan Küng that fixed similar problems.
Stefan
RE: segfault in 'svn up' on trunk
Posted by Bert Huijben <rh...@sharpsvn.net>.
> -----Original Message-----
> From: Stefan Sperling [mailto:stsp@elego.de]
> Sent: Wednesday, January 21, 2009 11:06 PM
> To: Greg Stein
> Cc: Hyrum K. Wright; dev@subversion.tigris.org
> Subject: Re: segfault in 'svn up' on trunk
>
> On Wed, Jan 21, 2009 at 04:02:54PM +0100, Greg Stein wrote:
> > 0x69737265 looks like ascii characters: i s r e
> >
> > Somehow the path pointer is getting munged by some text?
>
> We need to audit that code more.
Note that this was just a dangling pointer in a svn_wc_notify_t structure
that wasn't initialized with apr_pcalloc as I expected, but with apr_palloc.
See r35366.
So please do review the dirent api (as it it a big TODO for 1.6), but not
for this specific bug.
Bert
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1042215
Re: segfault in 'svn up' on trunk
Posted by Stefan Sperling <st...@elego.de>.
On Wed, Jan 21, 2009 at 04:02:54PM +0100, Greg Stein wrote:
> 0x69737265 looks like ascii characters: i s r e
>
> Somehow the path pointer is getting munged by some text?
We need to audit that code more.
This seems to be yet another C-string parsing pointer bug.
Quite a few have already been found and fixed, see the history
of libsvn_subr/dirent_uri.c
I've already gone through the first half of that file
and found a few by just reading the code thoroughly enough.
Who knows what else is still in there...
I have no more time for continuing this task right now though.
I guess it would help to get another few pairs of eyes on this.
And yes, hunting for bugs in C-string handling code can actually
be fun. It's certainly a good exercise to keep the average
programmer's brain (like the one I have) in shape :)
I'm starting to think that using pure C strings for all this
parsing stuff might indeed not be a good idea if we don't
get the code reviewed and more solid. Using some abstraction
that does bounds-checking on paths and uris might induce a
performance penalty, but will likely be more safe.
Because, we don't want any of this to be triggered over the network
input path, neither on clients nor on servers. That would be a nightmare.
Right now, the question whether this code will be in 1.6 is still open.
Including it in 1.7 would give us more time to improve the situation.
</rant>
Dang, I wish I had more time to spend on this,
Stefan
>
> On Wed, Jan 21, 2009 at 15:59, Hyrum K. Wright
> <hy...@mail.utexas.edu> wrote:
> > I updated my trunk client this morning to the latest HEAD (r35365) and then
> > tried to use that version to update another working copy. The following is the
> > result:
> >
> > (gdb) r up
> > Reading symbols for shared libraries .. done
> > D build/transform-sql.py
> > A build/transform_sql.py
> >
> > Program received signal EXC_BAD_ACCESS, Could not access memory.
> > Reason: KERN_INVALID_ADDRESS at address: 0x69737265
> > 0x0014965a in canonicalize (type=type_uri, path=0x69737265 <Address 0x69737265
> > out of bounds>, pool=0x10b6818) at subversion/libsvn_subr/dirent_uri.c:191
> > /Users/Hyrum/dev/svn-trunk/subversion/libsvn_subr/dirent_uri.c:191:5791:beg:0x14965a
> > (gdb)
> > No source file named address.
> > (gdb) backtrace
> > #0 0x0014965a in canonicalize (type=type_uri, path=0x69737265 <Address
> > 0x69737265 out of bounds>, pool=0x10b6818) at
> > subversion/libsvn_subr/dirent_uri.c:191
> > #1 0x0014acaa in svn_uri_canonicalize (uri=0x69737265 <Address 0x69737265 out
> > of bounds>, pool=0x10b6818) at subversion/libsvn_subr/dirent_uri.c:1108
> > #2 0x0014950c in local_style (type=type_uri, path=0x69737265 <Address
> > 0x69737265 out of bounds>, pool=0x10b6818) at subversion/libsvn_subr/dirent_uri.c:92
> > #3 0x00149e0b in svn_uri_local_style (uri=0x69737265 <Address 0x69737265 out of
> > bounds>, pool=0x10b6818) at subversion/libsvn_subr/dirent_uri.c:630
> > #4 0x0015a1f7 in svn_path_local_style (path=0x69737265 <Address 0x69737265 out
> > of bounds>, pool=0x10b6818) at subversion/libsvn_subr/path.c:61
> > #5 0x0000fc78 in notify (baton=0x744a78, n=0x10cab18, pool=0x10b6818) at
> > subversion/svn/notify.c:143
> > #6 0x0008c373 in close_file (file_baton=0x10b6890, expected_hex_digest=0x9a7188
> > "1f55d0a0cfe2a7d443dd0eb08ad26229", pool=0x10b6818) at
> > subversion/libsvn_wc/update_editor.c:4093
> > #7 0x0005d5a3 in close_file (file_baton=0x10b6860, text_checksum=0x9a7188
> > "1f55d0a0cfe2a7d443dd0eb08ad26229", pool=0x10b6818) at
> > subversion/libsvn_wc/ambient_depth_filter_editor.c:450
> > #8 0x0013abc4 in close_file (file_baton=0x10b6858, text_checksum=0x9a7188
> > "1f55d0a0cfe2a7d443dd0eb08ad26229", pool=0x10b6818) at
> > subversion/libsvn_delta/cancel.c:229
> > #9 0x0010ca5f in end_element (userdata=0x105cf88, state=240, nspace=0x8102f0
> > "svn:", elt_name=0x8135b0 "open-file") at subversion/libsvn_ra_neon/fetch.c:2070
> > #10 0x0011d227 in wrapper_endelm_cb (baton=0x1071ad8, state=240, nspace=0x8102f0
> > "svn:", name=0x8135b0 "open-file") at subversion/libsvn_ra_neon/util.c:1067
> > #11 0x00400b27 in end_element ()
> > #12 0x005dbb1d in doContent ()
> > #13 0x005dc9de in contentProcessor ()
> > #14 0x005da631 in doProlog ()
> > #15 0x005db3b5 in prologProcessor ()
> > #16 0x005d3a16 in XML_ParseBuffer ()
> > #17 0x0040121c in ne_xml_parse ()
> > #18 0x0011d50d in cancellation_callback (userdata=0x1022720, block=0x108ea08
> > "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<S:update-report xmlns:S=\"svn:\"
> > xmlns:V=\"http://subversion.tigris.org/xmlns/dav/\" xmlns:D=\"DAV:\"
> > send-all=\"true\">\n<S:target-revision rev=\"35365\"/>\n<S:open-direct"...,
> > len=8192) at subversion/libsvn_ra_neon/util.c:1148
> > #19 0x003ff900 in do_inflate ()
> > #20 0x003f3501 in ne_read_response_block ()
> > #21 0x003f39c4 in ne_discard_response ()
> > #22 0x003f4b2b in ne_request_dispatch ()
> > #23 0x0011dd99 in svn_ra_neon__request_dispatch (code_p=0x0, req=0x1071a58,
> > extra_headers=0x10225a0, body=0x0, okay_1=200, okay_2=0, pool=0x101f418) at
> > subversion/libsvn_ra_neon/util.c:1449
> > #24 0x0011d724 in parsed_request (req=0x1071a58, ras=0x7e7800, method=0x18f5ec
> > "REPORT", url=0x7e7c10 "/repos/svn/!svn/vcc/default", body=0x0,
> > body_file=0x105d648, set_parser=0, startelm_cb=0x10a513 <start_element>,
> > cdata_cb=0x10c3ef <cdata_handler>, endelm_cb=0x10c534 <end_element>,
> > baton=0x105cf88, extra_headers=0x10225a0, status_code=0x0, spool_response=0,
> > pool=0x101f418) at subversion/libsvn_ra_neon/util.c:1228
> > #25 0x0011d95c in svn_ra_neon__parsed_request (sess=0x7e7800, method=0x18f5ec
> > "REPORT", url=0x7e7c10 "/repos/svn/!svn/vcc/default", body=0x0,
> > body_file=0x105d648, set_parser=0, startelm_cb=0x10a513 <start_element>,
> > cdata_cb=0x10c3ef <cdata_handler>, endelm_cb=0x10c534 <end_element>,
> > baton=0x105cf88, extra_headers=0x10225a0, status_code=0x0, spool_response=0,
> > pool=0x101f418) at subversion/libsvn_ra_neon/util.c:1291
> > #26 0x0010d7cc in reporter_finish_report (report_baton=0x105cf88,
> > pool=0x101f418) at subversion/libsvn_ra_neon/fetch.c:2388
> > #27 0x000541a0 in svn_wc_crawl_revisions4 (path=0x744a70 "",
> > adm_access=0x101f5a8, reporter=0x1a27f0, report_baton=0x105cf88,
> > restore_files=1, depth=svn_depth_unknown, honor_depth_exclude=1,
> > depth_compatibility_trick=0, use_commit_times=0, notify_func=0xfbc5 <notify>,
> > notify_baton=0x744a78, traversal_info=0x101f458, pool=0x101f418) at
> > subversion/libsvn_wc/adm_crawler.c:711
> > #28 0x00051938 in svn_client__update_internal (result_rev=0xbffff488,
> > path=0x744a70 "", revision=0xbffff65c, depth=svn_depth_unknown,
> > depth_is_sticky=0, ignore_externals=0, allow_unver_obstructions=0,
> > timestamp_sleep=0xbffff48c, send_copyfrom_args=1, ctx=0x1011a38, pool=0x101f418)
> > at subversion/libsvn_client/update.c:254
> > #29 0x00051bce in svn_client_update3 (result_revs=0x0, paths=0x744a40,
> > revision=0xbffff65c, depth=svn_depth_unknown, depth_is_sticky=0,
> > ignore_externals=0, allow_unver_obstructions=0, ctx=0x1011a38, pool=0x1011418)
> > at subversion/libsvn_client/update.c:337
> > #30 0x000172aa in svn_cl__update (os=0x10115c0, baton=0xbffff648,
> > pool=0x1011418) at subversion/svn/update-cmd.c:84
> > #31 0x0000e47f in main (argc=2, argv=0xbffff814) at subversion/svn/main.c:2122
> > (gdb)
> >
> > ------------------------------------------------------
> > http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1041272
> >
>
> ------------------------------------------------------
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1041277
Re: segfault in 'svn up' on trunk
Posted by Greg Stein <gs...@gmail.com>.
0x69737265 looks like ascii characters: i s r e
Somehow the path pointer is getting munged by some text?
On Wed, Jan 21, 2009 at 15:59, Hyrum K. Wright
<hy...@mail.utexas.edu> wrote:
> I updated my trunk client this morning to the latest HEAD (r35365) and then
> tried to use that version to update another working copy. The following is the
> result:
>
> (gdb) r up
> Reading symbols for shared libraries .. done
> D build/transform-sql.py
> A build/transform_sql.py
>
> Program received signal EXC_BAD_ACCESS, Could not access memory.
> Reason: KERN_INVALID_ADDRESS at address: 0x69737265
> 0x0014965a in canonicalize (type=type_uri, path=0x69737265 <Address 0x69737265
> out of bounds>, pool=0x10b6818) at subversion/libsvn_subr/dirent_uri.c:191
> /Users/Hyrum/dev/svn-trunk/subversion/libsvn_subr/dirent_uri.c:191:5791:beg:0x14965a
> (gdb)
> No source file named address.
> (gdb) backtrace
> #0 0x0014965a in canonicalize (type=type_uri, path=0x69737265 <Address
> 0x69737265 out of bounds>, pool=0x10b6818) at
> subversion/libsvn_subr/dirent_uri.c:191
> #1 0x0014acaa in svn_uri_canonicalize (uri=0x69737265 <Address 0x69737265 out
> of bounds>, pool=0x10b6818) at subversion/libsvn_subr/dirent_uri.c:1108
> #2 0x0014950c in local_style (type=type_uri, path=0x69737265 <Address
> 0x69737265 out of bounds>, pool=0x10b6818) at subversion/libsvn_subr/dirent_uri.c:92
> #3 0x00149e0b in svn_uri_local_style (uri=0x69737265 <Address 0x69737265 out of
> bounds>, pool=0x10b6818) at subversion/libsvn_subr/dirent_uri.c:630
> #4 0x0015a1f7 in svn_path_local_style (path=0x69737265 <Address 0x69737265 out
> of bounds>, pool=0x10b6818) at subversion/libsvn_subr/path.c:61
> #5 0x0000fc78 in notify (baton=0x744a78, n=0x10cab18, pool=0x10b6818) at
> subversion/svn/notify.c:143
> #6 0x0008c373 in close_file (file_baton=0x10b6890, expected_hex_digest=0x9a7188
> "1f55d0a0cfe2a7d443dd0eb08ad26229", pool=0x10b6818) at
> subversion/libsvn_wc/update_editor.c:4093
> #7 0x0005d5a3 in close_file (file_baton=0x10b6860, text_checksum=0x9a7188
> "1f55d0a0cfe2a7d443dd0eb08ad26229", pool=0x10b6818) at
> subversion/libsvn_wc/ambient_depth_filter_editor.c:450
> #8 0x0013abc4 in close_file (file_baton=0x10b6858, text_checksum=0x9a7188
> "1f55d0a0cfe2a7d443dd0eb08ad26229", pool=0x10b6818) at
> subversion/libsvn_delta/cancel.c:229
> #9 0x0010ca5f in end_element (userdata=0x105cf88, state=240, nspace=0x8102f0
> "svn:", elt_name=0x8135b0 "open-file") at subversion/libsvn_ra_neon/fetch.c:2070
> #10 0x0011d227 in wrapper_endelm_cb (baton=0x1071ad8, state=240, nspace=0x8102f0
> "svn:", name=0x8135b0 "open-file") at subversion/libsvn_ra_neon/util.c:1067
> #11 0x00400b27 in end_element ()
> #12 0x005dbb1d in doContent ()
> #13 0x005dc9de in contentProcessor ()
> #14 0x005da631 in doProlog ()
> #15 0x005db3b5 in prologProcessor ()
> #16 0x005d3a16 in XML_ParseBuffer ()
> #17 0x0040121c in ne_xml_parse ()
> #18 0x0011d50d in cancellation_callback (userdata=0x1022720, block=0x108ea08
> "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<S:update-report xmlns:S=\"svn:\"
> xmlns:V=\"http://subversion.tigris.org/xmlns/dav/\" xmlns:D=\"DAV:\"
> send-all=\"true\">\n<S:target-revision rev=\"35365\"/>\n<S:open-direct"...,
> len=8192) at subversion/libsvn_ra_neon/util.c:1148
> #19 0x003ff900 in do_inflate ()
> #20 0x003f3501 in ne_read_response_block ()
> #21 0x003f39c4 in ne_discard_response ()
> #22 0x003f4b2b in ne_request_dispatch ()
> #23 0x0011dd99 in svn_ra_neon__request_dispatch (code_p=0x0, req=0x1071a58,
> extra_headers=0x10225a0, body=0x0, okay_1=200, okay_2=0, pool=0x101f418) at
> subversion/libsvn_ra_neon/util.c:1449
> #24 0x0011d724 in parsed_request (req=0x1071a58, ras=0x7e7800, method=0x18f5ec
> "REPORT", url=0x7e7c10 "/repos/svn/!svn/vcc/default", body=0x0,
> body_file=0x105d648, set_parser=0, startelm_cb=0x10a513 <start_element>,
> cdata_cb=0x10c3ef <cdata_handler>, endelm_cb=0x10c534 <end_element>,
> baton=0x105cf88, extra_headers=0x10225a0, status_code=0x0, spool_response=0,
> pool=0x101f418) at subversion/libsvn_ra_neon/util.c:1228
> #25 0x0011d95c in svn_ra_neon__parsed_request (sess=0x7e7800, method=0x18f5ec
> "REPORT", url=0x7e7c10 "/repos/svn/!svn/vcc/default", body=0x0,
> body_file=0x105d648, set_parser=0, startelm_cb=0x10a513 <start_element>,
> cdata_cb=0x10c3ef <cdata_handler>, endelm_cb=0x10c534 <end_element>,
> baton=0x105cf88, extra_headers=0x10225a0, status_code=0x0, spool_response=0,
> pool=0x101f418) at subversion/libsvn_ra_neon/util.c:1291
> #26 0x0010d7cc in reporter_finish_report (report_baton=0x105cf88,
> pool=0x101f418) at subversion/libsvn_ra_neon/fetch.c:2388
> #27 0x000541a0 in svn_wc_crawl_revisions4 (path=0x744a70 "",
> adm_access=0x101f5a8, reporter=0x1a27f0, report_baton=0x105cf88,
> restore_files=1, depth=svn_depth_unknown, honor_depth_exclude=1,
> depth_compatibility_trick=0, use_commit_times=0, notify_func=0xfbc5 <notify>,
> notify_baton=0x744a78, traversal_info=0x101f458, pool=0x101f418) at
> subversion/libsvn_wc/adm_crawler.c:711
> #28 0x00051938 in svn_client__update_internal (result_rev=0xbffff488,
> path=0x744a70 "", revision=0xbffff65c, depth=svn_depth_unknown,
> depth_is_sticky=0, ignore_externals=0, allow_unver_obstructions=0,
> timestamp_sleep=0xbffff48c, send_copyfrom_args=1, ctx=0x1011a38, pool=0x101f418)
> at subversion/libsvn_client/update.c:254
> #29 0x00051bce in svn_client_update3 (result_revs=0x0, paths=0x744a40,
> revision=0xbffff65c, depth=svn_depth_unknown, depth_is_sticky=0,
> ignore_externals=0, allow_unver_obstructions=0, ctx=0x1011a38, pool=0x1011418)
> at subversion/libsvn_client/update.c:337
> #30 0x000172aa in svn_cl__update (os=0x10115c0, baton=0xbffff648,
> pool=0x1011418) at subversion/svn/update-cmd.c:84
> #31 0x0000e47f in main (argc=2, argv=0xbffff814) at subversion/svn/main.c:2122
> (gdb)
>
> ------------------------------------------------------
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1041272
>
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1041277