envelope-project / laik

Other
9 stars 8 forks source link

Assumed lexicographical ordering of group elements #168

Closed Vinpasso closed 5 years ago

Vinpasso commented 5 years ago

Ran into this while trying to fix the rotation of ids in a group for backup. The following group derived from world will cause the assertion below to fail:

0 1 2 3    World
| | | |
1 2 3 0    Backup

https://github.com/envelope-project/laik/blob/f4806e3acb048fcc997881f655ee7f2e91f76965/src/action.c#L1930

I guess the FIXME a couple lines earlier states the problem: https://github.com/envelope-project/laik/blob/f4806e3acb048fcc997881f655ee7f2e91f76965/src/action.c#L1927

There appear to be 2 other places in the same file that state the same assumption. Is there a workaround for this?

weidendo commented 5 years ago

The "lexicographical layout" comment is about how indexes of a LAIK container get mapped into memory. Currently LAIK only supports such layouts, and all tests use it. This has nothing to do with tasks in groups.

Something else is going on here. "from" is the offset within an allocated piece of memory, and it never must be negative. That memory was allocated for the slice "fromMap->requiredSlice", and "aa->slc" should be within that other slice. Sounds like an bug at allocation time (or wrong attribution). And again, I have no idea what this has to do with tasks within groups.

It would be good how to reproduce the failed assertion.

Vinpasso commented 5 years ago

Investigating. Will reopen if required