Mac dynamic library loading and DYLD_LIBRARY_PATH got more confusing

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Mac dynamic library loading and DYLD_LIBRARY_PATH got more confusing

Paul Licameli
I am getting more confused the more I look into library loading on Mac.  Does anyone else here have more expertise?

DYLD_LIBRARY_PATH was involved in the original bug 290 -- so say Leland's comments, and at dba49dd485d718a7ce5e42cf1cf4a7990d2e6a59 I brought back the original fix, which is to make a little file Audacity.sh in the application bundle, and execute that, which changes the variable before it invokes Audacity.

But apparently this is some kind of special, MAGIC variable since El Capitan, and this is related to "SIP" (System Integrity Protection.)  So I learned with a little searching.

Open terminal, and do
DYLD_LIBRARY_PATH='whatever'
export DYLD_LIBRARY_PATH
env | grep DYLD_LIBRARY_PATH

Nothing!  Interactive shell refuses to export that variable.  Likewise I think for other environment variables starting with DYLD_ .  Substitue another variable name like X for DYLD_LIBRARY_PATH and it behaves normally.

And yet Audacity.sh, which does essentially this, has the intended effect, which I know because I modified my Audacity build to display that environment variable in a message box.  So, non-interactive shells behave differently, and do permit this export?

What is going on?

PRL


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/audacity-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Mac dynamic library loading and DYLD_LIBRARY_PATH got more confusing

Paul Licameli
And I ask all of this because I was trying to figure out how to force the symptoms of old bug 290 to happen again, to verify that the "fix" is really doing something useful.  But now this seems very difficult to do, outside of a development environment.

According to the bug discussion, symptoms happened on only some systems, and which Leland thought was fixed by this change of the environment variable.  This was a few years ago.

So perhaps years ago, DYLD_LIBRARY_PATH was somehow set on some systems, (by malicious code?), influencing Audacity's search for LAME and FFmpeg -- only sometimes.

But in recent OS versions, new things make it harder for a similar accident to happen.

But then again, the minimum OS version we say we run on is not so recent.

PRL


On Fri, Jul 28, 2017 at 12:26 PM, Paul Licameli <[hidden email]> wrote:
I am getting more confused the more I look into library loading on Mac.  Does anyone else here have more expertise?

DYLD_LIBRARY_PATH was involved in the original bug 290 -- so say Leland's comments, and at dba49dd485d718a7ce5e42cf1cf4a7990d2e6a59 I brought back the original fix, which is to make a little file Audacity.sh in the application bundle, and execute that, which changes the variable before it invokes Audacity.

But apparently this is some kind of special, MAGIC variable since El Capitan, and this is related to "SIP" (System Integrity Protection.)  So I learned with a little searching.

Open terminal, and do
DYLD_LIBRARY_PATH='whatever'
export DYLD_LIBRARY_PATH
env | grep DYLD_LIBRARY_PATH

Nothing!  Interactive shell refuses to export that variable.  Likewise I think for other environment variables starting with DYLD_ .  Substitue another variable name like X for DYLD_LIBRARY_PATH and it behaves normally.

And yet Audacity.sh, which does essentially this, has the intended effect, which I know because I modified my Audacity build to display that environment variable in a message box.  So, non-interactive shells behave differently, and do permit this export?

What is going on?

PRL



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/audacity-devel
Loading...