Skip to content

Instantly share code, notes, and snippets.

View wiredfool's full-sized avatar
💭
Feline

wiredfool wiredfool

💭
Feline
View GitHub Profile
(vpy27)erics-imac:Pillow erics$ python setup.py build_ext
running build_ext
--- using frameworks at /System/Library/Frameworks
building '_imaging' extension
creating build
creating build/temp.macosx-10.4-x86_64-2.7
creating build/temp.macosx-10.4-x86_64-2.7/libImaging
gcc -fno-strict-aliasing -arch x86_64 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DHAVE_LIBJPEG -DHAVE_LIBZ -DHAVE_LIBTIFF -I/System/Library/Frameworks/Tcl.framework/Headers -I/System/Library/Frameworks/Tk.framework/Headers -I/usr/X11/include/freetype2 -IlibImaging -I/opt/local/include -I/usr/X11/include -I/Users/erics/src/vpy27/include -I/usr/local/include -I/usr/include -I/Users/erics/src/buildout.python/parts/opt/include/python2.7 -c _imaging.c -o build/temp.macosx-10.4-x86_64-2.7/_imaging.o
gcc -fno-strict-aliasing -arch x86_64 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DHAVE_LIBJPEG -DHAVE_LIBZ -DHAVE_LIBTIFF -I/System/Library/Frameworks/Tcl.framework/Headers -I/System/Library/Frameworks/Tk.framework/Headers -I/usr/X11/includ
@wiredfool
wiredfool / gist:5165896
Created March 14, 2013 22:42
Buffer overflow in histogram test
erics@builder-1204:~/Pillow$ python Tests/test_image_histogram.py
*** buffer overflow detected ***: python terminated
======= Backtrace: =========
/lib/i386-linux-gnu/libc.so.6(__fortify_fail+0x45)[0x44d045]
/lib/i386-linux-gnu/libc.so.6(+0x102e1a)[0x44be1a]
/lib/i386-linux-gnu/libc.so.6(+0x10214d)[0x44b14d]
/usr/local/lib/python2.7/dist-packages/Pillow-2.0.0-py2.7-linux-i686.egg/_imaging.so(ImagingHistogramNew+0x48)[0x515fb8]
/usr/local/lib/python2.7/dist-packages/Pillow-2.0.0-py2.7-linux-i686.egg/_imaging.so(ImagingGetHistogram+0x155)[0x516145]
/usr/local/lib/python2.7/dist-packages/Pillow-2.0.0-py2.7-linux-i686.egg/_imaging.so(+0xa69f)[0x4fd69f]
python(PyEval_EvalFrameEx+0x291)[0x81949c1]
@wiredfool
wiredfool / gist:5165952
Created March 14, 2013 22:52
histogram stack trace
#0 0x00007ffff68f6425 in raise () from /lib/x86_64-linux-gnu/libc.so.6
#1 0x00007ffff68f9b8b in abort () from /lib/x86_64-linux-gnu/libc.so.6
#2 0x00007ffff693439e in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#3 0x00007ffff69ca807 in __fortify_fail () from /lib/x86_64-linux-gnu/libc.so.6
#4 0x00007ffff69c9700 in __chk_fail () from /lib/x86_64-linux-gnu/libc.so.6
#5 0x00007ffff5d72a93 in strcpy (__src=0xa20080 "YCbCr", __dest=0xa2dfa0 "YCbCr")
at /usr/include/x86_64-linux-gnu/bits/string3.h:105
#6 ImagingHistogramNew (im=0xa20080) at libImaging/Histo.c:44
#7 0x00007ffff5d72c03 in ImagingGetHistogram (im=0xa20080, imMask=<optimized out>, minmax=<optimized out>)
at libImaging/Histo.c:71
@wiredfool
wiredfool / gist:5725422
Created June 6, 2013 22:13
actual test
from django.core.management.base import NoArgsCommand
from easy_thumbnails.files import generate_all_aliases
from photos.models import Photo
import time
import gc
import resource
#gc.enable()
#gc.set_debug(gc.DEBUG_LEAK)
1; RSS: 55612; Obj: 35226
2; RSS: 55628; Obj: 35254
3; RSS: 55628; Obj: 35282
4; RSS: 55628; Obj: 35310
5; RSS: 55628; Obj: 35338
6; RSS: 55628; Obj: 35366
7; RSS: 55628; Obj: 35394
8; RSS: 55628; Obj: 35422
9; RSS: 55628; Obj: 35450
10; RSS: 55628; Obj: 35278
@wiredfool
wiredfool / gist:5727193
Created June 7, 2013 05:17
run of all_photos.zip
1; RSS: 75968; Obj: 27735
2; RSS: 75968; Obj: 27764
3; RSS: 115140; Obj: 27793
4; RSS: 115140; Obj: 27822
5; RSS: 115140; Obj: 27851
6; RSS: 115140; Obj: 27880
7; RSS: 115140; Obj: 27909
8; RSS: 115140; Obj: 27938
9; RSS: 115140; Obj: 27960
10; RSS: 115140; Obj: 27789
@wiredfool
wiredfool / gist:5730478
Created June 7, 2013 16:20
valgrind run.
(et-test)erics@builder-1204-x64:~/et-test/et-issue-example$ valgrind --tool=massif python manage.py generate_all_thumbnail_aliases
==16695== Massif, a heap profiler
==16695== Copyright (C) 2003-2011, and GNU GPL'd, by Nicholas Nethercote
==16695== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
==16695== Command: python manage.py generate_all_thumbnail_aliases
==16695==
1; RSS: 142912; Unshared: 0; Obj: 27683
2; RSS: 142912; Unshared: 0; Obj: 27535
3; RSS: 177228; Unshared: 0; Obj: 27563
4; RSS: 177228; Unshared: 0; Obj: 27591
@wiredfool
wiredfool / gist:5754498
Created June 11, 2013 04:36
comparision of thumbnail generation locally and delivering to s3.
from before, no s3:
--------------------------------------------------------------------------------
Command: python manage.py generate_all_thumbnail_aliases
Massif arguments: (none)
ms_print arguments: massif.out.16695
--------------------------------------------------------------------------------
MB
126.7^ #
@wiredfool
wiredfool / gist:5754556
Created June 11, 2013 04:58
object count trace
Printing the top increasing object count through each iteration -- baseline is after one photo:
(et-test)erics@builder-1204-x64:~/et-test/et-issue-example$ python manage.py generate_all_thumbnail_aliases1; RSS: 50128; Unshared: 0; Obj: 30587
Object count:
55: <type 'weakref'>
9: <type 'dict'>
5: <type 'list'>
4: <type 'instance'>
1: <class 'boto.connection.ConnectionPool'>
1: <class 'storages.backends.s3boto.S3BotoStorageFile'>
@wiredfool
wiredfool / gist:5783854
Created June 14, 2013 17:47
live-samples
--------------------------------------------------------------------------------
Command: python manage.py generate_all_thumbnail_aliases
Massif arguments: (none)
ms_print arguments: massif.out.27846
--------------------------------------------------------------------------------
MB
99.98^ #
| #