Perplexing spawn arithmetic overflow errors

I’m not sure what isn’t compiling, so let me go into detail.

I have an i7 4C|8T laptop, and I use Linux.
In my /home directory I have the extracted *.tar directories for Crystal versions.

So I have directories like crystal-0.34, crystal-0.36.1, etc. I also have a crystal folder which contains the latest version, currently for 1.0.0. I have a symlink pointed to ~/crystal/bin/crystal, so all I do for a new version is extract it to a folder and rename it to crystal (after renaming the old crystal to its version number, if I want to keep it).

So, for file name twinprimes_ssoz.cr, to compile it with the current version I do:

$ crystal build twinprimes_ssoz.cr -Dpreview_mt --release
I then typically rename the binary to twinprimes_ssoz.xyz to show the version.

So for 0.34, I use the following statement to compile:

$ ~/crystal-0.34/bin/crystal build twinprimes_ssoz.cr -Dpreview_mt --release

To run the binaries I do:

$ CRYSTAL_WORKERS=8 ./twinprimes_ssoz.xyz <input value(s)>

This is my system for using multiple Crystal versions to
compile|run the same program, to compare their differences.

Can you try compiling the github gists that you shared above? I get syntax errors on undefined variables.

Ah, thit :angry:
OK, found the problems. Copied/pasted/ran the actual code from the gists to confirm they now compile and run.
Sorry, my bad. :roll_eyes:

I just discovered this today.

For all versions from 0.34 → 1.0.0, the multi-threaded version works for inputs upto at least 50_000_000_000_000, but hangs and aborts for 100_000_000_000_000. (The single-threaded version continues to operate correctly, but of course, just takes allot more time. I didn’t wait for it to finish for that value.)

1 Like