[Bug 224] New: BasicMDCAdapter.getCopyOfContextMap can lead to ConcurrentModificationException

http://bugzilla.slf4j.org/show_bug.cgi?id=224 Summary: BasicMDCAdapter.getCopyOfContextMap can lead to ConcurrentModificationException Product: SLF4J Version: 1.6.x Platform: PC OS/Version: Linux Status: NEW Severity: major Priority: P1 Component: Core API AssignedTo: slf4j-dev@qos.ch ReportedBy: alex.boisvert@gmail.com As illustrated by this stacktrace, java.util.ConcurrentModificationException at java.util.HashMap$HashIterator.nextEntry(HashMap.java:793) at java.util.HashMap$EntryIterator.next(HashMap.java:834) at java.util.HashMap$EntryIterator.next(HashMap.java:832) at java.util.HashMap.putAllForCreate(HashMap.java:435) at java.util.HashMap.<init>(HashMap.java:225) at org.slf4j.helpers.BasicMDCAdapter.getCopyOfContextMap(BasicMDCAdapter.java:130) at org.slf4j.MDC.getCopyOfContextMap(MDC.java:176) at com.bizo.logging.SmtpHandler.publish(SmtpHandler.java:65) at java.util.logging.Logger.log(Logger.java:458) at java.util.logging.Logger.doLog(Logger.java:480) at java.util.logging.Logger.log(Logger.java:503) at java.util.logging.Logger.info(Logger.java:1022) it appears that if BasicMDCAdapter.getCopyOfContextMap() is called while the parent thread is mutating the context, a ConcurrentModificationException can be thrown. -- Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug.

http://bugzilla.slf4j.org/show_bug.cgi?id=224 Gunnar Wagenknecht <gunnar@wagenknecht.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |gunnar@wagenknecht.org -- Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug.

http://bugzilla.slf4j.org/show_bug.cgi?id=224 art.home@gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |art.home@gmail.com --- Comment #1 from art.home@gmail.com 2011-07-07 17:40:37 CEST --- I have also experienced this, here's the [very similar] stack trace: java.util.ConcurrentModificationException at java.util.HashMap$HashIterator.nextEntry(Unknown Source) at java.util.HashMap$EntryIterator.next(Unknown Source) at java.util.HashMap$EntryIterator.next(Unknown Source) at java.util.HashMap.putAllForCreate(Unknown Source) at java.util.HashMap.<init>(Unknown Source) at org.slf4j.helpers.BasicMDCAdapter.getCopyOfContextMap(BasicMDCAdapter.java:130) at org.slf4j.MDC.getCopyOfContextMap(MDC.java:182) at org.apache.activemq.util.MDCHelper.getCopyOfContextMap(MDCHelper.java:30) at org.apache.activemq.broker.TransportConnection.stopAsync(TransportConnection.java:946) at org.apache.activemq.broker.TransportConnection.processShutdown(TransportConnection.java:353) at org.apache.activemq.command.ShutdownInfo.visit(ShutdownInfo.java:35) at org.apache.activemq.broker.TransportConnection.service(TransportConnection.java:306) at org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:179) at org.apache.activemq.transport.ResponseCorrelator.onCommand(ResponseCorrelator.java:116) at org.apache.activemq.transport.TransportFilter.onCommand(TransportFilter.java:69) at org.apache.activemq.transport.vm.VMTransport.iterate(VMTransport.java:218) at org.apache.activemq.thread.PooledTaskRunner.runTask(PooledTaskRunner.java:127) at org.apache.activemq.thread.PooledTaskRunner$1.run(PooledTaskRunner.java:48) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) -- Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug.
participants (1)
-
bugzilla-daemon@pixie.qos.ch