 +    unsigned char edges[];
 +};
 +
-+struct shmem_data* shmem;
-+
++struct shmem_data* __shmem;
 +uint32_t *__edges_start, *__edges_stop;
++
 +void __sanitizer_cov_reset_edgeguards() {
 +    uint32_t N = 0;
 +    for (uint32_t *x = __edges_start; x < __edges_stop && N < MAX_EDGES; x++)

+    const char* shm_key = getenv("SHM_ID");
+    if (!shm_key) {
+        puts("[COV] no shared memory bitmap available, skipping");
+        shmem = (struct shmem_data*) malloc(SHM_SIZE);
+    } else {
+        int fd = shm_open(shm_key, O_RDWR, S_IREAD | S_IWRITE);
+        if (fd <= -1) {

+            _exit(-1);
+        }
+
+        __shmem = (struct shmem_data*) mmap(0, SHM_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
+        if (__shmem == MAP_FAILED) {
+            fprintf(stderr, "[COV] Failed to mmap shared memory region\n");
+            _exit(-1);
+        }
