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

ICE in Z3Interface::fromZ3Expr() when running tests on Arch Linux #15196

Open
MariusVanDerWijden opened this issue Jun 12, 2024 · 8 comments
Open
Labels
bug 🐛 high impact Changes are very prominent and affect users or the project in a major way. low effort There is not much implementation work to be done. The task is very easy or tiny. must have Something we consider an essential part of Solidity 1.0. smt

Comments

@MariusVanDerWijden
Copy link
Member

Trying to compile solidity from source I run into this:

******************************************/solidity/test/soltest.cpp(120): error: in "smtCheckerTests/try_catch/try_5": Exception during extracted test: /solidity/libsmtutil/Z3Interface.cpp(398): Throw in function solidity::smtutil::Expression solidity::smtutil::Z3Interface::fromZ3Expr(const z3::expr&)
Dynamic exception type: boost::wrapexcept<solidity::smtutil::SMTLogicError>
std::exception::what: SMT assertion failed
[solidity::util::tag_comment*] = SMT assertion failed

I think I'm building solidity_0.8.26

Steps to repro:

yay -S solidity
@Renato03110
Copy link

Try Disabling the SMT Checker: As mentioned in my previous response, you can try compiling Solidity with the SMT checker disabled by using the --no-auto-solve or --no-smt compiler options. This may allow the compilation to succeed, but you'll lose the benefits of the formal verification provided by the SMT checker.

@MariusVanDerWijden
Copy link
Member Author

This is compilation straight from the arch user repositories https://aur.archlinux.org/packages/solidity
I think @Spixmaster maintains it, maybe he could disable the SMT checker on the package

@Spixmaster
Copy link

I will take a look at it.

@cameel
Copy link
Member

cameel commented Jun 14, 2024

This is definitely a bug that we should fix. These assertions do not fail in our CI so I suspect this has something to do with the difference in Z3 versions. We're still running our tests on 4.12 and it's possible that 4.13 has introduced something new that the current code assumes won't happen.

@blishko @pgebal maybe you could take a look? We should also finally update to 4.13 (#15198).

@Spixmaster Yeah, if this is failing then disabling the SMT checker is probably the best course of action until we release 0.8.27 with a fix. Another workaround might be to use older Z3 (if that's indeed the issue), but that does not seem to be possible on Arch Linux since it ships the latest one.

@cameel cameel added low effort There is not much implementation work to be done. The task is very easy or tiny. high impact Changes are very prominent and affect users or the project in a major way. must have Something we consider an essential part of Solidity 1.0. smt labels Jun 14, 2024
@cameel cameel changed the title Failing test during compilation ICE in Z3Interface::fromZ3Expr() when running tests on Arch Linux Jun 14, 2024
@Spixmaster
Copy link

I am done with my testing. I did not experience the issues before because I did not have z3 or cvc4 installed. With it, the compilation succeeds but the tests did not finish. After 90 minutes instead of the normal 70 minutes I stopped. The progress bar was stuck somewhat over 80% at the same spot for like 30 minutes.

I am not sure whether this is an issue or expected behaviour and the process would have finished.

@cameel
Copy link
Member

cameel commented Jun 14, 2024

It's likely they'd finish if you gave them more time. IIRC the last time I checked (which was quite a while ago) they were taking ~30% of the time needed to run the whole suite. And the suite is quite extensive so it takes a lot of time to run it all. In CI we heavily rely on parallelization to make that manageable.

@blishko
Copy link
Contributor

blishko commented Jun 15, 2024

I will start investigating on Monday.
I remember that some time ago I tried using Z3 4.13 and ran into an issue with SMTChecker tests. It seemed like Z3 ignored our resource limit and continued running for a long time on one test.

@Spixmaster
Copy link

That would conform to my observation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 high impact Changes are very prominent and affect users or the project in a major way. low effort There is not much implementation work to be done. The task is very easy or tiny. must have Something we consider an essential part of Solidity 1.0. smt
Projects
None yet
Development

No branches or pull requests

5 participants