Example #1
0
 @Override
 public void classInitialized(ClassInitializedEvent e) {
   final ShadowThread currentThread = e.getThread();
   final CV cv = this.ts_get_cv(currentThread);
   Util.log("Class Init for " + e + " -- " + cv);
   classInitTime.get(e.getRRClass()).max(cv);
   this.incEpochAndCV(currentThread, e);
   super.classInitialized(e);
 }
Example #2
0
  private void error(
      final AccessEvent ae,
      final int errorCase,
      final String prevOp,
      final int prevTid,
      final String curOp,
      final int curTid) {

    try {
      if (ae instanceof FieldAccessEvent) {
        FieldAccessEvent fae = (FieldAccessEvent) ae;
        final FieldInfo fd = fae.getInfo().getField();
        final ShadowThread currentThread = fae.getThread();
        final Object target = fae.getTarget();

        fieldErrors.error(
            currentThread,
            fd,
            "Guard State",
            fae.getOriginalShadow(),
            "Current Thread",
            toString(currentThread),
            "Class",
            target == null ? fd.getOwner() : target.getClass(),
            "Field",
            Util.objectToIdentityString(target) + "." + fd,
            "Prev Op",
            prevOp + prevTid,
            "Cur Op",
            curOp + curTid,
            "Case",
            "#" + errorCase,
            "Stack",
            ShadowThread.stackDumpForErrorMessage(currentThread));
        if (!fieldErrors.stillLooking(fd)) {
          advance(ae);
          return;
        }
      } else {
        ArrayAccessEvent aae = (ArrayAccessEvent) ae;
        final ShadowThread currentThread = aae.getThread();
        final Object target = aae.getTarget();

        arrayErrors.error(
            currentThread,
            aae.getInfo(),
            "Alloc Site",
            ArrayAllocSiteTracker.allocSites.get(aae.getTarget()),
            "Guard State",
            aae.getOriginalShadow(),
            "Current Thread",
            toString(currentThread),
            "Array",
            Util.objectToIdentityString(target) + "[" + aae.getIndex() + "]",
            "Prev Op",
            prevOp + prevTid + ("name = " + ShadowThread.get(prevTid).getThread().getName()),
            "Cur Op",
            curOp + curTid + ("name = " + ShadowThread.get(curTid).getThread().getName()),
            "Case",
            "#" + errorCase,
            "Stack",
            ShadowThread.stackDumpForErrorMessage(currentThread));

        aae.getArrayState().specialize();

        if (!arrayErrors.stillLooking(aae.getInfo())) {
          advance(aae);
          return;
        }
      }
    } catch (Throwable e) {
      Assert.panic(e);
    }
  }