MAD-X icon indicating copy to clipboard operation
MAD-X copied to clipboard

Possible to cause SEGFAULT in SEQUENCE

Open kyrsjo opened this issue 4 years ago • 3 comments

A student ( @jonashei ) in our general accelerator physics course found a way to crash MAD-X with segfault when defining a SEQUENCE. This is a shortened version of the script:

test1 : SEQUENCE, L=1;
Q1 : MULTIPOLE, at=0;
ENDSEQUENCE;

test2comb : SEQUENCE, L=2;
test1, at=1, from=Q1;
ENDSEQUENCE;

BEAM, PARTICLE=proton, ENERGY=7000;
USE, SEQUENCE=test2comb;

The crash happened on version 5.06.01; the original version of the script crashed MAD-X on both MacOS and Linux, and the shortened version crashed it on Linux (MacOS was not tried).

The expected outcome would be to have an error message when encountering the bad input, and possibly a "clean" crash instead of a segfault.

kyrsjo avatar Feb 24 '21 10:02 kyrsjo