Skip to content

build: support ASAN on fedora37/36 - #50320

Closed
yuvalif wants to merge 1 commit into
ceph:mainfrom
yuvalif:wip-yuval-fedora37-libasan
Closed

yuvalif wants to merge 1 commit into
ceph:mainfrom
yuvalif:wip-yuval-fedora37-libasan

Conversation

@yuvalif

@yuvalif yuvalif commented Mar 1, 2023

Copy link
Copy Markdown
Contributor

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox
  • jenkins test windows

@yuvalif
yuvalif requested a review from mkogan1 March 1, 2023 09:55
# ASAN_LIBRARY will be read by ceph.in to preload the asan library
find_library(ASAN_LIBRARY
NAMES
libasan.so.8

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if there is a better way to do this though. This started with 3, 4 and 5, then 6 was added for GCC 11 and now 8 is being added for GCC 12...

It looks like the original motivation was to prefer the latest "known" version in cases where libasan.so is older (such as when a new compiler is installed on an old LTS distro)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is this repo: https://github.com/arsenm/sanitizers-cmake
but could not see how they find the correct libasan.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it happens here: https://github.com/arsenm/sanitizers-cmake/blob/master/cmake/asan-wrapper. Instead of attempting to "find" libasan.so explicitly, they just parse ldd output.

In our case, ASAN_LIBRARY variable is used to preload libasan into ceph tool (a Python program) so it's not directly applicable. But anywhere where ceph tool is present, rados tool (a C++ program) should be present as well, so perhaps we could do what asan-wrapper does on that?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the wrapper is for runtime. i thought that if we don't specify ASAN_LIBRARY we fail at link time?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the wrapper is for runtime. i thought that if we don't specify ASAN_LIBRARY we fail at link time?

i don't think we explicitly link to asan; when i set WITH_ASAN=ON WITH_UBSAN=ON, it adds these flags to both the compiler and linker lines: -fsanitize=address;-fsanitize=undefined;-fno-sanitize=vptr;-fno-omit-frame-pointer

the toolchain seems to be adding that library dependency itself, so ldd does seem like the best way to identify which

In our case, ASAN_LIBRARY variable is used to preload libasan into ceph tool (a Python program) so it's not directly applicable. But anywhere where ceph tool is present, rados tool (a C++ program) should be present as well, so perhaps we could do what asan-wrapper does on that?

maybe we could put that logic in vstart_environment.sh instead? then the python commands wouldn't have to mess with it

@idryomov

idryomov commented Mar 1, 2023

Copy link
Copy Markdown
Contributor

@petrutlucian94 Is this Windows check failure known? It shows up on all recent main PRs:

/home/ubuntu/ceph/build/bin/ceph -c /home/ubuntu/ceph-vstart/ceph.conf -k /home/ubuntu/ceph-vstart/keyring -i /home/ubuntu/ceph-vstart/dev/mds.c/keyring auth add mds.c mon 'allow profile mds' osd 'allow rw tag cephfs *=*' mds allow mgr 'allow profile mds' 
added key for mds.c
/home/ubuntu/ceph/build/bin/ceph-mds -i c -c /home/ubuntu/ceph-vstart/ceph.conf 
starting mds.c at 
/home/ubuntu/ceph/build/bin/ceph -c /home/ubuntu/ceph-vstart/ceph.conf -k /home/ubuntu/ceph-vstart/keyring fs volume ls 
no valid command found; 10 closest matches:
fs authorize <filesystem> <entity> <caps>...
fs dump [<epoch:int>]

@petrutlucian94

petrutlucian94 commented Mar 2, 2023 •

Copy link
Copy Markdown
Contributor

@petrutlucian94 Is this Windows check failure known? It shows up on all recent main PRs:

/home/ubuntu/ceph/build/bin/ceph -c /home/ubuntu/ceph-vstart/ceph.conf -k /home/ubuntu/ceph-vstart/keyring -i /home/ubuntu/ceph-vstart/dev/mds.c/keyring auth add mds.c mon 'allow profile mds' osd 'allow rw tag cephfs *=*' mds allow mgr 'allow profile mds' 
added key for mds.c
/home/ubuntu/ceph/build/bin/ceph-mds -i c -c /home/ubuntu/ceph-vstart/ceph.conf 
starting mds.c at 
/home/ubuntu/ceph/build/bin/ceph -c /home/ubuntu/ceph-vstart/ceph.conf -k /home/ubuntu/ceph-vstart/keyring fs volume ls 
no valid command found; 10 closest matches:
fs authorize <filesystem> <entity> <caps>...
fs dump [<epoch:int>]

Thanks for bringing it up. For some reason ceph fs volume ls is unavailable, trying to figure out why.

@idryomov

idryomov commented Mar 2, 2023

Copy link
Copy Markdown
Contributor

For some reason ceph fs volume ls is unavailable, trying to figure out why.

Because volumes manager module isn't loaded, most likely.

@petrutlucian94

Copy link
Copy Markdown
Contributor

For some reason ceph fs volume ls is unavailable, trying to figure out why.

Because volumes manager module isn't loaded, most likely.

Indeed, there was a missing Python module. I've submitted a patch: ceph/ceph-build#2120

@yuvalif

yuvalif commented Mar 5, 2023

Copy link
Copy Markdown
Contributor Author

closing in favor of: #50385

@yuvalif yuvalif closed this Mar 5, 2023
@cbodley

cbodley commented Mar 5, 2023

Copy link
Copy Markdown
Contributor

@yuvalif sorry i hadn't seen this one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants