Bugs item #825766, was opened at 2003-10-17 15:32
Message generated for change (Comment added) made by genman
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=825766&group_id=22866

Category: JBossServer
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Elias Ross (genman)
Assigned to: Scott M Stark (starksm)
Summary: Deadlock when logging trace

Initial Comment:


This was caused when trace was enabled.  I imagine it
was caused by the classloader trying to load a class
while it was being rendered (?) to disk.  Probably not
a big issue, unless trace-logging is enabled.

Java stack information for the threads listed above:
===================================================
"SMPP-TIMER-0":
        at
com.logica.smpp.util.ByteBuffer.getHexDump(ByteBuffer.java:379)
        at
com.logica.smpp.util.ByteBuffer.toString(ByteBuffer.java:387)
        at
org.apache.log4j.or.DefaultRenderer.doRender(DefaultRenderer.java:26)
        at
org.apache.log4j.or.RendererMap.findAndRender(RendererMap.java:70)
        at
org.apache.log4j.spi.LoggingEvent.getRenderedMessage(LoggingEvent.java:288)
        at
org.apache.log4j.helpers.PatternParser$BasicPatternConverter.convert(PatternParser.java:395)
        at
org.apache.log4j.helpers.PatternConverter.format(PatternConverter.java:56)
        at
org.apache.log4j.PatternLayout.format(PatternLayout.java:495)
        at
org.apache.log4j.WriterAppender.subAppend(WriterAppender.java:292)
        at
org.apache.log4j.WriterAppender.append(WriterAppender.java:150)
        at
org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:221)
        - locked <0x473874c8> (a
org.apache.log4j.ConsoleAppender)
        at
org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:57)
        at
org.apache.log4j.Category.callAppenders(Category.java:187)
        - locked <0x46829180> (a
org.apache.log4j.spi.RootCategory)
        at
org.apache.log4j.Category.forcedLog(Category.java:372)
        at
org.apache.log4j.Category.debug(Category.java:241)
        at
com.logica.smpp.debug.Log4JDebug.write(Log4JDebug.java:79)
        at
com.logica.smpp.TCPIPConnection.send(TCPIPConnection.java:301)
        at
com.logica.smpp.Transmitter.send(Transmitter.java:81)
        at com.logica.smpp.Session.send(Session.java:983)
        at com.logica.smpp.Session.bind(Session.java:452)
        at 
...

"SMSC-Accept-16910":
        at
org.apache.log4j.Category.callAppenders(Category.java:185)
        - waiting to lock <0x46829180> (a
org.apache.log4j.spi.RootCategory)
        at
org.apache.log4j.Category.forcedLog(Category.java:372)
        at org.apache.log4j.Category.log(Category.java:864)
        at
org.jboss.logging.Log4jLoggerPlugin.trace(Log4jLoggerPlugin.java:96)
        at org.jboss.logging.Logger.trace(Logger.java:113)
        at
org.jboss.mx.loading.UnifiedClassLoader3.attempt(UnifiedClassLoader3.java:242)
        at
org.jboss.mx.loading.UnifiedClassLoader3.loadClass(UnifiedClassLoader3.java:126)
        - locked <0x472e2f38> (a
org.jboss.mx.loading.UnifiedClassLoader3)
        at
java.lang.ClassLoader.loadClass(ClassLoader.java:255)
        at
java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
        - locked <0x472e2f38> (a
org.jboss.mx.loading.UnifiedClassLoader3)
        at
com.proteusmobile.smsgw.server.ServerService.listen(ServerService.java:187)
        at
com.proteusmobile.smsgw.server.ServerService.access$3(ServerService.java:46)
        at
com.proteusmobile.smsgw.server.ServerService$Listener.run0(ServerService.java:163)
        at
com.proteusmobile.smsgw.server.ServerService$Listener.run(ServerService.java:154)
        at java.lang.Thread.run(Thread.java:536)

Found 1 deadlock.




----------------------------------------------------------------------

>Comment By: Elias Ross (genman)
Date: 2003-11-12 18:00

Message:
Logged In: YES 
user_id=556458


The deadlock can be triggered when set and get method is
synchronized and logging is done from two threads: one
calling set and toString calls get.

Here is the Log4J bug for this.  I haven't heard what is
going to be done to fix it, but Ceki knows it's an issue...

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24159

----------------------------------------------------------------------

Comment By: Elias Ross (genman)
Date: 2003-10-18 22:11

Message:
Logged In: YES 
user_id=556458


Here is the routine.  Line 379 is indicated.  Doesn't seem
likely that it's here.  I think this is not the issue,
unless the length turned negative and the loop went on for
infinity.  The StringBuffer constructor would have checked
that anyway.

    public String getHexDump()
    {
        StringBuffer sb = new StringBuffer(length * 2);
        for (int i=0; i<length; i++) {
  379        sb.append(Character.forDigit((buffer[i + offs]
>> 4) & 0x0f, 16));
            sb.append(Character.forDigit(buffer[i + offs] &
0x0f, 16));
        }
        return sb.toString();
    }

I didn't capture all the stack traces.

I wonder what would happen if the classloader was trying to
load a class required by one thread to render a debug
statement, while the classloader itself was holding the
logger lock.  Maybe that doesn't make a whole lot of sense.

If I can't repro the problem and give you the data you need,
you might as well close the bug.


----------------------------------------------------------------------

Comment By: Scott M Stark (starksm)
Date: 2003-10-18 07:26

Message:
Logged In: YES 
user_id=175228

This is not deadlock on a class loader. Its deadlock on the
0x46829180 org.apache.log4j.spi.RootCategory. What is the
com.logica.smpp.util.ByteBuffer.getHexDump(ByteBuffer.java:379)
call doing that it cannot proceed to release the logger?
Also, attach the full stack traces and deadlock traces as a
txt file attachment.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=825766&group_id=22866


-------------------------------------------------------
This SF.Net email sponsored by: ApacheCon 2003,
16-19 November in Las Vegas. Learn firsthand the latest
developments in Apache, PHP, Perl, XML, Java, MySQL,
WebDAV, and more! http://www.apachecon.com/
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to