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

Assertion failed in src/Input.cpp:304 #57

Closed
Warchant opened this issue Apr 14, 2021 · 8 comments · Fixed by #61
Closed

Assertion failed in src/Input.cpp:304 #57

Warchant opened this issue Apr 14, 2021 · 8 comments · Fixed by #61

Comments

@Warchant
Copy link

final level of parentheses=-1
cpp-dependencies: ../src/Input.cpp:304: void ReadCmakelist(const Configuration&, std::unordered_map<std::__cxx11::basic_string<char>, Component*>&, const boost::filesystem::path&): Assertion `parenLevel == 0 || (printf("final level of parentheses=%d\n", parenLevel), 0)' failed.
Aborted (core dumped)
@dascandy
Copy link
Contributor

Hmm.... if this is on working code that's a bug. Can you try to reduce your CMakeList to find why it thinks the parens are not balanced?

@pmontalb
Copy link

pmontalb commented Sep 8, 2021

I encountered the same issue, I'll try to get a reproduceable example

@codeling
Copy link

codeling commented Oct 28, 2021

Same issue here. Anyone got a clue what the problem might be already?

@dascandy
Copy link
Contributor

dascandy commented Nov 1, 2021

Still no idea what kind of code leads to this assert; have only seen this bug report but no examples yet.

@Warchant
Copy link
Author

Warchant commented Nov 1, 2021

https://github.com/tomtom-international/cpp-dependencies/blob/master/src/Input.cpp#L263-L264
If number of closing parenthesis is bigger than number of opening parenthesis, and file stream is at eof, then parenLevel will be equal to -1.

@RomanValov
Copy link

RomanValov commented Sep 2, 2022

Hi,

I'm experiencing the same issue. I found following subprojects used in my project caused the exception:

https://github.com/webmproject/libwebp / tag v1.2.4 (current HEAD also fails)
https://github.com/gabime/spdlog.git / tag v1.10.0 (current HEAD also fails)

based on grep results CMakeLists.txt of those projects have inconsistent number of opening and closing parens.

@PeterBindels-TomTom
Copy link
Collaborator

Found it. It triggers on

option(
SPDLOG_NO_ATOMIC_LEVELS
"prevent spdlog from using of std::atomic log levels (use only if your code never modifies log levels concurrently"
OFF)

in spdlog. Note the unbalanced parenthesis in the comment. Will fix.

@RomanValov
Copy link

Hi, thank you for spending time fixing this. The fix is actually working for spdlog.
However it won't for libwebp. Please check #63

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

Successfully merging a pull request may close this issue.

6 participants