You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Andrew Stitcher (Jira)" <ji...@apache.org> on 2021/04/09 21:38:00 UTC

[jira] [Comment Edited] (PROTON-2372) [macOS] python/ruby tests don't work with ASAN build

    [ https://issues.apache.org/jira/browse/PROTON-2372?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17318338#comment-17318338 ] 

Andrew Stitcher edited comment on PROTON-2372 at 4/9/21, 9:37 PM:
------------------------------------------------------------------

There are actually 2 different approaches to figuring out the location of the asan library:
use {{otool}}. The command would be something like:

{{otool -L c/libqpid-proton.dylib}}

Unfortunately this doesn't give the location of the library suitable to use directly in {{DYLD_INSERT_LIBRARIES}} it gives something like:

{{@rpath/libclang_rt.asan_osx_dynamic.dylib (compatibility version 0.0.0, current version 0.0.0)}}

Alternatively you can run an executable linked in the ASAN build with {{DYLD_PRINT_LBRARIES=1}} like:
{{DYLD_PRINT_LIBRARIES=1 c/examples/broker}}
but this actually runs the executable as well as printing out a list like this to stderr:
{noformat}
...
dyld: loaded: <FC3445A7-AAC5-3166-BFF9-C264F68D5517> /Library/Developer/CommandLineTools/usr/lib/clang/12.0.0/lib/darwin/libclang_rt.asan_osx_dynamic.dylib
...
{noformat}
Which is much better (as it gives the actual library location to use, but requires an executable to run (a library won't work). So we'd have to have an executable that exits immediately.



was (Author: astitcher):
There are actually 2 different approaches to figuring out the location of the asan library:
use {{otool}}
The command would be something like:
{{otool -L c/libqpid-proton.dylib}}
Unfortunately this doesn't give the location of the library suitable to use directly in {{DYLD_INSERT_LIBRARIES}} it gives something like {{@rpath/libclang_rt.asan_osx_dynamic.dylib (compatibility version 0.0.0, current version 0.0.0)}}
Alternatively you can run an executable linked in the ASAN build with {{DYLD_PRINT_LBRARIES=1}} like:
{{DYLD_PRINT_LIBRARIES=1 c/examples/broker}}
but this actually runs the executable as well as printing out a list like this to stderr:
{noformat}
...
dyld: loaded: <FC3445A7-AAC5-3166-BFF9-C264F68D5517> /Library/Developer/CommandLineTools/usr/lib/clang/12.0.0/lib/darwin/libclang_rt.asan_osx_dynamic.dylib
...
{noformat}
Which better (as it gives the actual library location to use, but requires an executable to run (a library won't work). So we'd have to have an executable that exits immediately.


> [macOS] python/ruby tests don't work with ASAN build
> ----------------------------------------------------
>
>                 Key: PROTON-2372
>                 URL: https://issues.apache.org/jira/browse/PROTON-2372
>             Project: Qpid Proton
>          Issue Type: Bug
>          Components: proton-c
>    Affects Versions: proton-c-0.34.0
>         Environment: macOSX 10.15, AppleClang 12
>            Reporter: Andrew Stitcher
>            Priority: Major
>
> Running python-test under ASAN requires preloading the asan dynamic library into the python process before any other library. Under Linux this is achieved with a combination of ldd (to figure out if the asan library is being used and LD_PRELOAD to tell ld.so to preload the asan library found with ldd before anything else.
> MacOS has no {{ldd}} tool - it does have a similar tool - {{otool}} and the dynamic loader ({{dyld}}) doesn't use the LD_PRELOAD variable either. It uses {{DYLD_INSERT_LIBRARIES}}.
> So changes will need to made to the {{tests/preload_asan.sh}} script to take account of these differences to run all the tests under ASAN.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org