Warning: Can't synchronize with repository "(default)" (/home/git/ome.git does not appear to be a Git repository.). Look in the Trac log for more information.
Notice: In order to edit this ticket you need to be either: a Product Owner, The owner or the reporter of the ticket, or, in case of a Task not yet assigned, a team_member"

Task #11484 (closed)

Opened 11 years ago

Closed 11 years ago

Last modified 10 years ago

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)

omero-insight.log (193.0 KB) - added by jamoore 11 years ago.

Download all attachments as: .zip

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

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):

./build.py clean build
...
cd components/insight/build/
ant -Dtest.suite.include=**/shoola/util/ui/TestUIUtilities.java test
...
Last edited 11 years ago by cxallan (previous) (diff)

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.

Last edited 11 years ago by shart-x (previous) (diff)

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.

Last edited 11 years ago by shart-x (previous) (diff)

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)

Note: See TracTickets for help on using tickets. You may also have a look at Agilo extensions to the ticket.

1.3.13-PRO © 2008-2011 Agilo Software all rights reserved (this page was served in: 0.66352 sec.)

We're Hiring!