Lines Matching refs:HG_
149 WordSetU* HG_(get_univ_lsets) ( void ) { return univ_lsets; }
153 Lock* HG_(get_admin_locks) ( void ) { return admin_locks; }
164 Bool HG_(clo_ignore_thread_creation) = True;
166 Bool HG_(clo_ignore_thread_creation) = False;
176 Thread* thread = HG_(zalloc)( "hg.mk_Thread.1", sizeof(Thread) );
177 thread->locksetA = HG_(emptyWS)( univ_lsets );
178 thread->locksetW = HG_(emptyWS)( univ_lsets );
200 Lock* lock = HG_(zalloc)( "hg.mk_Lock.1", sizeof(Lock) );
217 tl_assert(HG_(is_sane_LockN)(lock));
225 tl_assert(HG_(is_sane_LockN)(lk));
245 HG_(free)(lk);
253 tl_assert(HG_(is_sane_LockN)(lk));
254 tl_assert(HG_(is_sane_Thread)(thr));
278 lk->heldBy = VG_(newBag)( HG_(zalloc), "hg.lNaw.1", HG_(free) );
299 tl_assert(HG_(is_sane_LockN)(lk));
304 tl_assert(HG_(is_sane_LockN)(lk));
305 tl_assert(HG_(is_sane_Thread)(thr));
332 lk->heldBy = VG_(newBag)( HG_(zalloc), "hg.lNar.1", HG_(free) );
336 tl_assert(HG_(is_sane_LockN)(lk));
346 tl_assert(HG_(is_sane_LockN)(lk));
347 tl_assert(HG_(is_sane_Thread)(thr));
363 tl_assert(HG_(is_sane_LockN)(lk));
376 tl_assert(HG_(is_sane_Thread)(thr));
377 tl_assert(HG_(elemWS)( univ_lsets,
380 = HG_(delFromWS)( univ_lsets, thr->locksetA, (UWord)lk );
383 tl_assert(HG_(elemWS)( univ_lsets,
386 = HG_(delFromWS)( univ_lsets, thr->locksetW, (UWord)lk );
490 || !HG_(get_and_pp_addrdescr) ((Addr) lk->guestaddr))
609 map_threads = HG_(zalloc)( "hg.ids.1", VG_N_THREADS * sizeof(Thread*) );
613 map_locks = VG_(newFM)( HG_(zalloc), "hg.ids.2", HG_(free),
617 univ_lsets = HG_(newWordSetU)( HG_(zalloc), "hg.ids.4", HG_(free),
623 wsid = HG_(emptyWS)(univ_lsets);
627 if (HG_(clo_track_lockorders)) {
628 univ_laog = HG_(newWordSetU)( HG_(zalloc), "hg.ids.5 (univ_laog)",
629 HG_(free), 24/*cacheSize*/ );
644 tl_assert(HG_(is_sane_ThreadId)(thr->coretid));
663 tl_assert( HG_(is_sane_ThreadId)(coretid) );
672 tl_assert( HG_(is_sane_ThreadId)(coretid) );
683 tl_assert(HG_(is_sane_Thread)(thr));
688 tl_assert(HG_(is_sane_ThreadId)(tid));
707 tl_assert( HG_(is_sane_ThreadId)(coretid) );
713 static void HG_(thread_enter_synchr)(Thread *thr) {
720 static void HG_(thread_leave_synchr)(Thread *thr) {
727 static void HG_(thread_enter_pthread_create)(Thread *thr) {
732 static void HG_(thread_leave_pthread_create)(Thread *thr) {
737 static Int HG_(get_pthread_create_nesting_level)(ThreadId tid) {
754 tl_assert(HG_(is_sane_ThreadId)(tid));
760 tl_assert(HG_(is_sane_LockN)(lock));
766 tl_assert(HG_(is_sane_LockN)(oldlock));
895 if (!HG_(is_sane_Thread)(thr)) BAD("1");
899 if (!HG_(isSubsetOf)( univ_lsets, wsW, wsA )) BAD("7");
900 HG_(getPayloadWS)( &ls_words, &ls_size, univ_lsets, wsA );
904 if (!HG_(is_sane_LockN)(lk)) BAD("2");
943 if (!HG_(is_sane_LockN)(lk)) BAD("3");
954 // HG_(is_sane_LockN) above ensures these
956 tl_assert(HG_(is_sane_Thread)(thr));
957 if (!HG_(elemWS)(univ_lsets, thr->locksetA, (UWord)lk))
961 && !HG_(elemWS)(univ_lsets, thr->locksetW, (UWord)lk))
964 && HG_(elemWS)(univ_lsets, thr->locksetW, (UWord)lk))
988 if (HG_(clo_track_lockorders))
1080 //zz tl_assert(HG_(is_sane_Thread)(thr));
1103 'HG_(is_sane_LockN)(lk)' is both a pre- and post-condition of this
1111 tl_assert(HG_(is_sane_Thread)(thr));
1116 tl_assert( HG_(is_sane_LockN)(lk) );
1135 HG_(record_error_Misc)(
1146 HG_(record_error_Misc)(
1159 HG_(record_error_Misc)(
1174 if (HG_(clo_track_lockorders)) {
1180 thr->locksetA = HG_(addToWS)( univ_lsets, thr->locksetA, (UWord)lk );
1181 thr->locksetW = HG_(addToWS)( univ_lsets, thr->locksetW, (UWord)lk );
1185 tl_assert(HG_(is_sane_LockN)(lk));
1200 'HG_(is_sane_LockN)(lk)' is both a pre- and post-condition of this
1208 tl_assert(HG_(is_sane_Thread)(thr));
1215 tl_assert( HG_(is_sane_LockN)(lk) );
1234 HG_(record_error_Misc)( thr, "Bug in libpthread: read lock "
1249 if (HG_(clo_track_lockorders)) {
1255 thr->locksetA = HG_(addToWS)( univ_lsets, thr->locksetA, (UWord)lk );
1260 tl_assert(HG_(is_sane_LockN)(lk));
1283 tl_assert(HG_(is_sane_Thread)(thr));
1290 HG_(record_error_UnlockBogus)( thr, lock_ga );
1295 tl_assert(HG_(is_sane_LockN)(lock));
1298 HG_(record_error_Misc)( thr, "pthread_rwlock_unlock with a "
1302 HG_(record_error_Misc)( thr, "pthread_mutex_unlock with a "
1310 HG_(record_error_UnlockUnlocked)( thr, lock );
1311 tl_assert(!HG_(elemWS)( univ_lsets, thr->locksetA, (UWord)lock ));
1312 tl_assert(!HG_(elemWS)( univ_lsets, thr->locksetW, (UWord)lock ));
1330 tl_assert(HG_(is_sane_Thread)(realOwner));
1332 tl_assert(!HG_(elemWS)( univ_lsets, thr->locksetA, (UWord)lock ));
1333 tl_assert(!HG_(elemWS)( univ_lsets, thr->locksetW, (UWord)lock ));
1334 HG_(record_error_UnlockForeign)( thr, realOwner, lock );
1353 tl_assert(HG_(elemWS)( univ_lsets, thr->locksetA, (UWord)lock ));
1355 tl_assert(HG_(elemWS)( univ_lsets, thr->locksetW, (UWord)lock ));
1357 tl_assert(!HG_(elemWS)( univ_lsets, thr->locksetW, (UWord)lock ));
1387 = HG_(delFromWS)( univ_lsets, thr->locksetA, (UWord)lock );
1389 = HG_(delFromWS)( univ_lsets, thr->locksetW, (UWord)lock );
1400 tl_assert(HG_(is_sane_LockN)(lock));
1470 if (len >= SCE_BIGRANGE_T && (HG_(clo_sanity_flags) & SCE_BIGRANGE))
1482 if (len >= SCE_BIGRANGE_T && (HG_(clo_sanity_flags) & SCE_BIGRANGE))
1494 if (len >= SCE_BIGRANGE_T && (HG_(clo_sanity_flags) & SCE_BIGRANGE))
1512 if (len >= SCE_BIGRANGE_T && (HG_(clo_sanity_flags) & SCE_BIGRANGE))
1530 if (len >= SCE_BIGRANGE_T && (HG_(clo_sanity_flags) & SCE_BIGRANGE))
1540 if (len >= SCE_BIGRANGE_T && (HG_(clo_sanity_flags) & SCE_BIGRANGE))
1565 if (len >= SCE_BIGRANGE_T && (HG_(clo_sanity_flags) & SCE_BIGRANGE))
1576 if (len >= SCE_BIGRANGE_T && (HG_(clo_sanity_flags) & SCE_BIGRANGE))
1593 tl_assert(HG_(is_sane_ThreadId)(parent));
1594 tl_assert(HG_(is_sane_ThreadId)(child));
1640 if (HG_(clo_ignore_thread_creation)) {
1641 HG_(thread_enter_pthread_create)(thr_c);
1643 HG_(thread_enter_synchr)(thr_c);
1648 if (HG_(clo_sanity_flags) & SCE_THREADS)
1675 tl_assert(HG_(is_sane_ThreadId)(quit_tid));
1680 nHeld = HG_(cardinalityWS)( univ_lsets, thr_q->locksetA );
1686 HG_(record_error_Misc)( thr_q, buf );
1701 if (HG_(clo_sanity_flags) & SCE_THREADS)
1777 tl_assert(HG_(is_sane_ThreadId)(stay_tid));
1805 if (HG_(clo_sanity_flags) & SCE_THREADS)
1819 if (size >= SCE_BIGRANGE_T && (HG_(clo_sanity_flags) & SCE_BIGRANGE))
1840 if (len >= SCE_BIGRANGE_T && (HG_(clo_sanity_flags) & SCE_BIGRANGE))
1853 if (size >= SCE_BIGRANGE_T && (HG_(clo_sanity_flags) & SCE_BIGRANGE))
1864 if (len >= SCE_BIGRANGE_T && (HG_(clo_sanity_flags) & SCE_BIGRANGE))
1875 if (HG_(clo_free_is_write)) {
1906 if (len >= SCE_BIGRANGE_T && (HG_(clo_sanity_flags) & SCE_BIGRANGE))
2011 if (HG_(clo_sanity_flags) & SCE_LOCKS)
2028 tl_assert( HG_(is_sane_Thread)(thr) );
2041 HG_(record_error_Misc)(
2046 tl_assert( HG_(is_sane_LockN)(lk) );
2050 HG_(record_error_Misc)(
2060 tl_assert( HG_(is_sane_LockN)(lk) );
2062 if (HG_(clo_track_lockorders))
2069 if (HG_(clo_sanity_flags) & SCE_LOCKS)
2091 HG_(record_error_Misc)( thr, "pthread_mutex_lock with a "
2109 HG_(record_error_Misc_w_aux)( thr, errstr, auxstr, lk->acquired_at );
2111 HG_(record_error_Misc)( thr, errstr );
2185 tl_assert( HG_(is_sane_Thread)(thr) );
2269 map_cond_to_CVInfo = VG_(newFM)( HG_(zalloc),
2270 "hg.mctCI.1", HG_(free), NULL );
2282 CVInfo* cvi = HG_(zalloc)("hg.mctCloa.1", sizeof(CVInfo));
2316 HG_(record_error_Misc)(
2327 HG_(free)(cvi);
2334 HG_(record_error_Misc)(
2391 HG_(record_error_Misc)(thr,
2395 HG_(record_error_Misc)(thr,
2400 HG_(record_error_Misc)(thr,
2410 //HG_(record_error_Misc)( thr,
2444 HG_(record_error_Misc)(
2448 tl_assert( HG_(is_sane_LockN)(lk) );
2451 HG_(record_error_Misc)(
2457 HG_(record_error_Misc)(
2463 HG_(record_error_Misc)(
2479 HG_(record_error_Misc)(
2514 HG_(record_error_Misc)(thr, "condition variable has been destroyed while"
2527 HG_(record_error_Misc)( thr, "Bug in libpthread: pthread_cond_wait "
2581 if (HG_(clo_sanity_flags) & SCE_LOCKS)
2596 tl_assert( HG_(is_sane_Thread)(thr) );
2601 HG_(record_error_Misc)(
2606 tl_assert( HG_(is_sane_LockN)(lk) );
2610 HG_(record_error_Misc)(
2620 tl_assert( HG_(is_sane_LockN)(lk) );
2622 if (HG_(clo_track_lockorders))
2628 if (HG_(clo_sanity_flags) & SCE_LOCKS)
2654 HG_(record_error_Misc)(
2751 map_sem_to_SO_stack = VG_(newFM)( HG_(zalloc), "hg.mstSs.1",
2752 HG_(free), NULL );
2767 xa = VG_(newXA)( HG_(zalloc), "hg.pSfs.1", HG_(free), sizeof(SO*) );
2849 HG_(record_error_Misc)(
2929 HG_(record_error_Misc)(
2950 Bar* bar = HG_(zalloc)( "hg.nB.1 (new_Bar)", sizeof(Bar) );
2960 HG_(free)(bar);
2970 map_barrier_to_Bar = VG_(newFM)( HG_(zalloc),
2971 "hg.mbtBI.1", HG_(free), NULL );
3016 HG_(record_error_Misc)(
3022 HG_(record_error_Misc)(
3031 HG_(record_error_Misc)(
3038 HG_(record_error_Misc)(
3044 bar->waiting = VG_(newXA)( HG_(zalloc), "hg.eHPBIP.1", HG_(free),
3076 HG_(record_error_Misc)(
3082 HG_(record_error_Misc)(
3195 HG_(record_error_Misc)(
3238 HG_(record_error_Misc)(
3245 HG_(record_error_Misc)(
3252 HG_(record_error_Misc)(
3300 map_usertag_to_SO = VG_(newFM)( HG_(zalloc),
3301 "hg.mutS.1", HG_(free), NULL );
3421 HG_(thread_enter_synchr)(thr);
3423 HG_(thread_enter_pthread_create)(thr);
3441 HG_(thread_leave_synchr)(thr);
3442 HG_(thread_leave_pthread_create)(thr);
3520 tl_assert(HG_(clo_track_lockorders));
3522 laog = VG_(newFM)( HG_(zalloc), "hg.laog__init.1",
3523 HG_(free), NULL/*unboxedcmp*/ );
3525 laog_exposition = VG_(newFM)( HG_(zalloc), "hg.laog__init.2", HG_(free),
3543 HG_(getPayloadWS)( &ws_words, &ws_size, univ_laog, links->inns );
3546 HG_(getPayloadWS)( &ws_words, &ws_size, univ_laog, links->outs );
3561 const UWord univ_laog_cardinality = HG_(cardinalityWSU)( univ_laog);
3563 Bool *univ_laog_seen = HG_(zalloc) ( "hg.gc_univ_laog.1",
3584 HG_(dieWS) ( univ_laog, (WordSet)i );
3587 HG_(free) (univ_laog_seen);
3654 outs_new = HG_(addToWS)( univ_laog, links->outs, (UWord)dst );
3658 links = HG_(zalloc)("hg.lae.1", sizeof(LAOGLinks));
3659 links->inns = HG_(emptyWS)( univ_laog );
3660 links->outs = HG_(singletonWS)( univ_laog, (UWord)dst );
3670 inns_new = HG_(addToWS)( univ_laog, links->inns, (UWord)src );
3674 links = HG_(zalloc)("hg.lae.2", sizeof(LAOGLinks));
3675 links->inns = HG_(singletonWS)( univ_laog, (UWord)src );
3676 links->outs = HG_(emptyWS)( univ_laog );
3699 LAOGLinkExposition* expo2 = HG_(zalloc)("hg.lae.3",
3709 if (HG_(cardinalityWSU) (univ_laog) >= next_gc_univ_laog)
3724 links->outs = HG_(delFromWS)( univ_laog, links->outs, (UWord)dst );
3732 links->inns = HG_(delFromWS)( univ_laog, links->inns, (UWord)src );
3747 HG_(free) (fm_expo);
3752 if (HG_(cardinalityWSU) (univ_laog) >= next_gc_univ_laog)
3768 return HG_(emptyWS)( univ_laog );
3783 return HG_(emptyWS)( univ_laog );
3801 HG_(getPayloadWS)( &ws_words, &ws_size, univ_laog, links->inns );
3803 if ( ! HG_(elemWS)( univ_laog,
3808 HG_(getPayloadWS)( &ws_words, &ws_size, univ_laog, links->outs );
3810 if ( ! HG_(elemWS)( univ_laog,
3847 if (HG_(isEmptyWS)( univ_lsets, dsts ))
3851 stack = VG_(newXA)( HG_(zalloc), "hg.lddft.1", HG_(free), sizeof(Lock*) );
3852 visited = VG_(newFM)( HG_(zalloc), "hg.lddft.2", HG_(free), NULL/*unboxedcmp*/ );
3865 if (HG_(elemWS)( univ_lsets, dsts, (UWord)here )) { ret = here; break; }
3873 HG_(getPayloadWS)( &succs_words, &succs_size, univ_laog, succs );
3901 if (HG_(elemWS)( univ_lsets, thr->locksetA, (UWord)lk ))
3932 HG_(record_error_LockOrder)(
3982 HG_(record_error_LockOrder)(
3994 HG_(getPayloadWS)( &ls_words, &ls_size, univ_lsets, thr->locksetA );
4006 if (HG_(clo_sanity_flags) & SCE_LAOG)
4010 /* Allocates a duplicate of words. Caller must HG_(free) the result. */
4018 UWord *dup = HG_(zalloc) ("hg.dup.1", (SizeT) words_size * sizeof(UWord));
4040 HG_(getPayloadWS)( &preds_words, &preds_size, univ_laog, preds );
4043 HG_(getPayloadWS)( &succs_words, &succs_size, univ_laog, succs );
4064 HG_(free) (preds_words);
4066 HG_(free) (succs_words);
4076 HG_(free) (links);
4091 // HG_(getPayloadWS)( &ws_words, &ws_size, univ_lsets, locksToDelete );
4096 // if (HG_(clo_sanity_flags) & SCE_LAOG)
4343 Bool HG_(mm_find_containing_block)( /*OUT*/ExeContext** where,
4517 if (! HG_(clo_check_stack_refs)) {
4880 map_pthread_t_to_Thread = VG_(newFM)( HG_(zalloc), "hg.mpttT.1",
4881 HG_(free), NULL );
4900 gnat_dmmls = VG_(newXA) (HG_(zalloc), "hg.gnat_md.1",
4901 HG_(free),
4993 libhb_event_map_access_history (address, szB, HG_(print_access));
5042 if (HG_(mm_find_containing_block)(NULL, NULL,
5115 if (HG_(clo_ignore_thread_creation)) {
5116 HG_(thread_leave_pthread_create)(my_thr);
5117 HG_(thread_leave_synchr)(my_thr);
5129 HG_(record_error_PthAPIerror)(
5230 HG_(thread_enter_synchr)(map_threads_maybe_lookup(tid));
5231 if (HG_(get_pthread_create_nesting_level)(tid) == 0)
5236 if (HG_(get_pthread_create_nesting_level)(tid) == 0)
5238 HG_(thread_leave_synchr)(map_threads_maybe_lookup(tid));
5242 HG_(thread_enter_synchr)(map_threads_maybe_lookup(tid));
5243 if (HG_(get_pthread_create_nesting_level)(tid) == 0)
5249 && (HG_(get_pthread_create_nesting_level)(tid) == 0))
5251 HG_(thread_leave_synchr)(map_threads_maybe_lookup(tid));
5258 HG_(thread_enter_synchr)(map_threads_maybe_lookup(tid));
5264 HG_(thread_leave_synchr)(map_threads_maybe_lookup(tid));
5271 HG_(thread_enter_synchr)(map_threads_maybe_lookup(tid));
5298 HG_(thread_leave_synchr)(map_threads_maybe_lookup(tid));
5311 HG_(thread_enter_synchr)(map_threads_maybe_lookup(tid));
5312 if (HG_(get_pthread_create_nesting_level)(tid) == 0)
5320 && (HG_(get_pthread_create_nesting_level)(tid) == 0))
5322 HG_(thread_leave_synchr)(map_threads_maybe_lookup(tid));
5326 HG_(thread_enter_synchr)(map_threads_maybe_lookup(tid));
5327 if (HG_(get_pthread_create_nesting_level)(tid) == 0)
5332 if (HG_(get_pthread_create_nesting_level)(tid) == 0)
5334 HG_(thread_leave_synchr)(map_threads_maybe_lookup(tid));
5346 HG_(thread_enter_synchr)(map_threads_maybe_lookup(tid));
5351 HG_(thread_leave_synchr)(map_threads_maybe_lookup(tid));
5355 HG_(thread_enter_synchr)(map_threads_maybe_lookup(tid));
5361 HG_(thread_leave_synchr)(map_threads_maybe_lookup(tid));
5421 HG_(record_error_Misc)( thr, buf );
5451 if (HG_(clo_ignore_thread_creation)) {
5452 HG_(thread_enter_pthread_create)(thr);
5453 HG_(thread_enter_synchr)(thr);
5460 if (HG_(clo_ignore_thread_creation)) {
5461 HG_(thread_leave_pthread_create)(thr);
5462 HG_(thread_leave_synchr)(thr);
5520 HG_(clo_track_lockorders)) {}
5522 HG_(clo_cmp_race_err_addrs)) {}
5525 HG_(clo_history_level), 0);
5527 HG_(clo_history_level), 1);
5529 HG_(clo_history_level), 2);
5532 HG_(clo_conflict_cache_size), 10*1000, 150*1000*1000) {}
5545 else if ('1' == tmp_str[j]) HG_(clo_sanity_flags) |= (1 << (6-1-j));
5552 if (0) VG_(printf)("XXX sanity flags: 0x%lx\n", HG_(clo_sanity_flags));
5556 HG_(clo_free_is_write)) {}
5559 HG_(clo_vts_pruning), 0);
5561 HG_(clo_vts_pruning), 1);
5563 HG_(clo_vts_pruning), 2);
5566 HG_(clo_check_stack_refs)) {}
5568 HG_(clo_ignore_thread_creation)) {}
5590 HG_(clo_ignore_thread_creation) ? "yes" : "no"
5621 HG_(ppWSUstats)( univ_lsets, "univ_lsets" );
5622 if (HG_(clo_track_lockorders)) {
5624 HG_(ppWSUstats)( univ_laog, "univ_laog" );
5642 (Int)HG_(cardinalityWSU)( univ_lsets ));
5643 if (HG_(clo_track_lockorders)) {
5645 (Int)HG_(cardinalityWSU)( univ_laog ));
5653 HG_(stats__LockN_to_P_queries),
5654 HG_(stats__LockN_to_P_get_map_size)() );
5660 HG_(stats__string_table_queries),
5661 HG_(stats__string_table_get_map_size)() );
5662 if (HG_(clo_track_lockorders)) {
5689 && HG_(clo_history_level) >= 2) {
5698 if (HG_(clo_sanity_flags))
5750 if (HG_(clo_track_lockorders))
5758 (void) HG_(get_and_pp_addrdescr) (a);
5776 VG_(needs_tool_errors) (HG_(eq_Error),
5777 HG_(before_pp_Error),
5778 HG_(pp_Error),
5780 HG_(update_extra),
5781 HG_(recognised_suppression),
5782 HG_(read_extra_suppression_info),
5783 HG_(error_matches_suppression),
5784 HG_(get_error_name),
5785 HG_(get_extra_suppression_info),
5786 HG_(print_extra_suppression_use),
5787 HG_(update_extra_suppression_use));
5867 HG_(zalloc),
5869 HG_(free));