<div dir="ltr">Hi All! <div>I&#39;m working on the Android VM. (<a href="https://github.com/sbragagnolo/pharo-vm">https://github.com/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&#39;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&#39;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="inbox-inbox-Apple-tab-span" style="white-space:pre">                </span>ObjectMemory Spur32BitCoMemoryManager</b></div><div><b><span class="inbox-inbox-Apple-tab-span" style="white-space:pre">                </span>FailImbalancedPrimitives false</b></div><div><b><span class="inbox-inbox-Apple-tab-span" style="white-space:pre">                </span>CogCompilerClass CogOutOfLineLiteralsARMCompiler</b></div><div><b><span class="inbox-inbox-Apple-tab-span" style="white-space:pre">                </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() &amp; STACK_ALIGN_MASK) == STACK_FP_ALIGNMENT);</b><br></div><div><br></div><div><span class="inbox-inbox-Apple-converted-space"> </span>and failing in the second call for the assertion, on the generated function <b>generateStackPointerCapture</b> on the generated file <b>cogitARMv5.c</b>, based on the method <b>Cogit&gt;&gt;#generateStackPointerCapture, </b>and 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(void) {</div><div>    sqInt oldMethodZoneBase;</div><div>    sqInt oldTrampolineTableIndex;</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>/* For the benefit of the following assert, assume the minimum at first. */</div><div>        cFramePointerInUse = 0;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>assertCStackWellAligned();</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>oldMethodZoneBase = methodZoneBase;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>oldTrampolineTableIndex = trampolineTableIndex;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>generateCaptureCStackPointers(1);</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>ceCaptureCStackPointers();</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>if (!((cFramePointerInUse = isCFramePointerInUse()))) {</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>methodZoneBase = oldMethodZoneBase;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>trampolineTableIndex = oldTrampolineTableIndex;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>generateCaptureCStackPointers(0);</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>}</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>assertCStackWellAligned();   <b>// it fails Here</b></div><div>}</div><div><b>======================</b></div><div><br></div><div>Here I&#39;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&#39;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>  2) any body can give me a hint about how to debug better this problem? </div><div><br></div><div>And finally, does any body have a hint in general about what can it be?   </div><div><br></div><div>[1] <a href="http://www.gsmarena.com/wiko_pulp_4g-7811.php">http://www.gsmarena.com/wiko_pulp_4g-7811.php</a></div><div>[2] <a href="http://www.arm.com/products/processors/cortex-a/cortex-a53-processor.php">http://www.arm.com/products/processors/cortex-a/cortex-a53-processor.php</a></div><div><br></div></div>