Пример #1
0
void NaClLogUnlock(void) {
  if (abort_on_unlock) {
    /*
     * include an easy-to-recognize output for the fuzzer to recognize
     */
    NaClLog_mu(LOG_ERROR, "LOG_FATAL abort exit\n");
#ifdef __COVERITY__
    abort();  /* help coverity figure out that this is the default behavior */
#else
    (*gNaClLogAbortBehavior)();
#endif
  }
  NaClMutexUnlock(&log_mu);
}
Пример #2
0
void NaClLogUnlock(void) {
  int run_abort_behavior = 0;
  switch (g_abort_count) {
    case 0:
      NaClXMutexUnlock(&log_mu);
      break;
    case 1:
      /*
       * include an easy-to-recognize output for the fuzzer to recognize
       */
      if (!g_abort_behavior_active) {
        NaClLog_mu(LOG_ERROR, "LOG_FATAL abort exit\n");
        g_abort_behavior_active = 1;
        run_abort_behavior = 1;
        /*
         * run abort behavior only on edge transition when
         * g_abort_behavior_active is first set.
         */
      }
      NaClXMutexUnlock(&log_mu);
      if (run_abort_behavior) {
#ifdef __COVERITY__
        NaClAbort();  /* help coverity figure out that this is the default */
#else
        NaClLogRunAbortBehavior();
#endif
        /* The abort behavior hook may not abort, so abort here in case. */
        NaClAbort();
      }
      break;
    default:
      /*
       * Abort handling code in turn aborted.  Eeep!
       */
      NaClAbort();
      break;
  }
}