The attached minimal test case consistently causes segfaults in XSB.
Please try running it with the following:
xsb -e "[crashes], assert(bitwidth(tree(0x1000000000000001))), crash, halt."
Changing the first digit of the number above sometimes causes the bug not to trigger. This bug is currently causing us to lose progress in our project, as we have no idea what the underlying problem is, and hence don't know how to work around it. We currently suspect poor interactions with 64-bit integers in some cases.
Backtrace info:
0 0x000000000045540e in emuloop (startaddr=0x1e2bee0 "\254") at emuloop.c:1139
1 0x00000000004881d0 in xsb (flag=1, argc=0, argv=0x0) at emuloop.c:3147
2 0x00000000004120b6 in main (argc=1, argv=0x7ffd1cb86808) at main_xsb.c:87
(gdb) p isref(op1)
$14 = 1
(gdb) p follow(op1)
Cannot access memory at address 0x7fc901003000
I'm taking a look now. Thanks for the detailed report.