Skip to content

Instantly share code, notes, and snippets.

View rhizoome's full-sized avatar
💭
Gluing elephants to the ceiling

Jean-Louis Fuchs rhizoome

💭
Gluing elephants to the ceiling
View GitHub Profile
==30814== Process terminating with default action of signal 2 (SIGINT)
==30814== at 0x4035143: __syscall6 (syscall_arch.h:59)
==30814== by 0x4035143: syscall (syscall.c:18)
==30814== by 0x52B4518: uv__epoll_wait (linux-syscalls.c:321)
==30814== by 0x52B2E1C: uv__io_poll (linux-core.c:271)
==30814== by 0x52A719A: uv_run (core.c:352)
==30814== by 0x11C1E5: ch_run (chirp.c:1060)
==30814== by 0x11BB8E: ch_chirp_run (chirp.c:872)
==30814== by 0x10DC9E: main (func_etest.c:336)
Fuzzing my C networking library with valgrind memcheck and hypothesis takes long, but finds bugs.
Leaked allocations:
0x4f199e0 0x4f19ab0
/outside/src/util.c:141: Assert failed: There is a memory leak
==5859==
==5859== HEAP SUMMARY:
==5859== in use at exit: 3,719 bytes in 11 blocks
==5859== total heap usage: 3,628 allocs, 3,621 frees, 345,682 bytes allocated
==5859==
==5859== 1,200 bytes in 1 blocks are indirectly lost in loss record 8 of 9
import pytest
from hypothesis import given
from hypothesis.strategies import text, lists
def func(x):
print(x)
class TestPerson():
pkg/
pkg/.control.pypy3-doc
pkg/.control.pypy3-doc/.metafiles
pkg/.control.pypy3-doc/.needs-so
pkg/.control.pypy3-doc/.PKGINFO
pkg/.control.pypy3-doc/.provides-so
pkg/.control.pypy3-doc/data.tar.gz
pkg/.control.pypy3-doc/control.tar.gz
pkg/pypy3
pkg/pypy3/usr
@rhizoome
rhizoome / assign_aware.py
Created June 15, 2017 20:06
For code generators make functions assign aware (incomplete experiment)
import inspect
import ast
def get_assign_names():
names = []
caller_frame = inspect.stack()[2]
call = ast.parse(caller_frame.code_context[0])
assign = None
for stmt in call.body:
@rhizoome
rhizoome / py.py
Created June 8, 2017 18:58
py-break
class PyNameEquals(gdb.Function):
def __init__(self):
gdb.Function.__init__ (self,
"pyname_equals")
def _get_pycurframe_attr(self, attr):
frame = Frame(gdb.selected_frame())
if frame.is_evalframeex():
pyframe = frame.get_pyop()
@rhizoome
rhizoome / gist:75da6a38b618b7dd6ffca7ef5fb94256
Created June 8, 2017 15:21
foo python reverse debug with rr
(rr) source /usr/share/doc/python3.5/examples/gdb/libpython.py
(rr) py-bt
Traceback (most recent call first):
File "py.py", line 1, in huhu
def huhu(a):
File "py.py", line 7, in <module>
print(huhu(3))
@rhizoome
rhizoome / static-pie.c
Created May 25, 2017 12:39
My new favourite pie and musl static binaries are sooooooo small!
$> cat static-pie.c
#include <stdio.h>
int main(void) {
printf("%p\n", main);
}
$> gcc -static static-pie.c
$> ./a.out
0x7422f6eb35c5
$> ./a.out
export PATH="$HOME/perl5/bin:$PATH"
export PERL5LIB="/home/ganwell/perl5/lib/perl5:$PERL5LIB"
export PERL_LOCAL_LIB_ROOT="/home/ganwell/perl5:$PERL_LOCAL_LIB_ROOT"
export PERL_MB_OPT="--install_base \"/home/ganwell/perl5\""
export PERL_MM_OPT="INSTALL_BASE=/home/ganwell/perl5"
#ifdef LIBRESSL_VERSION_NUMBER
# define CH_OPENSSL_10_API
# define CH_LIBRESSL
#else
# define CH_OPENSSL
# if (OPENSSL_VERSION_NUMBER <= 0x10100000L)
# define CH_OPENSSL_10_API
# endif
#endif