+void cpr_segv_handler(int sig, siginfo_t *info, void *context) {
+ void *newmem;
+
+ DPRINTF("SEGV at %p, mapping memory\n", info->si_addr);
+ errno = 0;
+ newmem = mmap(info->si_addr, 1, PROT_READ, MAP_PRIVATE|MAP_ANONYMOUS|MAP_FIXED, -1, 0);
+ if (newmem != info->si_addr) {
+ perror("libusb-driver.so: Can't map memory, crashing now");
+ exit(EXIT_FAILURE);
+ }
+}
+