You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Ryan McLelland <ry...@gmail.com> on 2007/06/26 21:14:56 UTC

seg fault in svn_client_revprop_set

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);

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

Re: seg fault in svn_client_revprop_set

Posted by Alex Turner <ar...@gmail.com>.
How can I get make install-swig-py to put the libraries in
/usr/lib/python2.3 ?  Currently it's putting them in a very silly location:
/usr/local/lib/svn-python/  I am alreading specifying
--with-python=/usr/bin/python

Alex

Re: seg fault in svn_client_revprop_set

Posted by Ryan McLelland <ry...@gmail.com>.
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 <je...@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 <je...@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
> > >
> >
> >
>
>

Re: seg fault in svn_client_revprop_set

Posted by Jeremy Pereira <je...@jeremyp.net>.
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 <je...@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
> >
>
>

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

Re: seg fault in svn_client_revprop_set

Posted by Ryan McLelland <ry...@gmail.com>.
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*

On 6/27/07, Jeremy Pereira <je...@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
> >
>
>

Re: seg fault in svn_client_revprop_set

Posted by Jeremy Pereira <je...@jeremyp.net>.
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
>

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