Closed kondziu closed 4 years ago
Further investigation shows that I can (always?) get the same thing to happen if I execute this:
library(ufovectors)
setwd("~/Workspace/ufo_workspace/UFOs/ufovectors/benchmark")
ufo_set_debug_mode(T)
m <- ufo_integer_bin("32Mints.bin")
rm(m) ## removes the reference
gc() ## runs the garbage collector
ufo_integer_bin("32Mints.bin") ## explodes
info about l
from the moment of crash:
(gdb) p $2->allocatedSlots
$5 = 8
(gdb) p $2->size
$6 = 1
(gdb) p $2->usedSlots
$7 = 4
(gdb) p $2->modCt
$8 = 11
(gdb) p $2->list
$9 = (entryI *) 0x55555742bdf0
(gdb) p $2->list->length
$10 = 128004096
(gdb) p $2->list->occupied
$11 = 1
(gdb) p $2->list->ptr
$12 = (void *) 0x7fffe83ed000
(gdb) p $2->list->ptrI
$13 = 140737089818624
(gdb) p $2->list->valuePtr
$14 = (void *) 0x555556404ed0
I ran it again and collected information relevant to the assert:
actualIdx = 0
l->usedSlots = 9
l->list[actualIdx+1].ptrI = 140736122564608
e = 140737087692800
eCompare == -1 = 1
eCompare == 1 = 0
It looks like whenever it explodes, before it explodes, when the gc is destroying the UFO, the UFO has the wrong file path:
__destroy
source file: expand.dots
vector type: 13
vector size: 32000000
element size: 4
it should be this:
source file: 32Mints.bin
vector type: 13
vector size: 32000000
element size: 4
This might mean that the error lies somewhere outside of sparseList
, and rather is something related to a criminal use of strings on my part.
I fixed the path problem, but sparseList
still explodes.
After https://github.com/PRL-PRG/UFOs/pull/13 same scenario explodes as follows:
R: sparseList.c:346: listAdd: Assertion `1 == eCompare(l->list[actualIdx+1].occupied, l->list[actualIdx+1].ptrI, e)' failed.
I ran the following code:
This caused the following explosion: