Beispiel #1
0
static int send_snapshots(GPtrArray *snapshots_array, GPtrArray *target_array, const unsigned int max_concurrent_transfers, const int all)
{
    int success;
    SendSnapshotsData data = { snapshots_array, all };
    ProcReact_PidIterator iterator = create_target_iterator(target_array, send_snapshots_to_target, complete_send_snapshots_to_target, &data);
    procreact_fork_and_wait_in_parallel_limit(&iterator, max_concurrent_transfers);
    success = target_iterator_has_succeeded(&iterator);
    
    destroy_target_iterator(&iterator);
    
    return success;
}
Beispiel #2
0
static void
thread_exit(void *dcontext)
{
    fuzz_pass_context_t *fp = (fuzz_pass_context_t *) drmgr_get_tls_field(dcontext,
                                                                          tls_idx_fuzzer);

    /* crash is indicated by aborted fuzz targets, even if the app did a hard exit() */
    if (fp->live_targets != NULL) {
        if (callbacks->crash_thread_event != NULL) {
            /* There may be targets already captured by a fault event. If not, and if fuzz
             * targets were evidently aborted, then make them available in an iterator.
             */
            if (fp->thread_state->targets == NULL && fp->live_targets != NULL)
                fp->thread_state->targets = create_target_iterator(fp);

            callbacks->crash_thread_event(fp, fp->thread_state);
        }
    }

    free_thread_state(fp);
    clear_pass_targets(fp);
    thread_free(dcontext, fp, sizeof(fuzz_pass_context_t), HEAPSTAT_MISC);
}