Skip to content

Instantly share code, notes, and snippets.


Tristan Seligmann mithrandi

View GitHub Profile
View gist:2b0fa115203001edd1b4
==2124==ERROR: AddressSanitizer: heap-buffer-overflow on address 0xf4676669 at pc 0x085c7b84 bp 0xffbfa928 sp 0xffbfa920
WRITE of size 4 at 0xf4676669 thread T0
#0 0x85c7b83 in cell_dealloc /tmp/Python-3.5.1/Objects/cellobject.c:49
#1 0x85e971d in frame_dealloc /tmp/Python-3.5.1/Objects/frameobject.c:433
#2 0x83b8341 in _PyEval_EvalCodeWithName /tmp/Python-3.5.1/Python/ceval.c:3977
#3 0x838d60d in PyEval_EvalCodeEx /tmp/Python-3.5.1/Python/ceval.c:3987
#4 0x85f19f6 in function_call /tmp/Python-3.5.1/Objects/funcobject.c:632
#5 0x819c887 in PyObject_Call /tmp/Python-3.5.1/Objects/abstract.c:2165
#6 0x839d917 in ext_do_call /tmp/Python-3.5.1/Python/ceval.c:4983
#7 0x83b842a in _PyEval_EvalCodeWithName /tmp/Python-3.5.1/Python/ceval.c:3966
View gist:77d94af7476c5eea5ed5
tests/hazmat/backends/ .
========================================================================================================== 1 passed in 0.19 seconds ==========================================================================================================
Program received signal SIGSEGV, Segmentation fault.
0x080dd9db in visit_decref () at ../Modules/gcmodule.c:360
360 in ../Modules/gcmodule.c
(gdb) bt
#0 0x080dd9db in visit_decref () at ../Modules/gcmodule.c:360
#1 0x080ddb2d in dict_traverse () at ../Objects/dictobject.c:2114
View gist:5c1e09486154a092c5bb
Program received signal SIGSEGV, Segmentation fault.
PyErr_SetObject () at ../Python/errors.c:104
104 ../Python/errors.c: No such file or directory.
(gdb) bt
#0 PyErr_SetObject () at ../Python/errors.c:104 [0/9182]
#1 0x0817da0b in PyErr_FormatV (vargs=0xffffbc88 "9\372\065\b\305D\030\b|GC\b\250\274\377\377p'\227\367\305\267\035\bp'\227\367", format=0x8364644 "an integer is required (got type %.200s)", exception=<type at remote 0x8478b20>)
at ../Python/errors.c:784
#2 PyErr_Format () at ../Python/errors.c:799
#3 0x081db616 in _PyLong_FromNbInt () at ../Objects/longobject.c:145
View gist:347185c625358b6ab9b9
Program received signal SIGSEGV, Segmentation fault.
_PyObject_Malloc.lto_priv.1306 () at ../Objects/obmalloc.c:1159
1159 ../Objects/obmalloc.c: No such file or directory.
(gdb) bt
#0 _PyObject_Malloc.lto_priv.1306 () at ../Objects/obmalloc.c:1159
#1 0x0815e69a in PyObject_Malloc (size=<optimized out>) at ../Objects/obmalloc.c:351
#2 _PyObject_GC_Malloc (basicsize=<optimized out>) at ../Modules/gcmodule.c:1725
#3 _PyObject_GC_New () at ../Modules/gcmodule.c:1748
#4 0x081ef612 in PyCell_New (obj=0x0) at ../Objects/cellobject.c:10
mithrandi /
Created Oct 7, 2015
trial / threadpool interaction
from twisted.internet import reactor
from twisted.internet.defer import gatherResults
from twisted.internet.threads import deferToThread
from twisted.trial.unittest import TestCase
from time import sleep
class Case(TestCase):
def test_threads(self):
return start()
mithrandi /
Last active Sep 22, 2015
txspinneret route('') issue
from txspinneret.interfaces import ISpinneretResource
from txspinneret.route import Router, routedResource
from zope.interface import implementer
class Root(object):
router = Router()
mithrandi / gist:3e16ea08bea3ab221137
Created May 14, 2015
Halcyon-on-Heroku dockerfile
View gist:3e16ea08bea3ab221137
FROM heroku/cedar:14
MAINTAINER Tristan Seligmann <>
RUN ["git", "clone", "-b", "v1.0.5", "", "/halcyon"]
RUN ["/halcyon/halcyon", "paths"]
mithrandi /
Last active Aug 29, 2015
Fish function for development with axiomatic
function ax
if not set -q PROJECT
set PROJECT (basename $VIRTUAL_ENV)
set -l SOURCEDIR {$HOME}/code/{$PROJECT}
if test -z "$PROJECT" -o ! -d "$SOURCEDIR"
echo "Unable to locate project; do you have a virtualenv activated?"
return 1
set -l BRANCH (hg --repository $SOURCEDIR branch)
mithrandi / gist:fdeeb25cb05c846eceab
Last active Aug 29, 2015
Version of map handling deferreds/errors
View gist:fdeeb25cb05c846eceab
(ns clj-amp.core
(:require [manifold.deferred :as d]
[ :as s]))
(defn- map'
"Like, except handles deferreds and closes the stream if an error occurs."
([f s]
(let [s' (s/stream)]
(fn [msg]
View gist:8922bd4fbff4b7263d4b
def fetch(..., clock=None):
if clock is None:
from twisted.internet import reactor as clock
def handleResponse(response):
# ...
d = agent.request(method, url, Headers(h), body)
call = clock.callLater(timeout, d.cancel)
def cancelTimeout(result):