Open JeffIrwin opened 1 month ago
As of the introduction of structs in https://github.com/JeffIrwin/syntran/commit/b5603a3782253f058d28fcd041c126e0dcad4795, the frequency of this issue seems to be significantly reduced, but still not 100% fixed
Re-running fpm test test
1000 times in https://github.com/JeffIrwin/syntran/commit/42a08512d3915c28520fb5a9402b9c18998bf503, I see about 40 crashes. Given that the whole test suite executed by fpm test test
contains 1404 unit tests as of that commit, that's a failure rate of 40 / (1000 1404) ~= 3e-5 = 0.003% per syntran_eval()
call. Crash frequency is roughly the same in debug and release. That's not terrible, but I still wouldn't use Windows syntran in a car or a hospital
I think it improved because of the addition of the fn_t
copy constructor fn_copy
. Perhaps other types need manually defined copy constructors for the complete resolution of this bug
* when you run a whole syntran script with a command-line like syntran.exe file.syntran
, that's a single syntran_eval()
call, regardless of the size or complexity of the script file
When running syntran on Windows, it will crash rarely and intermittently, maybe 10% of the time or less, with a segfault and
invalid memory reference
shown below.Re-running the same syntran file will usually succeed. The bug is not consistent.
For example, running the 2023 aoc suite with the 0.0.49 release will crash sometimes. It's strange that the main function finishes and syntran prints the final return value before crashing. Maybe the crash occurs during a final deallocation. You can tell from the
run.sh
script output that it does not enter the next directory before the crash.I see similar failures when building from source on Windows, e.g.
fpm test test
. Even under the (default) debug profile, I can't get a meaningful stack trace.Workaround
Run a Linux binary inside of WSL instead of the native Windows executable. Only Windows is affected. Linux has proved extremely reliable, at least with the supported compilers (gfortran 10 through 12).
Log