Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sysutils/mstflint: infinite loop for an underaligned store #102

Open
kwitaszczyk opened this issue Sep 10, 2023 · 0 comments
Open

sysutils/mstflint: infinite loop for an underaligned store #102

kwitaszczyk opened this issue Sep 10, 2023 · 0 comments

Comments

@kwitaszczyk
Copy link
Member

kwitaszczyk commented Sep 10, 2023

Clang from LLVM for Morello compiling sysutils/mstflint ends up in an infinite loop printing a warning for a potentian underaligned store.

Clang command:

clang++ -target aarch64-unknown-freebsd14.0 -march=morello -mabi=purecap -Xclang -morello-vararg=new -Xclang -morello-bounded-memargs=caller-only -DHAVE_CONFIG_H -I. -I../.. -W -Werror -g -MP -MD -fPIC -Wno-missing-field-initializers -Wno-unused-parameter -isystem /usr/local/include -O2 -pipe -march=morello -Xclang -morello-vararg=new -mabi=purecap -D__LP64__=1 -isystem /usr/local/include -fno-strict-aliasing -isystem /usr/local/include -std=c++14 -isystem /usr/local/include -DHAVE_TERMIOS_H -DNO_INBAND -DMST_UL -MT json_reader.lo -MD -MP -MF .deps/json_reader.Tpo -c json_reader.cpp -fPIC -DPIC -o .libs/json_reader.o

Warning printed in the loop:

json_reader.cpp:304:14: note: use __builtin_assume_aligned() or cast to (u)intptr_t* if you know that the pointer is actually aligned to capability size; this will allow the memcpy() or memmove() call to be inlined if the size is constant (otherwise a library call must be used to maintain tag bits). For more information see https://github.com/CTSRD-CHERI/llvm-project/wiki/Unaligned-capability-copies
json_reader.cpp:304:14: warning: found underaligned store of underaligned load of capability type (aligned to 8 bytes instead of 16). Will use memmove() to preserve tags if it is aligned correctly at runtime [-Wcheri-inefficient]
  token.end_ = current_;
             ^

After 37h trying to build sysutils/mstflint, Poudriere created 168 GB of logs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant