kozyraki / phoenix Goto Github PK
View Code? Open in Web Editor NEWan API and runtime environment for data processing with MapReduce for shared-memory multi-core & multiprocessor systems.
an API and runtime environment for data processing with MapReduce for shared-memory multi-core & multiprocessor systems.
string_match
benchmark when malloc
is used.NO_MMAP
flag and AddressSanitizer
(ASan
):$ git clone https://github.com/kozyraki/phoenix.git
$ cd phoenix/phoenix-2.0/
$ echo 'diff --git a/phoenix-2.0/tests/string_match/Makefile b/phoenix-2.0/tests/string_match/Makefile
index be7d94b..310b965 100644
--- a/phoenix-2.0/tests/string_match/Makefile
+++ b/phoenix-2.0/tests/string_match/Makefile
@@ -46,16 +46,16 @@ default: all
all: $(PROGS)
string_match: $(STR_MATCH_OBJS) $(LIB_DEP)
- $(CC) $(CFLAGS) -o $@ $(STR_MATCH_OBJS) $(LIBS)
+ $(CC) $(CFLAGS) -o $@ $(STR_MATCH_OBJS) $(LIBS) -fsanitize=address
string_match-seq: $(STR_MATCH_SEQ_OBJS)
- $(CC) $(CFLAGS) -o $@ $(STR_MATCH_SEQ_OBJS) $(LIBS)
+ $(CC) $(CFLAGS) -o $@ $(STR_MATCH_SEQ_OBJS) $(LIBS) -fsanitize=address
string_match-pthread: $(STR_MATCH_PTHREAD_OBJS)
- $(CC) $(CFLAGS) -o $@ $(STR_MATCH_PTHREAD_OBJS) $(LIBS)
+ $(CC) $(CFLAGS) -o $@ $(STR_MATCH_PTHREAD_OBJS) $(LIBS) -fsanitize=address
%.o: %.c
- $(CC) $(CFLAGS) -c $< -o $@ -I$(HOME)/$(INC_DIR)
+ $(CC) $(CFLAGS) -c $< -o $@ -I$(HOME)/$(INC_DIR) -DNO_MMAP=1 -fsanitize=address
clean:
rm -f $(PROGS) $(STR_MATCH_OBJS) $(STR_MATCH_SEQ_OBJS) $(STR_MATCH_PTHREAD_OBJS)' > sm_overflow.patch
$ git apply sm_overflow.patch
$ make
string_match
benchmark:$ cd tests/string_match
$ wget http://csl.stanford.edu/~christos/data/string_match.tar.gz
$ tar -xvf string_match.tar.gz
string_match
benchmark and observe the output of ASan
:$ ./string_match string_match_datafiles/key_file_50MB.txt
To fix the issue, you need to add 1 byte in the malloc
call (to match the one used by the default mmap
).
Then, the execution with ASan
no longer reports the heap buffer overflow.
A sample patch is attached to this issue.
sm_overflow_fix_patch.txt
OS: Ubuntu 22.04.4 LTS
Kernel: 6.2.0-39-generic
gcc: 11.4.0
The archive with inputs for linear_regression:
http://csl.stanford.edu/~christos/data/linear_regression.tar.gz
is wrong. It contains the inputs for string_match.
The README and the source code say that linear_regression "reads the x-y coordinates sequentially from the specified file".
In linear_regression example: max_procs
defined in line 427 (MapReduceScheduler.c) in #ifdef _SOLARIS_
not defined for later usage in line 473 if not _SOLARIS_
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.