[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: seg fault in svn_client_revprop_set

From: Ryan McLelland <ryan.mclelland_at_gmail.com>
Date: 2007-06-27 16:50:44 CEST

Good point. I was confusing it with svn_revnum_t which I'm also casting and
did check. That cleared it up, thank you.

On 6/27/07, Jeremy Pereira <jeremyp@jeremyp.net> wrote:
>
>
> On 27 Jun 2007, at 14:35, Ryan McLelland wrote:
>
> > I am casting the char* to an svn_string_t*, which shouldnt be a
> > problem I dont think since I believe svn_string_t is just a typedef
> > for char*
>
> You might believe that, but did you actually check?
>
> From svn_string.h:
>
> /** A simple counted string. */
> typedef struct svn_string_t
> {
> const char *data; /**< pointer to the bytestring */
> apr_size_t len; /**< length of bytestring */
> } svn_string_t;
>
>
> >
> >
> > On 6/27/07, Jeremy Pereira <jeremyp@jeremyp.net> wrote:
> > On 26 Jun 2007, at 22:14, Ryan McLelland wrote:
> >
> > > Hi,
> > > I am building an svn client using the c/c++ apis and I am trying to
> > > provide project-based version numbers for the users, (even though
> > > all projects will be in one repository). I'm trying to do it by
> > > setting properties of each projects folder in the repository, i.e.
> > > set property "v1" to "rev1", then when they commit this project the
> > > next time, set property "v2" to "revxx", with xx being whatever
> > > revision the whole repository is at that point. I can then read
> > > the properties and checkout the appropriate revision when they ask
> > > for version x of their project. Anyway, I'm getting a segmentation
> > > fault in the following line of code:
> > >
> > > long rev_set;
> > > err = svn_client_revprop_set("latest_v",(svn_string_t*) ltoa
> > > (current_revision).c_str(),
> > > proj_url.c_str(), &rev,
> > > (svn_revnum_t*) &rev_set, TRUE, ctx, pool);
> >
> > It's a long time since I've done any C++ and maybe the conversion is
> > done automatically, but it looks to me like you are passing a char*
> > as the second parameter and not an svn_string_t*.
> >
> >
> > >
> > >
> > > the current_revision is taken from the commit_info struct of a
> > > commit just before this call, and it is correct. The following is a
> > > stack trace from my debugger:
> > >
> > > _memcpy, FP=fc374cf0
> > > apr_file_write, FP=fc374cf0
> > > apr_file_write_full, FP=fc374d70
> > > svn_io_file_write_full, FP=fc374de0
> > > create_temp_file, FP=fc374e60
> > > ...pos__hooks_pre_revprop_change, FP=fc374f18
> > > svn_repos_fs_change_rev_prop2, FP=fc374fa8
> > > svn_ra_local__change_rev_prop, FP=fc375030
> > > svn_ra_change_rev_prop, FP=fc3750a0
> > > svn_client_revprop_set, FP=fc375130
> > > C++ **My Function**, FP=fc37a428
> > >
> > > any help would be much appreciated.
> > > Thanks,
> > > -Ryan
> > >
> >
> >
>
>
Received on Wed Jun 27 16:51:06 2007

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.