<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:"MS Mincho";
        panose-1:2 2 6 9 4 2 5 8 3 4;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"\@MS Mincho";
        panose-1:2 2 6 9 4 2 5 8 3 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="2050" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=SV link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span lang=EN-US>Hi Dave<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>I have a vmcore file for ARM64 that crashes Crash during startup. The core file is created at a hardware watchdog (I believe) so there is no panic message or something similar in the log.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>This is the printout from Crash running under gdb, after the copyrights and config information:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>please wait... (determining panic task)         <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>Program received signal SIGSEGV, Segmentation fault.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>0x000000000047ed40 in tgid_quick_search (tgid=5040) at memory.c:4114<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>4114                                              if (tgid == last->tgid) {<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>(gdb) bt<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>#0  0x000000000047ed40 in tgid_quick_search (tgid=5040) at memory.c:4114<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>#1  0x000000000047f046 in get_task_mem_usage (task=18446743799318107136, tm=0x7fffffff6f40)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>    at memory.c:4186<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>#2  0x000000000047c679 in vm_area_dump (task=18446743799318107136, flag=10, vaddr=0, ref=0x0)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>    at memory.c:3671<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>#3  0x000000000047ec08 in in_user_stack (task=18446743799318107136, vaddr=0) at memory.c:4063<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>#4  0x00000000004fd9fe in arm64_get_dumpfile_stackframe (frame=<synthetic pointer>, <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>    bt=<optimized out>) at arm64.c:1077<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>#5  arm64_get_stack_frame (bt=0x7fffffffc690, pcp=0x7fffffff9560, spp=0x7fffffff9568)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>    at arm64.c:1103<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>#6  0x00000000004de409 in back_trace (bt=0x7fffffffc690) at kernel.c:2533<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>#7  0x00000000004d1563 in foreach (fd=0x7fffffffc7c0) at task.c:6161<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>#8  0x00000000004d2bbd in panic_search () at task.c:6425<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>#9  0x00000000004d4454 in get_panic_context () at task.c:5364<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>#10 task_init () at task.c:491<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>#11 0x000000000046146e in main_loop () at main.c:801<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>#12 0x00000000006467a3 in captured_command_loop (data=<optimized out>) at main.c:258<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>#13 0x000000000064535b in catch_errors (func=0x646790 <captured_command_loop>, func_args=0x0, <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>    errstring=0x873235 "", mask=6) at exceptions.c:557<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>#14 0x0000000000647726 in captured_main (data=<optimized out>) at main.c:1064<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>#15 0x000000000064535b in catch_errors (func=0x646aa0 <captured_main>, func_args=0x7fffffffe030, <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>    errstring=0x873235 "", mask=6) at exceptions.c:557<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>#16 0x0000000000647a84 in gdb_main (args=<optimized out>) at main.c:1079<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>#17 0x0000000000647abe in gdb_main_entry (argc=<optimized out>, argv=<optimized out>)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>    at main.c:1099<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>#18 0x000000000045f61f in main (argc=3, argv=0x7fffffffe188) at main.c:758<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>(gdb) p tt->last_tgid<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>$1 = (struct tgid_context *) 0x0<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>Source code for tgid_quick_search:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>static struct tgid_context *<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>tgid_quick_search(ulong tgid)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>{<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>                           struct tgid_context *last, *next;<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>                           tt->tgid_searches++;<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>                           last = tt->last_tgid;<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>                           if (tgid == last->tgid) {<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>                                                       tt->tgid_cache_hits++;<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>                                                       </span>return last;<o:p></o:p></p><p class=MsoNormal>                           }<o:p></o:p></p><p class=MsoNormal>  ....<o:p></o:p></p><p class=MsoNormal><span lang=EN-US>}<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>So 'last' becomes 0 which causes the crash.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>After some more investigation I have seen that "tt->last_tgid" is initialized in function sort_tgid_array in task.c, but that function seems to be called at a later stage.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>By adding a line in tgid_quick_search:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>static struct tgid_context *<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>tgid_quick_search(ulong tgid)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>{<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>                           struct tgid_context *last, *next;<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>                           tt->tgid_searches++;<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>                           if (tt->last_tgid == 0) sort_tgid_array(); // added line<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>                           last = tt->last_tgid;<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>                           if (tgid == last->tgid) {<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>                                                       tt->tgid_cache_hits++;<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>                                                       return last;<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>                           }<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>  ...<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>I can run Crash on this core file. However I do not know if this is the best way to fix the problem.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>Jan<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal style='mso-line-height-alt:10.5pt'><b><span lang=EN-US style='font-family:"Arial","sans-serif";color:black'>Jan Karlsson</span></b><span lang=EN-US style='font-family:"Arial","sans-serif";color:#1F497D'><o:p></o:p></span></p><p class=MsoNormal style='line-height:10.5pt'><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";color:black'>Senior Software Engineer<o:p></o:p></span></p><p class=MsoNormal style='line-height:10.5pt'><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";color:black'>System Assurance<o:p></o:p></span></p><p class=MsoNormal style='line-height:10.5pt'><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#222222'><o:p> </o:p></span></p><p class=MsoNormal style='line-height:10.5pt'><b><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#222222'>Sony Mobile Communications<o:p></o:p></span></b></p><p class=MsoNormal style='line-height:10.5pt'><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#222222'>Tel: +46 703 062 174<o:p></o:p></span></p><p class=MsoNormal style='line-height:10.5pt'><span lang=EN-GB style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#222222'><a href="mailto:Firstname.Lastname@sonymobile.com"><span style='color:blue'>jan.karlsson@sonymobile.com</span></a><o:p></o:p></span></p><p class=MsoNormal style='line-height:10.5pt'><span lang=EN-GB style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#222222'><o:p> </o:p></span></p><p class=MsoNormal style='mso-line-height-alt:10.5pt'><span style='color:#1F497D'><a href="http://sonymobile.com/"><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#002AFF'>sonymobile.com</span></a></span><span lang=EN-US style='color:#1F497D'><o:p></o:p></span></p><p class=MsoNormal style='mso-line-height-alt:10.5pt'><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal style='mso-line-height-alt:10.5pt'><span style='color:#1F497D'><img border=0 width=84 height=15 id="Picture_x0020_1" src="cid:image001.gif@01CFED2C.FA76D730" alt="Sony logotype_23px height_Email_144dpi"></span><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#002AFF'><o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>