void ReportDtor(int zvm_ret) { SetExitCode(zvm_ret); /* * patch to show special messages instead of signals 24, 25 * and do not calculate etag if session failed */ if(zvm_code != 0) { SpecSignals(); ZLOGS(LOG_ERROR, "SESSION %d FAILED WITH ERROR %d: %s", gnap->manifest == NULL ? 0 : gnap->manifest->node, zvm_code, strerror(zvm_code)); } if(zvm_code != 0) FinalDump(gnap); AccountingDtor(gnap); ChannelsDtor(gnap->manifest); Report(gnap); NaClAppDtor(gnap); /* free user space and globals */ ManifestDtor(gnap->manifest); /* dispose manifest and channels */ FreeDispatchThunk(); ZLogDtor(); _exit(zvm_code); }
void ReportDtor(int zvm_ret) { SetExitCode(zvm_ret); /* broken session */ if(zvm_code != 0) { ZLOGS(LOG_ERROR, "SESSION %d FAILED WITH ERROR %d: %s", gnap->manifest == NULL ? 0 : gnap->manifest->node, zvm_code, strerror(zvm_code)); FinalDump(gnap); ZTrace("[final dump]"); } ChannelsDtor(gnap->manifest); ZTrace("[channels destruction]"); Report(gnap); ZTrace("[report]"); NaClAppDtor(gnap); /* free user space and globals */ ZTrace("[untrusted context closing]"); ManifestDtor(gnap->manifest); /* dispose manifest and channels */ ZTrace("[manifest deallocating]"); FreeDispatchThunk(); ZTrace("[thunk deallocating]"); ZLogDtor(); ZTrace("[zlog deallocating]"); /* free local resources and exit */ g_string_free(digests, TRUE); g_string_free(cmd, TRUE); g_free(zvm_state); ZTrace("[exit]"); ZTraceDtor(1); ZTraceNameDtor(); _exit(zvm_code); }