Random segfaults

I’ve started experiencing random segfaults of swi prolog executable while running my project. I don’t do anything fancy and unsafe there like using foreign libraries or messing with memory. Unfortunately, nature of my project implies randomness in program’s state, so I can’t reproduce it reliably. Also it occurs both on my Windows PC and on my Android phone (launching via termux).

Any ideas how to nail down the cause of those fails?

Pity. Should not happen :frowning:

First, try the latest development version, but you probably already did so. Next, ideally provide a program that reproduces the issue that you can share, or, if it concerns proprietary software, contact me offline how to arrange this. Can you remove the randomness, for example by seeding the random generator? Note that reproducibility of the crash on each run is nice, but often not required to figure out what happened.

Next step, if feasible, move to Linux (the Linux Subsystem on Windows will do as well) and configure using -DCMAKE_BUILD_TYPE=Debug. That will probably dump a lot more hopefully useful info on a crash. If performance is not a big issue you can, if the system is compiled for debugging, run swipl -d chk_secure .... This enables a lot of runtime sanity checks, cutting performance a lot.

Thanks.
I’ll try to investigate it and come back if I find anything concrete.
Main problem now is that I can’t reproduce it reliably, it happens like once in ten or twenty launches.