Comment 2 for bug 1490868

Revision history for this message
Chris Coulson (chrisccoulson) wrote :

The code that crashes is this line:

128 memcpy(&buffer[current_pos], ANGLE_COMMIT_HASH, angle_commit_size);

This memcpy implementation looks like this:

=> 0xad6503d4 <+436>: ldmia r3!, {r0, r1, r2}
   0xad6503d6 <+438>: str.w r0, [r11, #40] ; 0x28
   0xad6503da <+442>: str.w r1, [r11, #44] ; 0x2c
   0xad6503de <+446>: str.w r2, [r11, #48] ; 0x30

The first instruction loads 12 bytes (ANGLE_COMMIT_HASH) from the address pointed to by r3 in to r0, r1 and r2. The following 3 instructions store these 12 bytes in to |buffer|. It crashes on the first instruction.

r3 points to an address in the .rodata section, as expected. It's clearly misaligned:

(gdb) info registers
r0 0x4d969a3b 1301715515
r1 0x260de0 2493920
r2 0xefd6e9e7 4023839207
r3 0xaef319b1 2935167409
r4 0x27 39
r5 0x3dfe8dc0 1040092608
r6 0x8ff20a74 2415004276
r7 0x9793a5dc 2543035868
r8 0x9793a5c8 2543035848
r9 0x8ff20aa4 2415004324
r10 0x5f 95
r11 0xafebfc68 2951478376
r12 0xb5f72774 3052873588
sp 0x9793a588 0x9793a588
lr 0xafe00018 -1344274408
pc 0xad6503d4 0xad6503d4 <gpu::gles2::ProgramCache::ComputeProgramHash(char const*, char const*, std::map<std::string, int, std::less<std::string>, std::allocator<std::pair<std::string const, int> > > const*, std::vector<std::string, std::allocator<std::string> > const&, unsigned int, char*) const+436>
cpsr 0x60070030 1611071536