13 Jan 2013 00:10
Understand disassemble for segfault on android
Nathan Hüsken <nathan.huesken <at> posteo.de>
2013-01-12 23:10:51 GMT
2013-01-12 23:10:51 GMT
Hey,
I am still investigating the segfaults of the exectuable produced by ghc
to arm-linux-androideabi cross compiler.
I need help. Can someone tell me if my conclusions are correct?
The crash happens here:
Dump of assembler code for function stg_returnToStackTop:
0x003f059c <+0>: push {r4, lr}
0x003f05a0 <+4>: sub sp, sp, #16
0x003f05a4 <+8>: ldr r1, [r0, #140] ; 0x8c
=> 0x003f05a8 <+12>: ldr r12, [r1, #12]
0x003f05ac <+16>: ldr r1, [r12, #12]
0x003f05b0 <+20>: mov r2, #0
Since it is in the begining of stg_returnToStackTop, it has to be
LOAD_THREAD_STATE();
I believe the code for this is produced by loadThreadState:
loadThreadState dflags tso stack = do
catAGraphs [
-- tso = CurrentTSO;
mkAssign (CmmLocal tso) stgCurrentTSO,
-- stack = tso->stackobj;
mkAssign (CmmLocal stack) (CmmLoad (cmmOffset dflags (CmmReg
(CmmLocal tso)) (tso_stackobj dflags)) (bWord dflags)),
(...)
(Continue reading)
RSS Feed