From attila.lendvai at gmail.com Wed Dec 14 09:54:03 2011 From: attila.lendvai at gmail.com (Attila Lendvai) Date: Wed, 14 Dec 2011 15:54:03 +0600 Subject: [closer-devel] an interesting contextl backtrace Message-ID: Pascal, take a look at this interesting backtrace (i've cut the irrelevant parts)! this is triggered on sbcl and contextl head, running a threaded web-server. the request came from baudispider, which has a habit of bombing the server with parallel requests. a quick glance at the contextl code suggests that it's a race condition, because the code seems to protect itself from the unboundness of the slot... any thoughts? shall we send it to sbcl-devel instead? -- ?attila Notice the erosion of your (digital) freedom, and do something about it! PGP: 2FA1 A9DC 9C1E BA25 A59C ?963F 5D5F 45C7 DFCD 0A39 OTR XMPP: 8647EEAC EA30FEEF E1B55146 573E52EE 21B1FF06 *** At: 2011-12-13T15:35:40.427419+01:00 *** Message: HANDLE-TOPLEVEL-ERROR :before is now dealing with this error *** In thread: http worker 1 / serving request 9 / HANDLE-LEVEL-1-ERROR / HANDLE-TOPLEVEL-ERROR *** Error of type UNBOUND-SLOT: The slot CONTEXTL::OLD-SLOT-DEFINITIONS is unbound in the object #. *** Backtrace: ?18: (SB-PCL::SLOT-UNBOUND-INTERNAL # 19) ?19: (FINALIZE-INHERITANCE #) ?20: ((SB-PCL::EMF FINALIZE-INHERITANCE) # # #) ?21: (SB-PCL::CPL-OR-NIL #) ?22: (SB-PCL::CLASS-APPLICABLE-USING-CLASS-P # #) ?23: ((LABELS SB-PCL::DO-METHODS :IN SB-PCL::GENERATE-DISCRIMINATION-NET-INTERNAL) (0) (#) (CLASS #) (#) ((1 CLASS #))) ?24: ((LABELS SB-PCL::DO-METHODS :IN SB-PCL::GENERATE-DISCRIMINATION-NET-INTERNAL) (0) (# #) T NIL ((1 CLASS #))) ?25: ((LABELS SB-PCL::DO-METHODS :IN SB-PCL::GENERATE-DISCRIMINATION-NET-INTERNAL) (1 0) (# #) T NIL NIL) ?26: (SB-PCL::DISPATCH-DFUN-COST # 60) ?27: (SB-PCL::USE-DISPATCH-DFUN-P # NIL) ?28: (SB-PCL::MAKE-CHECKING-DFUN # #S(SB-PCL::FAST-METHOD-CALL :FUNCTION # :PV NIL :NEXT-METHOD-CALL NIL :ARG-INFO (2)) NIL) ?29: (SB-PCL::INITIAL-DFUN # (# #)) ?30: ((LABELS HU.DWIM.PRESENTATION::WITH-RENDER-STYLE/COMPONENT-BODY :IN HU.DWIM.PRESENTATION::=LAYERED-FUNCTION-DEFINER-FOR-RENDER-COMPONENT=)) From pc at p-cos.net Fri Dec 16 20:47:49 2011 From: pc at p-cos.net (Pascal Costanza) Date: Fri, 16 Dec 2011 21:47:49 +0100 Subject: [closer-devel] an interesting contextl backtrace In-Reply-To: References: Message-ID: <932D52F0-E798-4FD6-BAD6-D9D125BB9D62@p-cos.net> Hi Attila, This indeed smells like a race condition, probably caused by a class being redefined in several threads at the same time. I'm not sure if we can declare this a responsibility of the CLOS implementation or not. I see a potential workaround for this, but I would need to invest a bit of time to figure this out. (My idea is to merge the slots that need to be checked if there are already some slots recorded in compute-slots, and check them all in a single execution of finalize-inheritance, which I think should be doable with a portable locking scheme.) I will probably not be able to do this before the end of the year, though. A temporary workaround may to define a lock per special-class metaobject, grab the lock at the beginning of compute-slots, and release it at the end of finalize-inheritance. (I don't believe this would be portable, and I'm not sure it eliminates all possible race conditions?) Sorry if I cannot be of any more immediate help? Pascal On 14 Dec 2011, at 10:54, Attila Lendvai wrote: > Pascal, > > take a look at this interesting backtrace (i've cut the irrelevant parts)! > > this is triggered on sbcl and contextl head, running a threaded > web-server. the request came from baudispider, which has a habit of > bombing the server with parallel requests. > > a quick glance at the contextl code suggests that it's a race > condition, because the code seems to protect itself from the > unboundness of the slot... > > any thoughts? shall we send it to sbcl-devel instead? > > -- > attila > > Notice the erosion of your (digital) freedom, and do something about it! > > PGP: 2FA1 A9DC 9C1E BA25 A59C 963F 5D5F 45C7 DFCD 0A39 > OTR XMPP: 8647EEAC EA30FEEF E1B55146 573E52EE 21B1FF06 > > > > > *** At: 2011-12-13T15:35:40.427419+01:00 > *** Message: > HANDLE-TOPLEVEL-ERROR :before is now dealing with this error > *** In thread: http worker 1 / serving request 9 / > HANDLE-LEVEL-1-ERROR / HANDLE-TOPLEVEL-ERROR > *** Error of type UNBOUND-SLOT: > The slot CONTEXTL::OLD-SLOT-DEFINITIONS is unbound in the object > #. > *** Backtrace: > 18: (SB-PCL::SLOT-UNBOUND-INTERNAL # {1001A92ED3}> 19) > 19: (FINALIZE-INHERITANCE #) > 20: ((SB-PCL::EMF FINALIZE-INHERITANCE) # > # # {1001A92ED3}>) > 21: (SB-PCL::CPL-OR-NIL #) > 22: (SB-PCL::CLASS-APPLICABLE-USING-CLASS-P # XHTML-LAYER {1001A92ED3}> # {1001A92ED3}>) > 23: ((LABELS SB-PCL::DO-METHODS :IN > SB-PCL::GENERATE-DISCRIMINATION-NET-INTERNAL) (0) (# RENDER-COMPONENT-STUB # NIL # {1008D8B0F3}>) (CLASS > #) (# RENDER-COMPONENT-STUB # # # {1008D8AD53}>) ((1 CLASS #))) > 24: ((LABELS SB-PCL::DO-METHODS :IN > SB-PCL::GENERATE-DISCRIMINATION-NET-INTERNAL) (0) (# RENDER-COMPONENT-STUB #1=# # # {1008D8AD53}> # RENDER-COMPONENT-STUB #1# NIL # {1008D8B0F3}>) T NIL ((1 CLASS #))) > 25: ((LABELS SB-PCL::DO-METHODS :IN > SB-PCL::GENERATE-DISCRIMINATION-NET-INTERNAL) (1 0) (# RENDER-COMPONENT-STUB #1=# # # {1008D8AD53}> # RENDER-COMPONENT-STUB #1# NIL # {1008D8B0F3}>) T NIL NIL) > 26: (SB-PCL::DISPATCH-DFUN-COST # RENDER-COMPONENT-STUB {10036FEDAB}> 60) > 27: (SB-PCL::USE-DISPATCH-DFUN-P # RENDER-COMPONENT-STUB {10036FEDAB}> NIL) > 28: (SB-PCL::MAKE-CHECKING-DFUN # RENDER-COMPONENT-STUB {10036FEDAB}> #S(SB-PCL::FAST-METHOD-CALL > :FUNCTION # :PV NIL :NEXT-METHOD-CALL NIL > :ARG-INFO (2)) NIL) > 29: (SB-PCL::INITIAL-DFUN # {10036FEDAB}> (# # :MENU-ITEMS #>)) > 30: ((LABELS HU.DWIM.PRESENTATION::WITH-RENDER-STYLE/COMPONENT-BODY > :IN HU.DWIM.PRESENTATION::=LAYERED-FUNCTION-DEFINER-FOR-RENDER-COMPONENT=)) > > _______________________________________________ > closer-devel mailing list > closer-devel at common-lisp.net > http://lists.common-lisp.net/cgi-bin/mailman/listinfo/closer-devel -- Pascal Costanza The views expressed in this email are my own, and not those of my employer.