Test case:
int score_image(string image, int r, int g, int b) {return 42;}
array(int) getpixel() {return ({1, 2, 3});}
int main(int argc, array(string) argv)
{
if (argc < 2) exit(0, "All good! Try again with -DBOOM for a segfault.\n");
array images = ({"foo", "bar", "quux"});
for (int x = 0; x < 10; ++x) //Without the loop, no boom
{
#ifdef BOOM
array pixel = getpixel();
array(int) scores = score_image(images[*], @pixel); //Segfault
#else
[int r, int g, int b] = getpixel();
array(int) scores = score_image(images[*], r, g, b); //But
avoiding @ works.
#endif
}
}
It's fine with either [*] or @pixel, and it's even fine with both, as
long as it's not in a loop. But put all three together, and the
interpreter segfaults before executing a single line of actual code,
which I suspect means an issue at the compilation stage. (Can be
triggered identically by casting "boom.pike" to program too.)
Tested with the latest master branch, and with 8.0.735.
No idea where to start looking for the cause, but it's a completely
consistent crash.
ChrisA