From 3a866068b39a13e38cfb9287d84c912faf2b1d7e Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Tue, 5 Sep 2017 17:00:28 +0200 Subject: executor: fix 32-bit mode The correct type is kernel long size, not user-space long size. We approximate it with uint64. --- executor/executor.cc | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'executor/executor.cc') diff --git a/executor/executor.cc b/executor/executor.cc index 8fa4a071b..7ccca2230 100644 --- a/executor/executor.cc +++ b/executor/executor.cc @@ -814,17 +814,13 @@ void cover_open() th->cover_fd = open("/sys/kernel/debug/kcov", O_RDWR); if (th->cover_fd == -1) fail("open of /sys/kernel/debug/kcov failed"); - if (ioctl(th->cover_fd, KCOV_INIT_TRACE, kCoverSize)) fail("cover init trace write failed"); - - size_t mmap_alloc_size = kCoverSize * sizeof(unsigned long); + size_t mmap_alloc_size = kCoverSize * sizeof(th->cover_data[0]); uint64_t* mmap_ptr = (uint64_t*)mmap(NULL, mmap_alloc_size, PROT_READ | PROT_WRITE, MAP_SHARED, th->cover_fd, 0); - if (mmap_ptr == MAP_FAILED) fail("cover mmap failed"); - th->cover_size_ptr = mmap_ptr; th->cover_data = &mmap_ptr[1]; } -- cgit mrf-deployment