This seems to fix a crash from dirty job that looked like this:

(gdb) bt
#0  0xb7fdd424 in __kernel_vsyscall ()
#1  0xb70361ef in __GI_raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#2  0xb7039835 in __GI_abort () at abort.c:91
#3  0xb72a513d in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib/i386-linux-gnu/libstdc++.so.6
#4  0xb72a2ed3 in ?? () from /usr/lib/i386-linux-gnu/libstdc++.so.6
#5  0xb72a2f0f in std::terminate() () from /usr/lib/i386-linux-gnu/libstdc++.so.6
#6  0xb72a305e in __cxa_throw () from /usr/lib/i386-linux-gnu/libstdc++.so.6
#7  0xb7247113 in std::__throw_length_error(char const*) () from /usr/lib/i386-linux-gnu/libstdc++.so.6
#8  0xb72887f2 in std::string::_Rep::_S_create(unsigned int, unsigned int, std::allocator<char> const&) ()
   from /usr/lib/i386-linux-gnu/libstdc++.so.6
#9  0xb7288ab4 in std::string::_M_mutate(unsigned int, unsigned int, unsigned int) ()
   from /usr/lib/i386-linux-gnu/libstdc++.so.6
#10 0xb728978e in std::string::_M_leak_hard() () from /usr/lib/i386-linux-gnu/libstdc++.so.6
#11 0xb72898ab in std::string::operator[](unsigned int) () from /usr/lib/i386-linux-gnu/libstdc++.so.6
#12 0x081bf5fb in leveldb::WriteBatchInternal::SetCount (b=0xb2e752a0, n=-1293462887) at db/write_batch.cc:87
#13 0x081bf6e9 in leveldb::WriteBatch::Delete (this=0xb2e752a0, key=...) at db/write_batch.cc:106
#14 0x0814ed61 in Batch::remove (this=0xb2e75294, key=...) at /home/abakken/dev/rtags/src/Database.cpp:238
#15 0x0819cd33 in dirtySymbols (db=..., dirty=...) at /home/abakken/dev/rtags/src/DirtyThread.cpp:54
#16 0x0819ce70 in DirtyThread::run (this=0x8768280) at /home/abakken/dev/rtags/src/DirtyThread.cpp:70
#17 0x081976e6 in Thread::internalStart (arg=0x8768280) at /home/abakken/dev/rtags/src/Thread.cpp:15
#18 0xb6ff3d4c in start_thread (arg=0xb2e75b40) at pthread_create.c:308
#19 0xb70f2ace in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130


and this:

running with List<ByteArray>(-I/home/abakken/dev/rtags/3rdparty/clang_install/lib/clang/3.1/include) clang version clang version 3.1 
/home/abakken/dev/rtags/: Checked 45 files. Found 48 dirty files and 35 sources to reindex in 1091ms
remake 
==13126== Thread 10:
==13126== Source and destination overlap in memcpy(0xc23f034, 0xba3d298, 195285632)
==13126==    at 0x402E9A9: memcpy (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==13126==    by 0x4DC2B78: std::string::_M_mutate(unsigned int, unsigned int, unsigned int) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16)
==13126== 
==13126== Invalid read of size 4
==13126==    at 0x402EB26: memcpy (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==13126==    by 0x4DC2B78: std::string::_M_mutate(unsigned int, unsigned int, unsigned int) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16)
==13126==  Address 0xc23f024 is 4 bytes before a block of size 195,289,072 alloc'd
==13126==    at 0x402C9B4: operator new(unsigned int) (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==13126==    by 0x4DC27D3: std::string::_Rep::_S_create(unsigned int, unsigned int, std::allocator<char> const&) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16)
==13126==    by 0x4DC2AB3: std::string::_M_mutate(unsigned int, unsigned int, unsigned int) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16)
==13126==    by 0x4DC378D: std::string::_M_leak_hard() (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16)
==13126==    by 0x81BF6E8: leveldb::WriteBatch::Delete(leveldb::Slice const&) (write_batch.cc:106)
==13126==    by 0x814ED60: Batch::remove(Slice const&) (Database.cpp:238)
==13126==    by 0x819CD32: dirtySymbols(ScopedDB&, Set<unsigned int> const&) (DirtyThread.cpp:54)
==13126==    by 0x819CE6F: DirtyThread::run() (DirtyThread.cpp:70)
==13126==    by 0x81976E5: Thread::internalStart(void*) (Thread.cpp:15)
==13126==    by 0x500DD4B: start_thread (pthread_create.c:308)
==13126==    by 0x4F4CACD: clone (clone.S:130)
==13126== 
==13126== Invalid read of size 4
==13126==    at 0x402EB18: memcpy (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==13126==    by 0x4DC2B78: std::string::_M_mutate(unsigned int, unsigned int, unsigned int) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16)
==13126==  Address 0xc23f020 is 8 bytes before a block of size 195,289,072 alloc'd
==13126==    at 0x402C9B4: operator new(unsigned int) (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==13126==    by 0x4DC27D3: std::string::_Rep::_S_create(unsigned int, unsigned int, std::allocator<char> const&) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16)
==13126==    by 0x4DC2AB3: std::string::_M_mutate(unsigned int, unsigned int, unsigned int) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16)
==13126==    by 0x4DC378D: std::string::_M_leak_hard() (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16)
==13126==    by 0x81BF6E8: leveldb::WriteBatch::Delete(leveldb::Slice const&) (write_batch.cc:106)
==13126==    by 0x814ED60: Batch::remove(Slice const&) (Database.cpp:238)
==13126==    by 0x819CD32: dirtySymbols(ScopedDB&, Set<unsigned int> const&) (DirtyThread.cpp:54)
==13126==    by 0x819CE6F: DirtyThread::run() (DirtyThread.cpp:70)
==13126==    by 0x81976E5: Thread::internalStart(void*) (Thread.cpp:15)
==13126==    by 0x500DD4B: start_thread (pthread_create.c:308)
==13126==    by 0x4F4CACD: clone (clone.S:130)
==13126==