Loading gantry without a personality modparam and adding its function to a thread segfaults rtapi_app.
Reproduced on current master (uspace sim, RIP build):
loadrt threads name1=t period1=1000000 fp1=0
loadrt gantry
addf gantry.0.read t
start
rtapi_app dies as soon as the thread runs.
What I think happens: personality defaults to 0, so no joint pins are created, but FUNCTION(read) unconditionally accesses joint_home(0) (and again limit=joint_home(0)) before the while (i < personality) loop. With zero pins that reference is invalid.
Documented usage always passes personality=N, which works fine, so this only bites on a bare loadrt. Might be worth either erroring out at load when personality == 0, or guarding the first-joint access.
Loading gantry without a personality modparam and adding its function to a thread segfaults rtapi_app.
Reproduced on current master (uspace sim, RIP build):
rtapi_app dies as soon as the thread runs.
What I think happens: personality defaults to 0, so no joint pins are created, but FUNCTION(read) unconditionally accesses joint_home(0) (and again limit=joint_home(0)) before the
while (i < personality)loop. With zero pins that reference is invalid.Documented usage always passes personality=N, which works fine, so this only bites on a bare loadrt. Might be worth either erroring out at load when personality == 0, or guarding the first-joint access.