santoshn / softboundcets-3.8.0

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Spatial-only protection

OleksiiOleksenko opened this issue · comments

It seems like the constant __SOFTBOUNDCETS_SPATIAL is not supported. I saw it used in many places in the runtime library, but when I tried replacing the line 6 in the runtime/Makefile:

CFLAGS=-Wall -pedantic  -O3 -D__SOFTBOUNDCETS_SPATIAL_TEMPORAL

with

CFLAGS=-Wall -pedantic  -O3 -D__SOFTBOUNDCETS_SPATIAL

build failed with the following error:

clang -Wall -pedantic  -O3 -D__SOFTBOUNDCETS_SPATIAL -c softboundcets-checks.c -o softboundcets-checks.o
In file included from softboundcets-checks.c:42:
./softboundcets.h:582:31: warning: comparison of distinct pointer types
      ('void *' and 'char *') [-Wcompare-distinct-pointer-types]
  if(dest < dest_base || dest > ((char*) dest_bound - size) || (size > (size_t) dest_bound))
                         ~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
./softboundcets.h:585:28: warning: comparison of distinct pointer types
      ('void *' and 'char *') [-Wcompare-distinct-pointer-types]
  if(src < src_base || src > ((char*) src_bound - size) || (size > (size_t) dest_bound))
                       ~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~
./softboundcets.h:1304:61: error: too many arguments to function call, expected 3, have 5
   __softboundcets_metadata_load((void*) addr, base, bound, key, lock);   
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                            ^~~~~~~~~
./softboundcets.h:884:1: note: '__softboundcets_metadata_load' declared here
__METADATA_INLINE void __softboundcets_metadata_load(void* addr_of_ptr, 
^
./softboundcets.h:203:27: note: expanded from macro '__METADATA_INLINE'
#define __METADATA_INLINE __attribute__((__weak__, __always_inline__))
                          ^
./softboundcets.h:1318:61: error: too many arguments to function call, expected 3, have 5
   __softboundcets_metadata_store((void*)addr, base, bound, key, lock);
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                           ^~~~~~~~~
./softboundcets.h:735:1: note: '__softboundcets_metadata_store' declared here
__METADATA_INLINE void __softboundcets_metadata_store(void* addr_of_ptr, 
^
./softboundcets.h:203:27: note: expanded from macro '__METADATA_INLINE'
#define __METADATA_INLINE __attribute__((__weak__, __always_inline__))
                          ^
2 warnings and 2 errors generated.
Makefile:33: recipe for target 'softboundcets_rt' failed
make: *** [softboundcets_rt] Error 1

To fix it, I tried removing key and lock arguments from the __softboundcets_metadata_store and __softboundcets_metadata_load calls, but afterwards all the applications that I tried to compile failed with a segmentation fault. To be precise, I used Phoenix for testing.

For now, this version does not support spatial only version. It requires a bit of invasive changes right now. I will try to add a spatial only version.

Ok, thanks. Then another question. What else can be configured or tweaked to improve performance? Because, I tried running a couple benchmarks from Phoenix with default configuration (i.e., with parameters described in the README) and I got overheads of 10-15x.

You have to run it with optimizations. I will enable LTO shortly which will reduce the overheads to about 2X on average.