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

Undefined behaviour #1104

Open
armintoepfer opened this issue Aug 14, 2023 · 3 comments
Open

Undefined behaviour #1104

armintoepfer opened this issue Aug 14, 2023 · 3 comments

Comments

@armintoepfer
Copy link
Contributor

Using mm2 v2.26 in pbmm2, I fail at

lchain.c:228:1: runtime error: index -1 out of bounds for type 'const lc_elem_t *[64]' (aka 'const struct lc_elem_s *[64]')

How to reproduce

git clone https://github.com/PacificBiosciences/pbmm2 pbmm2
cd pbmm2
mkdir build
cd build
meson setup --buildtype=debugoptimized -Db_sanitize=address,undefined -Db_lundef=false
ninja
ninja test
@armintoepfer
Copy link
Contributor Author

If I unfold the macros, I get to this line, but not sure if it's the correct line:

minimap2/krmq.h

Line 354 in ace990c

itr->top = itr->stack - 1; \

@lh3
Copy link
Owner

lh3 commented Aug 14, 2023

See also #1029. I believe this is a false positive of ubsan because itr->stack-1 is never accessed. Nonetheless, I can reopen and merge #1029 just to make ubsan happy.

@armintoepfer
Copy link
Contributor Author

I would appreciate if the code passes sanitizers. Thank you

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

2 participants