Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Alien-SVN CPAN distribution.

Report information
The Basics
Id: 31633
Status: resolved
Priority: 0/
Queue: Alien-SVN

People
Owner: Nobody in particular
Requestors: phil [...] ipom.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Documentation bugs lead to segfault
Date: Mon, 17 Dec 2007 23:43:59 -0800
To: bug-Alien-SVN [...] rt.cpan.org
From: Phil Dibowitz <phil [...] ipom.com>
I have 3 bugs to report on the documentation for SVN::Repos - the first of which leads to a segfault. BUG #1 The SYNOPSIS section for SVN::Delta claims you can pass in "undef" as the 3rd argument to SVN::Repos::dir_delta(). However, this isn't true. The 3rd argument, if 'undef', is then passed as NULL to the SVN API, which then attempts to deref this as a string pointer to concatenate it with arg2, causing a deref of NULL and a segmentation fault. BUG #2 Further, the SYNOPSIS shows 10 arguments passed into dir_delta(), but you MUST pass in 11 or 12: svn_repos.c: if ((items < 11) || (items > 12)) { SWIG_croak("Usage: svn_repos_dir_delta(src_root,src_parent_dir,src_entry,tgt_root,tgt_path,editor,edit_baton,authz_read_func,authz_read_baton,text_deltas,recurse,entry_props,ignore_ancestry,pool);"); } The argument missing isn't the last one, either... a authzcb_baton must be passed in as the 7th argument, after the Editor, but before the flags. Further, the documentation doesn't mention that the authzcb_baton is actually another authzcb that the SVN::Repos callback will call as an additional callback, but this seems to be the case from the code. BUG #3 And finally, the documentation does not close the function leading the reader to wonder if there are other arguments. It should probably look like this: # note, one additional argument may be passed in if you'd like # to specify an APR pool directly. SVN::Repos::dir_delta($root1, $path, '', $root2, $path, SVN::Delta::Editor->new(_debug=>1), undef, 1, 1, 0, 1); I hope that helps. -- Phil Dibowitz phil@ipom.com Open Source software and tech docs Insanity Palace of Metallica http://www.phildev.net/ http://www.ipom.com/ "Never write it in C if you can do it in 'awk'; Never do it in 'awk' if 'sed' can handle it; Never use 'sed' when 'tr' can do the job; Never invoke 'tr' when 'cat' is sufficient; Avoid using 'cat' whenever possible" -- Taylor's Laws of Programming
Download signature.asc
application/pgp-signature 252b

Message body not shown because it is not plain text.

Subject: Re: [rt.cpan.org #31633] Documentation bugs lead to segfault
Date: Tue, 18 Dec 2007 00:11:52 -0800
To: bug-Alien-SVN [...] rt.cpan.org
From: Michael G Schwern <schwern [...] pobox.com>
phil@ipom.com via RT wrote: Show quoted text
> Tue Dec 18 02:44:49 2007: Request 31633 was acted upon. > Transaction: Ticket created by phil@ipom.com > Queue: Alien-SVN > Subject: Documentation bugs lead to segfault > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: phil@ipom.com > Status: new > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=31633 > > > > I have 3 bugs to report on the documentation for SVN::Repos - the first of > which leads to a segfault.
Thank you for your report, but Alien::SVN is merely a repackaging of the Subversion libraries. You should instead make your reports to their author, Chia-liang Kao <clkao@clkao.org>. I'll forward him this report. Show quoted text
> BUG #1 > The SYNOPSIS section for SVN::Delta claims you can pass in "undef" as the > 3rd argument to SVN::Repos::dir_delta(). However, this isn't true. The 3rd > argument, if 'undef', is then passed as NULL to the SVN API, which then > attempts to deref this as a string pointer to concatenate it with arg2, > causing a deref of NULL and a segmentation fault. > > BUG #2 > Further, the SYNOPSIS shows 10 arguments passed into dir_delta(), but you > MUST pass in 11 or 12: > > svn_repos.c: > > if ((items < 11) || (items > 12)) { > SWIG_croak("Usage: > svn_repos_dir_delta(src_root,src_parent_dir,src_entry,tgt_root,tgt_path,editor,edit_baton,authz_read_func,authz_read_baton,text_deltas,recurse,entry_props,ignore_ancestry,pool);"); > } > > The argument missing isn't the last one, either... a authzcb_baton must be > passed in as the 7th argument, after the Editor, but before the flags. > > Further, the documentation doesn't mention that the authzcb_baton is > actually another authzcb that the SVN::Repos callback will call as an > additional callback, but this seems to be the case from the code. > > BUG #3 > And finally, the documentation does not close the function leading the > reader to wonder if there are other arguments. It should probably look like > this: > > # note, one additional argument may be passed in if you'd like > # to specify an APR pool directly. > SVN::Repos::dir_delta($root1, $path, '', > $root2, $path, > SVN::Delta::Editor->new(_debug=>1), > undef, > 1, 1, 0, 1); > > I hope that helps.
-- But there's no sense crying over every mistake. You just keep on trying till you run out of cake. -- Jonathan Coulton, "Still Alive"
Subject: Re: [rt.cpan.org #31633] Documentation bugs lead to segfault
Date: Tue, 18 Dec 2007 00:52:58 -0800
To: bug-Alien-SVN [...] rt.cpan.org
From: Phil Dibowitz <phil [...] ipom.com>
Michael G Schwern via RT wrote: Show quoted text
> Thank you for your report, but Alien::SVN is merely a repackaging of the > Subversion libraries. You should instead make your reports to their author, > Chia-liang Kao <clkao@clkao.org>. I'll forward him this report.
Thanks. I had already forwarded a link to this report to dev@subversion.tigris.org. Let me know if you hear back from Chia-liang Kao. If not, and I don't hear from dev@, then I'll file an Issue in the SVN IssueZilla. -- Phil Dibowitz phil@ipom.com Open Source software and tech docs Insanity Palace of Metallica http://www.phildev.net/ http://www.ipom.com/ "Never write it in C if you can do it in 'awk'; Never do it in 'awk' if 'sed' can handle it; Never use 'sed' when 'tr' can do the job; Never invoke 'tr' when 'cat' is sufficient; Avoid using 'cat' whenever possible" -- Taylor's Laws of Programming
Download signature.asc
application/pgp-signature 252b

Message body not shown because it is not plain text.

clkao's problem.