vermaseren / form

The FORM project for symbolic manipulation of very big expressions
GNU General Public License v3.0
1.16k stars 138 forks source link

Improve Windows build #511

Open tueda opened 6 months ago

tueda commented 6 months ago

This PR consists of 3 patches to improve the building binaries on Windows:

Though to some extent this is ready for a merge, there are still some remaining issues:

Concerning the 2 test failures, both are caused by segfaults (Sta_Fill_1 leads to a segfault also on Linux). The unexpected failures might be related to the fact that MSYS2 GCC is currently version 13.2.0, the buggy version (MSYS2 has no way to install a specific version like gcc 12).

coveralls commented 6 months ago

Coverage Status

coverage: 50.007% (+0.008%) from 49.999% when pulling c571f7729634a49c6bd962a491035b47b1921242 on tueda:test-check-on-windows into 83e3d4185efca2e5938c665a6df9d67d6d9492ca on vermaseren:master.

tueda commented 5 months ago

Rebased onto master.

The failure of Issue135_3 seems to have resolved itself, likely because of an update of the gcc version in the upstream (MSYS2).

The failure of Sta_Fill_1 may not be the fault of the compiler or Windows. It seems to contain intrinsically undefined behaviour. Actually, Valgrind (on Linux) shows stack overflows:

FORM 5.0.0-beta.1 (May 27 2024, v5.0.0-beta.1-69-gc571f77)  Run: Mon May 27 14:48:08 2024
        Table B(1:1);
        Local dummy = 1;
        .sort

Time =       0.04 sec    Generated terms =          1
           dummy         Terms in output =          1
                         Bytes used      =         20
        Fill B(1) = dummy;
1.frm Line 4 --> Warning: Use of expressions and/or $variables in Fill statemen
ts is potentially very dangerous.
        Drop dummy;
        .sort
        Local F = B(1);
        Print;
        .end
==73714== Stack overflow in thread #1: can't grow stack to 0x1ffe801000
==73714== Stack overflow in thread #1: can't grow stack to 0x1ffe801000
==73714== Can't extend stack to 0x1ffe801078 during signal delivery for thread 1:
==73714==   no stack segment
==73714==
==73714== Process terminating with default action of signal 11 (SIGSEGV)
==73714==  Access not within mapped region at address 0x1FFE801078
==73714== Stack overflow in thread #1: can't grow stack to 0x1ffe801000
==73714==    at 0x1DF3F1: Generator (proces.c:3246)
==73714==  If you believe this happened as a result of a stack
==73714==  overflow in your program's main thread (unlikely but
==73714==  possible), you can try to increase the size of the
==73714==  main thread stack using the --main-stacksize= flag.
==73714==  The main thread stack size used in this run was 8388608.
tueda commented 5 months ago

FYI, here is an experimental branch working with MSVC: https://github.com/tueda/form/tree/ci-msvc

jodavies commented 5 months ago

Sta_Fill_1 results in an infinite loop of DoOnePow, Generator, Generator, Generator. I suppose the table entry references the expression "dummy", but in DoOnePow we are using nexp=0 which at this point refers to F. Hence the loop? FORM at least prints the warning.

So this one is nothing to do with windows, anyway.

coveralls commented 2 weeks ago

Coverage Status

coverage: 50.226% (-0.001%) from 50.227% when pulling fbcf859be988c4f40111618958433da7c09d96af on tueda:test-check-on-windows into 0289435fc48b3ae379c4c1fc8058de7f844dd08a on vermaseren:master.

tueda commented 2 weeks ago

Rebased.

tueda commented 3 days ago

Rebased.