jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • JRuby
  • JRUBY-1770

weakref-based singleton class "attached" can blow up in certain unusual circumstances

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: JRuby 1.1
  • Component/s: Core Classes/Modules
  • Labels:
    None

Description

Because the "attached" reference in a singleton class is now a weakref, we can occasionally run into cases where the singleton class exists but the object to which it is attached does not. This could cause problems if, for example, the singleton class is in use (perhaps in the middle of adding methods) at a point in time when the original object gets GCed. We need a better answer for when the attached object goes away but the singleton class is still alive, rather than waiting for NPEs to show up at some point in the future.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Charles Oliver Nutter added a comment - 15/Feb/08 12:58 PM

Punting issues from 1.1 RC2 to 1.1 final.

Show
Charles Oliver Nutter added a comment - 15/Feb/08 12:58 PM Punting issues from 1.1 RC2 to 1.1 final.
Hide
Permalink
Charles Oliver Nutter added a comment - 17/Mar/08 12:22 PM

I committed a fix in r6243 to make the "attached" reference a SoftReference...that should reduce the likelihood of this bug to nearly never. But it's not never, so just punting this to post 1.1 for additional examination.

Show
Charles Oliver Nutter added a comment - 17/Mar/08 12:22 PM I committed a fix in r6243 to make the "attached" reference a SoftReference...that should reduce the likelihood of this bug to nearly never. But it's not never, so just punting this to post 1.1 for additional examination.
Hide
Permalink
Charles Oliver Nutter added a comment - 04/Feb/09 1:45 AM

I'm satisfied this is unlikely enough to happen we can resolve the bug retroactively. Because it would require that the original object of the singleton class be dereferenced AND the softref collection fire at that time AND the original softref be dereferenced long enough to be reclaimed AND code still be executing against the singleton class without first referencing the original object...the probability is extremely low.

Show
Charles Oliver Nutter added a comment - 04/Feb/09 1:45 AM I'm satisfied this is unlikely enough to happen we can resolve the bug retroactively. Because it would require that the original object of the singleton class be dereferenced AND the softref collection fire at that time AND the original softref be dereferenced long enough to be reclaimed AND code still be executing against the singleton class without first referencing the original object...the probability is extremely low.

People

  • Assignee:
    Charles Oliver Nutter
    Reporter:
    Charles Oliver Nutter
Vote (0)
Watch (1)

Dates

  • Created:
    22/Dec/07 3:02 PM
    Updated:
    21/Mar/09 1:14 PM
    Resolved:
    04/Feb/09 1:45 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.