Skip to content

Instantly share code, notes, and snippets.

View gabrielgrant's full-sized avatar

Gabriel Grant gabrielgrant

View GitHub Profile
@gabrielgrant
gabrielgrant / gist:1760597
Created February 7, 2012 16:39
Unhandled exception in FogBugz
Unhandled Exception in Bug Search (Hide)
System.ApplicationException: Buffer cannot be null.
Parameter name: array
at System.IO.FileStream.Write(Byte[] array, Int32 offset, Int32 count)
at FogCreek.Search.Store.Buffer.ProcessValid(FileStream stream, FileStream valid, Int64 pos, Int32 length, Boolean fetch) in e:\code\hosted\build\FB\8.8.6H\fogbugz\FogBugzUtils\FogCreek.Search\FogUtil.Search\Store\Buffer.cs:line 297
at FogCreek.Search.Store.Buffer.Read(Int64 pos, Byte[] b, Int32 offset, Int32 length) in e:\code\hosted\build\FB\8.8.6H\fogbugz\FogBugzUtils\FogCreek.Search\FogUtil.Search\Store\Buffer.cs:line 451
at FogCreek.Search.Store.Input.ReadInternal(Byte[] b, Int32 offset, Int32 length) in e:\code\hosted\build\FB\8.8.6H\fogbugz\FogBugzUtils\FogCreek.Search\FogUtil.Search\Store\Input.cs:line 38
at Lucene.Net.Store.BufferedIndexInput.Refill() in e:\code\hosted\build\FB\8.8.6H\fogbugz\FogBugzUtils\FogCreek.Search\FogUtil.Search\Lucene.Net\Store\BufferedIndexInput.cs:line 77
at FogCreek.Searc
@gabrielgrant
gabrielgrant / dumpmaps.py
Created September 22, 2011 18:53
print gdb commands to dump memory from running process
import os.path
import sys
def main(pid):
f = open(os.path.join('/proc', pid, 'maps'))
for l in f.readlines():
col = l.split()
if len(col) == 5:
address, perms, offset, device, inode = col
pathname = ''
from subprocess import Popen, PIPE
outproc = None
linecount = 0
p = Popen('cat input.txt', shell=True, stdout=PIPE)
for line in p.stdout.xreadlines():
if linecount % 1000000 == 0:
outfile = "output%03d" %(linecount // 1000000, )
if outproc:
#outproc.stdin.flush()