Как вы инициализируете структуры с const-полями, выделяемые в куче?
А то я знаю только один рабочий способ, но он выглядит как-то... неестественно:
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
struct foo {
        void *const ptr;
};
int main()
{
        struct foo *bar;
        bar = malloc(sizeof(*bar));
        memcpy(bar, &(struct foo) { bar }, sizeof(*bar));
        printf("%p", bar->ptr);
}


