Task #11484 (closed)
Bug: StackOverflow on findDecimal(negative)
Reported by: | jamoore | Owned by: | shart-x |
---|---|---|---|
Priority: | critical | Milestone: | OMERO-4.4.9 |
Component: | Insight | Version: | 4.4.8 |
Keywords: | n.a. | Cc: | jburel, cxallan, sam@… |
Resources: | n.a. | Referenced By: | n.a. |
References: | n.a. | Remaining Time: | 0.0d |
Sprint: | n.a. |
Description (last modified by cxallan)
Log (attached) shows a stack overflow
at org.openmicroscopy.shoola.util.ui.UIUtilities.findDecimal(UIUtilities.java:1549)
Reproducible with:
public static void main(String[] args) { findDecimal(-1.1, 2); }
Likely n - Math.floor(n) or similar would suffice along with a call to round().
For possible inclusion in 4.4.9.
Attachments (1)
Change History (10)
Changed 11 years ago by jamoore
comment:1 Changed 11 years ago by cxallan
- Cc cxallan added
- Description modified (diff)
comment:2 Changed 11 years ago by cxallan
- Owner changed from mtbcarroll to shart-x
comment:3 Changed 11 years ago by cxallan
comment:4 Changed 11 years ago by shart-x
- Cc sam@… added
- Status changed from new to accepted
Patch which fixes this can be found criswell/openmicroscopy:11484-stackoverflow (GitHub). Yields success when running the test Chris detailed above.
Used Math.abs(..) as opposed to Math.Floor(..), comments welcome.
comment:5 Changed 11 years ago by shart-x
- Resolution set to fixed
- Status changed from accepted to closed
PR which includes this fix can be found on GitHub here.
comment:6 Changed 11 years ago by Jean-Marie Burel <j.burel@…>
(In [8a463d09181d670d90332085fc1f40c16f4578f3/ome.git] on branch develop) Test case for StackOverflow? in UIUtilities.findDecimal() (See #11484)
comment:7 Changed 11 years ago by Josh Moore <josh@…>
- Remaining Time set to 0
(In [4625d1b2cfa97f95395f800dc731297d2b56305a/ome.git] on branch develop) Merge pull request #1580 from jburel/rebased/develop/11484-stackoverflow
Handle negative numbers in UIUtilities.findDecimal() (Fixes #11484) (rebased onto develop)
comment:8 Changed 10 years ago by Chris Allan <callan@…>
(In [d7d618ce654ef362d3337714ba1333f3a21ee83c/ome.git]on branches master, dev_4_4) Test case for StackOverflow? in UIUtilities.findDecimal() (See #11484)
comment:9 Changed 10 years ago by jean-marie burel <j.burel@…>
(In [4350f4c445688062afeb571af212b408759daf28/ome.git]on branches master, dev_4_4) Merge pull request #1571 from chris-allan/11484-stackoverflow
Handle negative numbers in UIUtilities.findDecimal() (Fixes #11484)
Original bug that we were attempting to fix is #3485.
Test case now present on chris-allan/openmicroscopy:11484-stackoverflow (GitHub).
To run just this test case (from the root of your openmicroscopy/openmicroscopy checkout):