java.lang.AssertionError: p : 0.0 > 0 (?)

JDK Bug System | Webbug Group | 3 months ago
  1. 0

    FULL PRODUCT VERSION : Java(TM) SE Runtime Environment 1.8.0_101-b13 Oracle Corporation Java HotSpot(TM) 64-Bit Server VM 25.101-b13 FULL OS VERSION : OS: Windows 10 10.0 amd64 Java(TM) SE Runtime Environment 1.8.0_101-b13 Oracle Corporation Java HotSpot(TM) 64-Bit Server VM 25.101-b13 A DESCRIPTION OF THE PROBLEM : Once TieredCompilation is ongoing, it will change primitive autoboxing value on method call occasionally and it causes the application computation error on Windows x64. THE PROBLEM WAS REPRODUCIBLE WITH -Xint FLAG: No THE PROBLEM WAS REPRODUCIBLE WITH -server FLAG: Yes REGRESSION. Last worked in version 8u101 STEPS TO FOLLOW TO REPRODUCE THE PROBLEM : if (tktLeft > 0D) { // CALL OBJECT SETTER WHEN GREATER THAN assert (tktLeft > 0) : "(tktLeft >0) ? " + tktLeft; double w = tktLeft; double p = tktLeft; askrec.setW(w); askrec.setP(p); askrec.setD(System.currentTimeMillis()); } EXPECTED VERSUS ACTUAL BEHAVIOR : p <=0 Exception in thread "main" java.lang.AssertionError: p : 0.0 > 0 (?) at my.own.AskRecord.setP(AskRecord.java:81) at my.trade.TM1.case8(TM1.java:102) at my.trade.TM1.mainTest(TM1.java:127) at my.trade.TM1.main(TM1.java:144) ERROR MESSAGES/STACK TRACES THAT OCCUR : Exception in thread "main" java.lang.AssertionError: p : 0.0 > 0 (?) REPRODUCIBILITY : This bug can be reproduced often. ---------- BEGIN SOURCE ---------- package my.own; public class AskRecord { //implements java.io.Serializable { //private static final long serialVersionUID = 2429769253245743208L; private Long b; private Double w; private Double p; private Double amt; private Double lw; private Double lp; private Long dateA; /* private Integer r; private Integer h; public Long lvl; private Integer lv; private String u; private String cr; private String rt; private String rd; private String rto; private String rrt; private Double sw; private Double sp; private Integer pt; private String ort; private Integer lct; private String ip; private String pts; private String ptx; private Double tm_5; private Double tm_10; private Double tm_15; private Double tm_20; private Double tm_25; private Double tm_30; private Double tm_60; private Double tm_9999; */ public AskRecord(Long bid, int a, int b, double c, double d, double e, double f, double g, String h, String i, String j, String k, double l, double m, Long n, int o) { super(); this.b = bid; this.w = c; this.p = d; this.amt = e; this.lw = f; this.lp = g; } public Long getB() { return b; } public double getW() { return w; } public void setW(Double w) { this.w = w; } public double getP() { return p; } public void setP(Double p) { if (p <= 0){ System.out.println("p <=0 "); } assert p > 0 : "p : " + p + " > 0 (?) "; this.p = p; } public double getA() { return amt; } public double getLW() { return lw; } public double getLP() { return lp; } public Long getD() { return dateA; } public void setD(Long dateA) { this.dateA = dateA; } public String toString() { return String.format("AskRecord [b=%s, w=%s, p=%s, amt=%s, lw=%s, lp=%s, dateA=%s]", b, w, p, amt, lw, lp, dateA); } } package my.own; public class BidRecord { public BidRecord() { // TODO Auto-generated constructor stub } } package my.trade; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.logging.Logger; import my.own.BidRecord; public class BEngine { private static Logger logger = Logger.getLogger(BEngine.class.toString()); private BEngine() { init(); } public static BEngine getInstance() { return new BEngine(); } public Map<Long, BidRecord> getCache() { return null; } public void init() { } public List<Entry<Long, BidRecord>> matchObjectQuery( double a, double b, double c, int d) { return new ArrayList<Entry<Long, BidRecord>>(); } public double trade(double a, double b, double c, final double d) { long t0 = System.nanoTime(); List<Entry<Long, BidRecord>> rl = matchObjectQuery(a, b, c, (int) d); long t1 = System.nanoTime(); double ta = d; if (rl.size() > 0) { } return ta; } } package my.trade; import java.util.Random; import java.util.concurrent.atomic.AtomicLong; import java.util.logging.Level; import java.util.logging.Logger; import my.own.AskRecord; /* * * */ public class TM1 { final public static int BID_COUNT = 10_000_000; public static Logger logger = Logger.getLogger(TM1.class.toString()); private AtomicLong bqn = new AtomicLong(); private BEngine bideng = BEngine.getInstance(); final public static double[] AMOUNT_SEGMENT= { 3.8, 3.81, 3.82, 3.83, 3.84,3.85, 3.86, 3.87, 3.88, 3.89, 3.9, 3.95, 4.0, 4.05, 4.1, 4.15, 4.2, 4.25, 4.3, 4.35, 4.4, 4.45, 4.5, 4.55, 4.6, 4.65, 4.7, 4.75, 4.8, 4.85, 4.9, 4.95, 5.0, 5.05, 5.1 }; final public static int AMOUNT_SEG_SIZE = AMOUNT_SEGMENT.length; public AskRecord genAR(int a, int b, double c, double d, double f, double g, double h, String i, String j, String k, String l, double m, double n, long o, int p) { return new AskRecord(bqn.getAndIncrement(), a, b, c, d, f, g, h, i, j, k, l, m, n, o, p); } private void case8() { final int len = BID_COUNT; long min = Long.MAX_VALUE; long max = Long.MIN_VALUE; Random random = new Random(); long tm0 = 0; long tm1 = 0; AskRecord[] aArr = new AskRecord[len]; int aIx = 0; for (long i = 0; i < BID_COUNT; i++) { // LOOP FOR 1000_000 TIMES int rc = 1; int hr = 1; double w, p; w = 1 + random.nextInt(5); p = w; double am = AMOUNT_SEGMENT[random.nextInt(AMOUNT_SEG_SIZE)]; double lw = 10 + random.nextInt(30) * 10; double lp = Math.max(5, random.nextInt(10) * 10); lp = Math.min(lw, lp); String ua = "abcd" + String.valueOf(i % 100); String cr = "GSP"; String rt = "HH"; String rd = "2016-09-09"; double sw = 0; double sp = 0; long da = System.currentTimeMillis(); aArr[aIx++] = genAR(rc, hr, w, p, am, lw, lp, ua, cr, rt, rd, sw, sp, da, 0); } int aIx1 = 0; for (long i = 0; i < BID_COUNT; i++) { try { AskRecord askrec = aArr[aIx1++]; // TODO double w0 = askrec.getW(); double a0 = askrec.getA(); double p0 = askrec.getP(); double lw = askrec.getLW(); double lp = askrec.getLP(); tm0 = System.nanoTime(); final double tktLeft = bideng.trade(a0, lw, lp, w0); if (tktLeft > 0D) { // CALL OBJECT SETTER WHEN GREATER THAN assert (tktLeft > 0) : "(tktLeft >0) ? " + tktLeft; double w = tktLeft; double p = tktLeft; askrec.setW(w); askrec.setP(p); askrec.setD(System.currentTimeMillis()); } tm1 = System.nanoTime() - tm0; } finally { } if (tm1 != 0) { min = Math.min(tm1, min); max = Math.max(tm1, max); } } String minfo = String.format("Max: %,d ; Min: %,d", max, min); print(minfo); } public void mainTest() { try{ long t0 = System.nanoTime(); case8(); long t1 = System.nanoTime() - t0; print("end: taken : " + t1 / BID_COUNT + " ms."); } catch (Exception e) { e.printStackTrace(); logger.log(Level.WARNING, e.toString(), e); } } private static void print(String msg) { logger.info(msg); System.out.println(msg); } public static void main(String[] args) { TM1 tm = new TM1(); tm.mainTest(); } } ---------- END SOURCE ---------- CUSTOMER SUBMITTED WORKAROUND : -XX:-TieredCompilation

    JDK Bug System | 3 months ago | Webbug Group
    java.lang.AssertionError: p : 0.0 > 0 (?)
  2. 0

    JUnit launched with Java Library version of ANT: How to Output Longer Stack Trace?

    Stack Overflow | 2 years ago | Fido488
    java.lang.AssertionError: Jaguar PID {P:0.003 I:0.0015 D:0.0} Was not on Target. Controller Error: 2500.0
  3. 0

    Lucene - Java Developer - [JENKINS] Lucene-Solr-NightlyTests-trunk - Build # 751 - Failure

    nabble.com | 1 year ago
    java.lang.AssertionError: expected:<0.21697770059108734> but was:<0.0> at __randomizedtesting.SeedInfo.seed([216F1F3C38561BEF:89FA6BFD1F67BF87]:0)
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    [build:MPS-25.9213] java.lang.AssertionError : editor (jetbrains.mps.nodeEditor.NodeEditorComponent[,0,-60,783x1112,invalid,alignmentX=0.0,alignmentY=0.0,border=,flags=321,maximumSize=,minimumSize=,preferredSize=]) is invalid, myNode is disposed at jetbrains.mps.smodel.SModel.dispose(SModel.java:824) at jetbrains.mps.smodel.BaseSModelDescriptorWithSource$2.run(BaseSModelDescriptorWithSource.java:94) at jetbrains.mps.ide.smodel.WorkbenchModelAccess$10.compute(WorkbenchModelAccess.java:405) at jetbrains.mps.ide.smodel.WorkbenchModelAccess$10.compute(WorkbenchModelAccess.java:399) at jetbrains.mps.ide.smodel.WorkbenchModelAccess$TryWriteActionComputable$1.compute(WorkbenchModelAccess.java:879) at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:908) at jetbrains.mps.ide.smodel.WorkbenchModelAccess$TryWriteActionComputable.compute(WorkbenchModelAccess.java:876) at jetbrains.mps.ide.smodel.WorkbenchModelAccess.tryWrite(WorkbenchModelAccess.java:420) at jetbrains.mps.ide.smodel.EDTExecutor$2.tryRun(EDTExecutor.java:77) at jetbrains.mps.ide.smodel.EDTExecutor$Executor.worker(EDTExecutor.java:192) at jetbrains.mps.ide.smodel.EDTExecutor$Executor.access$300(EDTExecutor.java:129) at jetbrains.mps.ide.smodel.EDTExecutor$Executor$1.run(EDTExecutor.java:135) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:682) at java.awt.EventQueue.access$000(EventQueue.java:85) at java.awt.EventQueue$1.run(EventQueue.java:643) at java.awt.EventQueue$1.run(EventQueue.java:641) at java.security.AccessController.doPrivileged(Native Method) at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87) at java.awt.EventQueue.dispatchEvent(EventQueue.java:652) at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:699) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:538) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:420) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:378) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188) at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)____________________________: editor (jetbrains.mps.nodeEditor.NodeEditorComponent[,0,-60,783x1112,invalid,alignmentX=0.0,alignmentY=0.0,border=,flags=321,maximumSize=,minimumSize=,preferredSize=]) is invalid, myNode is disposed at jetbrains.mps.smodel.SModel.dispose(SModel.java:824) at jetbrains.mps.smodel.BaseSModelDescriptorWithSource$2.run(BaseSModelDescriptorWithSource.java:94) at jetbrains.mps.ide.smodel.WorkbenchModelAccess$10.compute(WorkbenchModelAccess.java:405) at jetbrains.mps.ide.smodel.WorkbenchModelAccess$10.compute(WorkbenchModelAccess.java:399) at jetbrains.mps.ide.smodel.WorkbenchModelAccess$TryWriteActionComputable$1.compute(WorkbenchModelAccess.java:879) at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:908) at jetbrains.mps.ide.smodel.WorkbenchModelAccess$TryWriteActionComputable.compute(WorkbenchModelAccess.java:876) at jetbrains.mps.ide.smodel.WorkbenchModelAccess.tryWrite(WorkbenchModelAccess.java:420) at jetbrains.mps.ide.smodel.EDTExecutor$2.tryRun(EDTExecutor.java:77) at jetbrains.mps.ide.smodel.EDTExecutor$Executor.worker(EDTExecutor.java:192) at jetbrains.mps.ide.smodel.EDTExecutor$Executor.access$300(EDTExecutor.java:129) at jetbrains.mps.ide.smodel.EDTExecutor$Executor$1.run(EDTExecutor.java:135) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:682) at java.awt.EventQueue.access$000(EventQueue.java:85) at java.awt.EventQueue$1.run(EventQueue.java:643) at java.awt.EventQueue$1.run(EventQueue.java:641) at java.security.AccessController.doPrivileged(Native Method) at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87) at java.awt.EventQueue.dispatchEvent(EventQueue.java:652) at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:699) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:538) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:420) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:378) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188) at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)____________________________

    YouTrack | 4 years ago
    java.lang.AssertionError: editor (jetbrains.mps.nodeEditor.NodeEditorComponent[,0,-60,783x1112,invalid,alignmentX=0.0,alignmentY=0.0,border=,flags=321,maximumSize=,minimumSize=,preferredSize=]) is invalid, myNode is disposed
  6. 0

    Build failed in Jenkins: POI-OpenJDK #104

    poi-dev | 1 year ago | Apache Jenkins Server
    java.lang.AssertionError: Expected to have column width > 0 BEFORE auto-size, but had 0.0

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.AssertionError

      p : 0.0 > 0 (?)

      at my.own.AskRecord.setP()
    2. my.own
      AskRecord.setP
      1. my.own.AskRecord.setP(AskRecord.java:81)
      1 frame
    3. my.trade
      TM1.main
      1. my.trade.TM1.case8(TM1.java:102)
      2. my.trade.TM1.mainTest(TM1.java:127)
      3. my.trade.TM1.main(TM1.java:144)
      3 frames