You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by bu...@apache.org on 2007/01/02 08:30:11 UTC

DO NOT REPLY [Bug 41274] New: - Deadlock using log4j

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41274>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41274

           Summary: Deadlock using log4j
           Product: Log4j
           Version: 1.2
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: major
          Priority: P1
         Component: Appender
        AssignedTo: log4j-dev@logging.apache.org
        ReportedBy: ravitx12@yahoo.com
                CC: ravitx12@yahoo.com


I'm getting a dead lock as follows, wondering if this is a known issue or if a
fix is available in a later release.

Please let me know if you need more information.

Found one Java-level deadlock:
=============================
"SW_WORKER.12":
  waiting to lock monitor 0x08777644 (object 0xce2f6478, a
org.apache.log4j.spi.RootLogger),
  which is held by "SW_WORKER.13"
"SW_WORKER.13":
  waiting to lock monitor 0x08777604 (object 0xce3ac200, a
com.aol.jwal.sapi.KSLog$Appender),
  which is held by "SW_WORKER.12"

Java stack information for the threads listed above:
===================================================
"SW_WORKER.12":
    at org.apache.log4j.Category.callAppenders(Category.java:193)
    - waiting to lock <0xce2f6478> (a org.apache.log4j.spi.RootLogger)
    at org.apache.log4j.Category.forcedLog(Category.java:379)
    at org.apache.log4j.Category.debug(Category.java:248)
    at com.aol.jwal.sapi.PreemptorPipe.Preempt(PreemptorPipe.java:69)
    at com.aol.jwal.sapi.NTKRunFIFO.schedule(NTKRunFIFO.java:158)
    at com.aol.jwal.sapi.KSLog$Appender$Writer.done(KSLog.java:357)
    at com.aol.jwal.sapi.KSLog$Appender.append(KSLog.java:292)
    at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:221)
    - locked <0xce3ac200> (a com.aol.jwal.sapi.KSLog$Appender)
    at
org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:57)
    at org.apache.log4j.Category.callAppenders(Category.java:194)
    - locked <0xce399418> (a org.apache.log4j.Logger)
    at org.apache.log4j.Category.forcedLog(Category.java:379)
    at org.apache.log4j.Category.debug(Category.java:248)
    at com.aol.jdb.somldb.SomlDbToJdbc.handleInt(SomlDbToJdbc.java:220)
    at com.aol.jdb.somldb.SomlDbToJdbc.fillArguments(SomlDbToJdbc.java:87)
    at com.aol.jdb.source.SomlDbSpSource.fillArguments(SomlDbSpSource.java:79)
    at com.aol.jdb.source.SomlDbSourceBase.processRequest(SomlDbSourceBase.java:110)
    at com.aol.jdb.source.SomlDbSourceBase.perform(SomlDbSourceBase.java:81)
    at com.aol.jdb.service.JdbServiceBase.processRequest(JdbServiceBase.java:70)
    at
com.aol.jdb.somldb.SomlDbRequestProcessor.processRequest(SomlDbRequestProcessor.java:38)
    at com.aol.jdb.somldb.SomldbJdbRequest.process(SomldbJdbRequest.java:49)
    at com.aol.jdb.engine.Worker.run(Worker.java:106)
"SW_WORKER.13":
    at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:201)
    - waiting to lock <0xce3ac200> (a com.aol.jwal.sapi.KSLog$Appender)
    at
org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:57)
    at org.apache.log4j.Category.callAppenders(Category.java:194)
    - locked <0xce2f6478> (a org.apache.log4j.spi.RootLogger)
    at org.apache.log4j.Category.forcedLog(Category.java:379)
    at org.apache.log4j.Category.debug(Category.java:248)
    at com.aol.jwal.sapi.PreemptorPipe.Preempt(PreemptorPipe.java:69)
    at com.aol.jwal.sapi.NTKRunFIFO.schedule(NTKRunFIFO.java:158)
    at
com.aol.jwal.sapi.channels.QMIChannelBase$MessageSender.sendASAP(QMIChannelBase.java:138)
    at com.aol.jwal.sapi.channels.QMIChannel.sendMessage(QMIChannel.java:43)
    at com.aol.jdb.somldb.ResultDispatcher.sendOverQMI(ResultDispatcher.java:151)
    at com.aol.jdb.somldb.ResultDispatcher.dispatch(ResultDispatcher.java:134)
    at com.aol.jdb.somldb.SomlDbResponse.dispatch(SomlDbResponse.java:267)
    at com.aol.jdb.source.SomlDbSourceBase.processRequest(SomlDbSourceBase.java:170)
    at com.aol.jdb.source.SomlDbSourceBase.perform(SomlDbSourceBase.java:81)
    at com.aol.jdb.service.JdbServiceBase.processRequest(JdbServiceBase.java:70)
    at
com.aol.jdb.somldb.SomlDbRequestProcessor.processRequest(SomlDbRequestProcessor.java:38)
    at com.aol.jdb.somldb.SomldbJdbRequest.process(SomldbJdbRequest.java:49)
    at com.aol.jdb.engine.Worker.run(Worker.java:106)

Found 1 deadlock.

Thanks
Ravi

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


DO NOT REPLY [Bug 41274] - Deadlock using log4j

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41274>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41274


carnold@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |DUPLICATE




------- Additional Comments From carnold@apache.org  2007-08-22 19:44 -------


*** This bug has been marked as a duplicate of 24159 ***

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


DO NOT REPLY [Bug 41274] - Deadlock using log4j

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41274>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41274





------- Additional Comments From ravitx12@yahoo.com  2007-01-01 23:39 -------
Note, the KSLog$Appender looks as below :

public final class KSLog
{
..
static public final class Appender extends AppenderSkeleton;
..
}

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


DO NOT REPLY [Bug 41274] - Deadlock using log4j

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41274>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41274





------- Additional Comments From bayard@apache.org  2007-01-25 17:34 -------
This looks remarkably similar to
http://issues.apache.org/bugzilla/show_bug.cgi?id=41214.

Which particular version of log4j are you running against? If the line numbers
below correspond with the File object usage in 41214, then I think this can be
resolved a dupe.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


DO NOT REPLY [Bug 41274] - Deadlock using log4j

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41274>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41274





------- Additional Comments From ravitx12@yahoo.com  2007-01-25 20:12 -------
This is definitely not a duplicate of 41214. This is a classic deadlock issue. 
I tried even with the latest version of log4j and noticed the same behavior.

The main problem is, we are calling log4j within the appender itself after 
log4j calls the appender. A fix for this got to be expensive as you need to 
lock all appenders for a logger when that logger is logging. Or you should 
atleast publish a guideline stating log4j should not be called from the 
appenders.

Thanks for looking into this.

Ravi

(In reply to comment #2)
> This looks remarkably similar to
> http://issues.apache.org/bugzilla/show_bug.cgi?id=41214.
> Which particular version of log4j are you running against? If the line 
numbers
> below correspond with the File object usage in 41214, then I think this can 
be
> resolved a dupe.



-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


DO NOT REPLY [Bug 41274] - Deadlock using log4j

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41274>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41274


genman@noderunner.net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED




------- Additional Comments From genman@noderunner.net  2007-01-26 17:58 -------

I'm guessing a dupe of 24159.

Can you attempt to use the concurrent appender classes?  These are in the
subversion repository.

This may require refactoring your KSLog class, assuming it is yours.
Unfortunately, AppenderSkeleton cannot be fixed without breaking compatibility.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org