Friday, November 9, 2007

Deja vu

So I got a report of a crash today that I tracked down to the Perl interpreter memory allocator:

void* VMem::Malloc(size_t size)
2808308A push esi
2808308B mov esi,ecx
2808308D mov eax,dword ptr [esi]
2808308F push edi
28083090 call dword ptr [eax+0Ch]
28083093 mov eax,dword ptr [esp+0Ch]
28083097 add eax,0Ch
2808309A push eax
2808309B call dword ptr [esi+34h]
2808309E mov edi,eax
280830A0 lea eax,[esi+4]
280830A3 pop ecx
280830A4 mov ecx,dword ptr [eax]
280830A6 mov dword ptr [eax],edi
280830A8 mov dword ptr [edi],ecx
280830AA mov dword ptr [edi+4],eax
280830AD mov dword ptr [edi+8],esi
280830B0 mov dword ptr [ecx+4],edi
280830B3 mov eax,dword ptr [esi]
280830B5 mov ecx,esi
280830B7 call dword ptr [eax+10h]
return (ptr+1);
280830BA lea eax,[edi+0Ch]
280830BD pop edi
280830BE pop esi
return m_pmalloc(size);


EAX = 012C18DC EBX = 01FFFFFB ECX = 21264468 EDX = 0000000A
ESI = 012C18D8 EDI = 00000000 EIP = 280830A8 ESP = 0271DC70
EBP = 0271DCA4 EFL = 00000246

And as I'm looking at this, I'm thinking to myself, "doesn't this look familiar?". So I did a search, and came up with the following:

Then it occurred to me, "oh yeah, it's familiar because I ran across this seven months ago and submitted a patch to Perl core for it." It turns up though that I never checked it in to my own company's source code repository.

So as Dan put it, "You fixed it for everyone in the universe except for us."