try repeating write
MODIFY
GNUmakefile
GNUmakefile
@@ -145,7 +145,7 @@ else
CFLAGS ?= -O2 $(CFLAGS_OPT) # -funroll-loops is slower on modern compilers
endif
-override CFLAGS += -g -Wno-pointer-sign -Wno-variadic-macros -Wall -Wextra -Wpointer-arith \
+override CFLAGS += -g -Wno-pointer-sign -Wno-variadic-macros -Wall -Wextra -Wno-pointer-arith \
-fPIC -I include/ -DAFL_PATH=\"$(HELPER_PATH)\" \
-DBIN_PATH=\"$(BIN_PATH)\" -DDOC_PATH=\"$(DOC_PATH)\"
# -fstack-protector

MODIFY
custom_mutators/grammar_mutator/grammar_mutator
custom_mutators/grammar_mutator/grammar_mutator
-Subproject commit cbe5e32752773945e0142fac9f1b7a0ccb5dcdff
+Subproject commit ff4e5a265daf5d88c4a636fb6a2c22b1d733db09

MODIFY
include/debug.h
include/debug.h
@@ -358,17 +358,36 @@ static inline const char *colorfilter(const char *x) {
#define ck_write(fd, buf, len, fn) \
do { \
\
+ if (len <= 0) break; \
int _fd = (fd); \
+ s32 _written = 0, _off = 0, _len = (s32)(len); \
\
- s32 _len = (s32)(len); \
- s32 _res = write(_fd, (buf), _len); \
- if (_res != _len) { \
+ do { \
+ \
+ s32 _res = write(_fd, (buf) + _off, _len); \
+ if (_res != _len && (_res > 0 && _written + _res != _len)) { \
+ \
+ if (_res > 0) { \
+ \
+ _written += _res; \
+ _len -= _res; \
+ _off += _res; \
+ \
+ } else { \
\
RPFATAL(_res, "Short write to %s, fd %d (%d of %d bytes)", fn, _fd, \
_res, _len); \
\
} \
\
+ } else { \
+ \
+ break; \
+ \
+ } \
+ \
+ } while (1); \
+ \
} while (0)
#define ck_read(fd, buf, len, fn) \

MODIFY
unicorn_mode/unicornafl
unicorn_mode/unicornafl
-Subproject commit d4915053d477dd827b3fe4b494173d3fbf9f456e
+Subproject commit a44fa94488d01aba60401ccf81f8bebcce685bf2

try repeating write