The check_stack program checks that the generated stack that includes both native functions and Java methods (generated from the emulator instruction trace plus the method trace) is consistent with the stack of Java methods that is computed from the method trace alone. (The method trace is generated by the Dalvik interpreter).