Morpho-lang / morpho

The Morpho language 🦋. Morpho is a small embeddable language for scientific computing applications.
MIT License
33 stars 11 forks source link

[Bug] SegFault on gradvector test when run with multithreading #259

Closed joshichaitanya3 closed 5 months ago

joshichaitanya3 commented 5 months ago

Describe the bug The gradvector test fails when run with multi-threading.

To Reproduce

  1. Go to test/functionals/areaintegral
  2. Run morpho6 -w4 gradvector.morpho

Expected behavior Output:

0
[ 1 ]
[ 0 ]
[ 0 ]
[ 2 ]

Actual output:

0
zsh: segmentation fault  morpho6 -w4 gradvector.morpho

This issue also calls for a separate automated test with the run command being morpho6 -w2 or something. Will have to look into its feasibility.

softmattertheory commented 5 months ago

This issue is due to illegal behavior in the test; integrands should not modify state. We will enforce this eventually, for now we've modify the test to remove the possibility of a race condition.

@joshichaitanya3 implemented the new CI test that has caught this and other remaining race conditions in functionals.