gopalshankar / address-sanitizer

Automatically exported from code.google.com/p/address-sanitizer
0 stars 0 forks source link

shmctl interceptor does not work in 32-bit mode #250

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
% cat shm.cc 
#include <stdio.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <assert.h>

int main() {
  int id = shmget(IPC_PRIVATE, 4096, 0644 | IPC_CREAT);
  assert(id > -1);
  struct shmid_ds ds;
  int res = shmctl(id, IPC_STAT, &ds);
  assert(res > -1);
  printf("shm_segsz: %zd\n", ds.shm_segsz);
}
% clang -fsanitize=address shm.cc && ./a.out 
shm_segsz: 4096
% clang shm.cc && ./a.out 
shm_segsz: 4096
% clang -m32 shm.cc && ./a.out 
shm_segsz: 4096
% clang -m32 -fsanitize=address shm.cc && ./a.out 
shm_segsz: 135004160
% 

Disabling the interceptor helps, I am going to disable it for 32-bit

Original issue reported on code.google.com by konstant...@gmail.com on 29 Nov 2013 at 2:04

GoogleCodeExporter commented 9 years ago
Disabled in http://llvm.org/viewvc/llvm-project?view=revision&revision=195958

Original comment by konstant...@gmail.com on 29 Nov 2013 at 2:14

GoogleCodeExporter commented 9 years ago
FYI: this still fails despite  
http://llvm.org/viewvc/llvm-project?rev=200468&view=rev

Original comment by konstant...@gmail.com on 31 Jan 2014 at 9:07