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

floating point exception (core dumped) error when runing build --zksync #881

Open
2 tasks
sg-milad opened this issue Jan 30, 2025 · 16 comments
Open
2 tasks
Assignees
Labels
bug 🐛 Something isn't working needs triage ♟️ Issue needs to be picked up or assigned

Comments

@sg-milad
Copy link

Component

Foundryup, Forge

Have you ensured that all of these are up to date?

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge 0.0.4 (VERGEN_IDEMPOTENT_OUTPUT 2025-01-23T19:54:33.239256966Z)

What command(s) is the bug in?

forge build --zksync

Operating System

Linux

Describe the bug

when I run this command i get this error:

forge build --zksync
[1]    124800 floating point exception (core dumped)  forge build --zksync

I tried to run foundryup and after that foundryup-zksync again but I still get the same error
this is my repo: https://github.com/sg-milad/Todo-smart-contract-foundry/pull/1
Image

@sg-milad sg-milad added bug 🐛 Something isn't working needs triage ♟️ Issue needs to be picked up or assigned labels Jan 30, 2025
@Jrigada Jrigada self-assigned this Jan 30, 2025
@Jrigada
Copy link
Contributor

Jrigada commented Jan 30, 2025

Hey @sg-milad thanks for raising the issue to us. I tried reproducing your example but I compiled successfully your repository with this version of forge (ae913af) in both mac and linux. Could you check if this is the same version you are running? Also were you able to compile any other project using foundry-zksync?

root@dfcb528ae90b:/Todo-smart-contract-foundry# forge build --zksync
[⠃] Using zksolc-1.5.7
[⠊] Compiling (zksync)
[⠢] Compiling 27 files with zksolc and solc 0.8.28
[⠆] zksolc and solc 0.8.28 finished in 2.26s
Compiler run successful!
root@dfcb528ae90b:/Todo-smart-contract-foundry# forge --version
forge 0.0.4 (ae913af 2025-01-23T19:54:27.514921220Z)

@Jrigada Jrigada moved this from Todo to In Progress in DevEx squad Jan 30, 2025
@sg-milad
Copy link
Author

thank you for responding.
Image

no, I was not able to compile other projects using foundry-zksync because I didn't try.
how to update foreg to the latest version?

@nbaztec
Copy link
Collaborator

nbaztec commented Feb 4, 2025

You can use the foundryup script to update it or download one of the releases from the github page https://github.com/matter-labs/foundry-zksync/releases (latest stable is v0.0.7)

@Jrigada
Copy link
Contributor

Jrigada commented Feb 4, 2025

Another thing to consider could be the solc or zksolc version. Had you previously installed them? If so, try removing them—Foundry should automatically download the correct versions for you.

@Jrigada
Copy link
Contributor

Jrigada commented Feb 17, 2025

Hey! Did you manage to solve the issue or have a little bit more insight about it?

@sg-milad
Copy link
Author

sg-milad commented Feb 17, 2025

Hey! Did you manage to solve the issue or have a little bit more insight about it?

Hi friend
I updated it to the latest version but still got the same error. I tried to compile another project but I got the same error.

Image

@Jrigada
Copy link
Contributor

Jrigada commented Feb 17, 2025

Hey! Do you have a version of solc and zksolc installed? Also I don't have access to the repository anymore. I don't remember what you had in the foundry.toml

@sg-milad
Copy link
Author

sg-milad commented Feb 17, 2025

Hey! Do you have a version of solc and zksolc installed?

I figured out I don't have zksolc installed. i was installing it but I got an error:
command:
-> era-compiler-solidity git:(main) cargo build --release

Image

Also I don't have access to the repository anymore. I don't remember what you had in the foundry.toml

I deleted my repo but it was the default setup when you run forge init

@Jrigada
Copy link
Contributor

Jrigada commented Feb 17, 2025

You could try downloading directly from the zksolc releases here
https://github.com/matter-labs/era-compiler-solidity/releases
and try again with the one that fits your architecture

@Karrq
Copy link
Contributor

Karrq commented Feb 18, 2025

I updated it to the latest version but still got the same error

I couldn't help but notice your --version contains VERGEN_IDEMPOTENT_OUTPUT, but we don't enable this feature for any of our builds, so it must be enabled thru the VERGEN_IDEMPOTENT env, which we don't set in our release CI, could you please share how you obtained the release of foundry-zksync that you are using?


Do you get the same error without --zksync? So forge build only?

foundry-zksync would normally download the correct compilers for you and put them in .zksync in your $HOME, but that wouldn't show up in your $PATH. If your problem persist you might want to clear the contents of the folder and try again.

There's a similar mechanism for solc binaries, but if you can't repro the same error without --zksync then those wouldn't matter here...

@together87
Copy link

Hi, I am getting the same error.
forge build works but forge build --zksync not work.

So I used gdb for debug, gdb --args forge build --zksync.
After that I get these output.

[Detaching after fork from child process 25631]
[New LWP 25663]
[New LWP 25664]
[New LWP 25665]
[New LWP 25666]
[New LWP 25667]
[New LWP 25668]
[New LWP 25669]
warning: File "/usr/lib/x86_64-linux-gnu/libthread_db.so.1" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
To enable execution of this file add
        add-auto-load-safe-path /usr/lib/x86_64-linux-gnu/libthread_db.so.1
line to your configuration file "/home/milos/.config/gdb/gdbinit".
To completely disable this security protection add
        set auto-load safe-path /
line to your configuration file "/home/milos/.config/gdb/gdbinit".
For more information about this security protection see the
"Auto-loading safe path" section in the GDB manual.  E.g., run from the shell:
        info "(gdb)Auto-loading safe path"
warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available.

Thread 8 "tokio-runtime-w" received signal SIGFPE, Arithmetic exception.
[Switching to LWP 25669]
0x00007fffea375bb9 in __nptl_tls_static_size_for_stack () at ../nptl/nptl-stack.h:58
58      ../nptl/nptl-stack.h: No such file or directory.

I see the error is come from tokio.
I am using Ubuntu 22.0.4.

@together87
Copy link

I am getting the same error on anvil-zksync as well.
Floating point exception (core dumped)
I am using latest version.

@sg-milad
Copy link
Author

I updated it to the latest version but still got the same error

I couldn't help but notice your --version contains VERGEN_IDEMPOTENT_OUTPUT, but we don't enable this feature for any of our builds, so it must be enabled thru the VERGEN_IDEMPOTENT env, which we don't set in our release CI, could you please share how you obtained the release of foundry-zksync that you are using?

I don't remember exactly but throw running foundryup-zksync

Do you get the same error without --zksync? So forge build only?

no I don't get any error
my repo: github.com/sg-milad/token-Based-Goal-Tracker
( zkout folder didn't pop up)
Image

@Karrq
Copy link
Contributor

Karrq commented Feb 20, 2025

I am using Ubuntu 22.0.4.

@sg-milad does that apply to you as well?

I'm thinking perhaps it's related to the fact that our releases are made with Ubuntu 24.04 and not 22.04 anymore, weird to see that error only for --zksync tho

@Karrq Karrq self-assigned this Feb 20, 2025
@sg-milad
Copy link
Author

I am using Ubuntu 22.0.4.

@sg-milad does that apply to you as well?

I'm thinking perhaps it's related to the fact that our releases are made with Ubuntu 24.04 and not 22.04 anymore, weird to see that error only for --zksync tho

yes

Image

@dutterbutter
Copy link
Collaborator

@Karrq we may want to consider removing cross and openssl in release workflow. Similar to: matter-labs/anvil-zksync#581

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working needs triage ♟️ Issue needs to be picked up or assigned
Projects
Status: In Progress
Development

No branches or pull requests

6 participants