nowsecure / r2frida

Radare2 and Frida better together.
MIT License
1.18k stars 121 forks source link

(ASAN build only) - Runtime error: null pointer passed as argument 2, which is declared to never be null #348

Closed enovella closed 2 years ago

enovella commented 2 years ago

Error: src/io_frida.c:540:2: runtime error: null pointer passed as argument 2, which is declared to never be null

Build

[11:35 edu@xps r2frida]  (master)>  make clean && make asan && sudo make install
rm -f src/*.o src/_agent.js src/_agent.h
rm -f -rf /home/edu/src/gh/r2frida/radare2-android-libs/data/data/com.termux/files/usr
make clean
make[1]: Entering directory '/home/edu/src/gh/r2frida'
rm -f src/*.o src/_agent.js src/_agent.h
rm -f -rf /home/edu/src/gh/r2frida/radare2-android-libs/data/data/com.termux/files/usr
make[1]: Leaving directory '/home/edu/src/gh/r2frida'
make USE_ASAN=1
make[1]: Entering directory '/home/edu/src/gh/r2frida'
[ "`readlink ext/frida`" = frida-linux-15.1.9 ] || \
    (cd ext && rm -f frida ; ln -fs frida-linux-15.1.9 frida)
make io_frida.so
make[2]: Entering directory '/home/edu/src/gh/r2frida'
npm run build

> r2frida-agent@5.4.4 build /home/edu/src/gh/r2frida
> frida-compile src/agent -Sco src/_agent.js -c

r2 -nfqcpc src/_agent.js | grep 0x > src/_agent.h
cc -c -DFRIDA_VERSION_STRING=\"15.1.9\" -fPIC -g -I/usr/local/include/libr -I/usr/local/include/libr/sdb -fsanitize=address,undefined,signed-integer-overflow,integer-divide-by-zero -Iext/frida src/io_frida.c -o src/io_frida.o
pkg-config --cflags r_core
-I/usr/local/include/libr -I/usr/local/include/libr/sdb
g++ src/io_frida.o -o io_frida.so -shared -fPIC -g -L/usr/local/lib -lr_core -lssl -lcrypto -lr_config -lr_debug -lr_bin -lr_anal -lr_bp -lr_egg -lr_asm -lr_lang -lr_parse -lr_flag -lr_reg -lr_search -lr_syscall -lr_fs -lr_magic -lr_io -lr_socket -lr_cons -lr_crypto -lr_hash -lr_util -ldl -fsanitize=address,undefined,signed-integer-overflow,integer-divide-by-zero  ext/frida/libfrida-core.a -lresolv
make[2]: Leaving directory '/home/edu/src/gh/r2frida'
make[1]: Leaving directory '/home/edu/src/gh/r2frida'
mkdir -p "//usr/local/lib/radare2/5.4.3"
cp -f io_frida.so* /"/usr/local/lib/radare2/5.4.3"

Run

[11:36 edu@xps r2frida]  (master)>  r2 frida://spawn/usb//the.package.name
src/io_frida.c:540:2: runtime error: null pointer passed as argument 2, which is declared to never be null
[0x00000000]> :i
arch                arm
bits                64
os                  linux
pid                 29621
uid                 10305
objc                false
runtime             QJS
swift               false
java                true
mainLoop            false
pageSize            4096
pointerSize         8
codeSigningPolicy   optional
isDebuggerAttached  false
cwd                 /
cacheDir            /data/local/tmp
jniEnv              0x78a6c831f0
[0x00000000]> 
trufae commented 2 years ago

Should be fixed in master pleae confirm