felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sahoo (JIRA)" <j...@apache.org>
Subject [jira] Updated: (FELIX-2791) NPE in getStartLevel due to race condition
Date Thu, 20 Jan 2011 06:35:10 GMT

     [ https://issues.apache.org/jira/browse/FELIX-2791?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

Sahoo updated FELIX-2791:

    Assignee: Sahoo
     Summary: NPE in getStartLevel due to race condition  (was: NPE in getStartLevel)

Assigning to myself

> NPE in getStartLevel due to race condition
> ------------------------------------------
>                 Key: FELIX-2791
>                 URL: https://issues.apache.org/jira/browse/FELIX-2791
>             Project: Felix
>          Issue Type: Bug
>          Components: File Install
>    Affects Versions: fileinstall-3.1.4
>            Reporter: Sahoo
>            Assignee: Sahoo
>            Priority: Blocker
>             Fix For: fileinstall-3.1.6
> We are using FileInstall 3.1.4 and one of our user is seeing the following exception
repeated in the directory watcher main loop continuously:
> java.lang.NullPointerException
>         at org.apache.felix.fileinstall.internal.FileInstall.getStartLevel(FileInstall.java:283)
>         at org.apache.felix.fileinstall.internal.FileInstall.getStartLevel(FileInstall.java:276)
>         at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:237)
> In main loop, we have serious trouble: java.lang.NullPointerException
> NPE comes from FileInstall.java:283, which looks like this:
>             return (StartLevel) startLevel.waitForService(timeout);
> It looks like a concurrency bug to me in FileInstall. The only explanation that I have
so far is that in the target environment, code is getting reordered and hence directory watcher
thread is spwaned before startLevel is initialzed.. Since startLevel is not declared volatile,
nor is it accessed from a synchronized block, DirectoryWatcher thread continues to see the
stale value.
> So, I suggest we change startLevel to a volatile field. Any comments?

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message