<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 5, 2016 at 5:29 PM, Santiago Bragagnolo <span dir="ltr"><<a href="mailto:santiagobragagnolo@gmail.com" target="_blank">santiagobragagnolo@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> <br><div dir="ltr">Hi All! <div>I'm working on the Android VM. (<a href="https://github.com/sbragagnolo/pharo-vm" target="_blank">https://github.com/<wbr>sbragagnolo/pharo-vm</a>) So far I made my way on my own(I have a working compilation of the stack vm for android functional, but without uffi and quite slow ). But now i have a problem that I don't understand at all, i would like if someone can point me a clue :). </div><div><br></div><div>Im working on the VM+Jit for android. The device i'am using to test is a wiko pulp 4g[1], processor <span style="background-color:rgb(250,250,250);font-family:arimo,arial;font-size:14px">Quad-core 1.2 GHz Cortex-A53</span> with support for 32bits/64bits instructions [2]</div><div><br></div><div>I am compiling the VM with the following maker options:</div><div><div><br></div><div><div><b>maker options: #(</b></div><div><b><span class="gmail-m_-7253764042037036002inbox-inbox-Apple-tab-span" style="white-space:pre-wrap">                </span>ObjectMemory Spur32BitCoMemoryManager</b></div><div><b><span class="gmail-m_-7253764042037036002inbox-inbox-Apple-tab-span" style="white-space:pre-wrap">                </span>FailImbalancedPrimitives false</b></div><div><b><span class="gmail-m_-7253764042037036002inbox-inbox-Apple-tab-span" style="white-space:pre-wrap">                </span>CogCompilerClass CogOutOfLineLiteralsARMCompile<wbr>r</b></div><div><b><span class="gmail-m_-7253764042037036002inbox-inbox-Apple-tab-span" style="white-space:pre-wrap">                </span>ISA ARMv5).</b></div></div></div><div><br></div><div></div><div>After some manual post processing (related to an other question that i will do in other thread), I arrive to compile and deploy the application in to my device. </div><div><br></div><div>But when I open the application I am having the following assertion failure ( defined in sqCogStackAlignment.h ),</div><div><br></div><div> <b>assert((getfp() & STACK_ALIGN_MASK) == STACK_FP_ALIGNMENT);</b><br></div><div><br></div><div><span class="gmail-m_-7253764042037036002inbox-inbox-Apple-converted-space"> </span>and failing in the second call for the assertion, on the generated function <b>generateStackPointerC<wbr>apture</b> on the generated file <b>cogitARMv5.c</b>, based on the method <b>Cogit>>#<wbr>generateStackPointerCapture, </b>a<wbr>nd not finishing the process, but just failing many other times in the same assertion (not sure if on the same function) </div><div><br></div><div><br></div><div><b>=====================</b></div><div>static void generateStackPointerCapture(<wbr>void) {</div><div> sqInt oldMethodZoneBase;</div><div> sqInt oldTrampolineTableIndex;</div><div><br></div><div><span class="gmail-m_-7253764042037036002Apple-tab-span" style="white-space:pre-wrap">        </span>/* For the benefit of the following assert, assume the minimum at first. */</div><div> cFramePointerInUse = 0;</div><div><span class="gmail-m_-7253764042037036002Apple-tab-span" style="white-space:pre-wrap">        </span>assertCStackWellAligned();</div><div><span class="gmail-m_-7253764042037036002Apple-tab-span" style="white-space:pre-wrap">        </span>oldMethodZoneBase = methodZoneBase;</div><div><span class="gmail-m_-7253764042037036002Apple-tab-span" style="white-space:pre-wrap">        </span>oldTrampolineTableIndex = trampolineTableIndex;</div><div><span class="gmail-m_-7253764042037036002Apple-tab-span" style="white-space:pre-wrap">        </span>generateCaptureCStackPointers(<wbr>1);</div><div><span class="gmail-m_-7253764042037036002Apple-tab-span" style="white-space:pre-wrap">        </span>ceCaptureCStackPointers();</div><div><span class="gmail-m_-7253764042037036002Apple-tab-span" style="white-space:pre-wrap">        </span>if (!((cFramePointerInUse = isCFramePointerInUse()))) {</div><div><span class="gmail-m_-7253764042037036002Apple-tab-span" style="white-space:pre-wrap">                </span>methodZoneBase = oldMethodZoneBase;</div><div><span class="gmail-m_-7253764042037036002Apple-tab-span" style="white-space:pre-wrap">                </span>trampolineTableIndex = oldTrampolineTableIndex;</div><div><span class="gmail-m_-7253764042037036002Apple-tab-span" style="white-space:pre-wrap">                </span>generateCaptureCStackPointers(<wbr>0);</div><div><span class="gmail-m_-7253764042037036002Apple-tab-span" style="white-space:pre-wrap">        </span>}</div><div><span class="gmail-m_-7253764042037036002Apple-tab-span" style="white-space:pre-wrap">        </span>assertCStackWellAligned(); <b>// it fails Here</b></div><div>}</div><div><b>======================</b></div><div><br></div><div>Here I'm lacking understanding, and even when after some painful time I arrived to be able to debug on my device when I leave the debugger just to run and randomly interrupt the process to know where is failing constantly (i'm almost sure that is an infinite loop, because of the standard output) It just die, or it stops without showing code, since is the code stored on the assembly files. </div><div><br></div><div>I have two obvious questions: </div><div><br></div><div> 1) does the prepareVmMaker method that I defined makes sense? </div></div></blockquote><div><br></div><div>Look strange.</div><br>FailImbalancedPrimitives false => for the VM without the JIT. The default is true, just write nothing instead.</div><div class="gmail_quote"><br></div><div class="gmail_quote">CogCompilerClass CogOutOfLineLiteralsARMCompiler ISA ARMv5 => The VM is generated for all back-ends on the word size. Just write nothing instead.</div><br>I believe maker options: #(ObjectMemory Spur32BitCoMemoryManager) is enough.<div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div> 2) any body can give me a hint about how to debug better this problem? </div></div></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><br></div><div>And finally, does any body have a hint in general about what can it be? </div><div><br></div></div></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div></div><div>[1] <a href="http://www.gsmarena.com/wiko_pulp_4g-7811.php" target="_blank">http://www.gsmarena.com/wiko_<wbr>pulp_4g-7811.php</a></div><div>[2] <a href="http://www.arm.com/products/processors/cortex-a/cortex-a53-processor.php" target="_blank">http://www.arm.com/products/<wbr>processors/cortex-a/cortex-<wbr>a53-processor.php</a></div><div><br></div></div>
<br></blockquote></div><br></div></div>