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

RE: --EXTERNAL--Re: Bug Report Againgst Subversion 1.9.3 libsvn_subr

From: Bailey, Aaron <Aaron.Bailey_at_ga.com>
Date: Thu, 14 Jul 2016 16:56:21 +0000

Hey Stefan,

I think I know what is going on, this is due to my lack of knowledge about the inner workings of Apache. I'm building subversion for an several older versions of Linux. I couldn't update the packages on several of them so I statically linked in all of the dependencies for subversion. So Apache, APR, APR-Util, etc... are still the older system packages while Subversion has statically built in updated versions. This is not normally an issue for developers as they aren't running Subversion servers, let alone through Apache. When upgrading the actual server it was decided not to touch Apache. So if Apache initializes the APR module it would be the one dynamically linked against the system default shared object APR library, which my build of subversion doesn't use. ¯\_(ツ)_/¯

I know this is the subversion and not the APR list, but I feel that the APR library segfaulting if it hasn't been properly initialized is still not great behavior. It may be worth updating the APR module memory/unix/apr_pools.c to have some of the functions check if APR has been initialized and return the appropriate apr_status_t. Any thoughts on if it's worth the time to submit something to their group?

Thank you for taking the time to respond,

Aaron

-----Original Message-----
From: Stefan Sperling [mailto:stsp_at_elego.de]
Sent: Thursday, July 14, 2016 1:07 AM
To: Bailey, Aaron
Cc: users_at_subversion.apache.org
Subject: --EXTERNAL--Re: Bug Report Againgst Subversion 1.9.3 libsvn_subr

On Wed, Jul 13, 2016 at 05:37:36PM +0000, Bailey, Aaron wrote:
> This is an update to the reported issue below.
>
> It appears that calling the pre-processor macro svn_pool_create with an argument of NULL is done a lot in the Subversion code base. The comments in the APR function apr_pool_create_ex in module memory/unix/apr_pools.c seems to imply you shouldn't do this. However, as long as you've made a call to either the APR function apr_pool_initialize in the module memory/unix/apr_pools.c or apr_initialize in one of the OS appropriate APR modules then you're ok as it initializes the global pool which is used when the parent argument is NULL. However, the stack flow listed below from the mod_dav_svn subversion module never makes a call to any of the initialization functions. Ensuring that the APR module has been correctly initialized resolves this issue. That being said the APR code should probably handle being called before initialization gracefully rather than just causing a segmentation fault.
>
> I will note that while I didn't test it, the same issue appears to be present in the Subversion 1.8.16 code base via code inspection. Since Subversion 1.8, and probably 1.9, are widely in use maybe something about how I configure / build the code is causing this issue. That being said, I cannot get the Subversion Apache module to work correctly without first patching the code to explicitly initialize the APR module (and patching APR to check if it's been initialized and return an appropriate apr_status_t for good measure).
>
> Thanks,
>
> Aaron
>

It seems odd that you'd be the only person on the planet running into this.
It's such a fundamental problem. Nothing will work if pools don't work.

Shouldn't Apache HTTPD be intializing the process-global APR state?
Perhaps, somehow, there's a problem with the HTTPD that's loading mod_dav_svn?
Received on 2016-07-14 18:56:33 CEST

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.