# Deadlock in borges sample apps

**URL:** <https://rubytalk.org/t/deadlock-in-borges-sample-apps/14994>\
**Category:** ruby-talk\
**Created:** [27 November 2004 00:06 UTC](https://rubytalk.org/t/deadlock-in-borges-sample-apps/14994 "2004-11-27T00:06:49Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lloyd\_Zusman](https://avatars.discourse-cdn.com/v4/letter/l/8baadc/32.png) [@Lloyd\_Zusman](https://rubytalk.org/u/Lloyd_Zusman)\
**Post date:** [27 November 2004 00:06 UTC](https://rubytalk.org/t/deadlock-in-borges-sample-apps/14994/1 "2004-11-27T00:06:49Z")

</div>

I have installed borges-1.1.0, and I'm using it with the following  
version of ruby:

&nbsp;&nbsp;% ruby --version  
&nbsp;&nbsp;ruby 1.9.0 (2004-08-03) [i386-freebsd4.0]

The first thing I did after installation was to run this test app, as  
described in the README file (note that I changed "1.8" to "1.9"):

&nbsp;&nbsp;ruby /usr/local/lib/ruby/site\_ruby/1.9/Borges/WEBrick.rb

I then went to my browser and entered the following URL, again as  
specified in the README file:

&nbsp;&nbsp;[http://localhost:7000/borges/counter](http://localhost:7000/borges/counter)

The following message came back to my web browser:

&nbsp;&nbsp;Internal Server Error  
&nbsp;&nbsp;deadlock; recursive locking  
&nbsp;&nbsp;WEBrick/1.3.1 (Ruby/1.9.0/2004-08-03) at localhost:7000

The borges process that I started printed the information at the bottom  
of this message.

Note that I got the same "recursive locking" deadlock with the sample  
SushiNet application.

Is borges-1.1.0 incompatible with ruby 1.9, perhaps?

Here's the output from borges:

&nbsp;&nbsp;[2004-11-26 18:55:06] INFO WEBrick 1.3.1  
&nbsp;&nbsp;[2004-11-26 18:55:06] INFO ruby 1.9.0 (2004-08-03) [i386-freebsd4.0]  
&nbsp;&nbsp;[2004-11-26 18:55:06] INFO WEBrick::HTTPServer#start: pid=35885 port=7000  
&nbsp;&nbsp;!!  
&nbsp;&nbsp;Exception in #\<Thread:0x81f5d48 run\>:  
&nbsp;&nbsp;deadlock; recursive locking  
&nbsp;&nbsp;/usr/local/lib/ruby/1.9/thread.rb:96:in `lock'  
&nbsp;&nbsp;/usr/local/lib/ruby/1.9/thread.rb:132:in `synchronize'  
&nbsp;&nbsp;/usr/local/lib/ruby/site\_ruby/1.9/Borges/RequestHandler/Session.rb:136:in `start\_handler\_thread'  
&nbsp;&nbsp;/usr/local/lib/ruby/site\_ruby/1.9/Borges/RequestHandler/Session.rb:135:in `loop'  
&nbsp;&nbsp;/usr/local/lib/ruby/site\_ruby/1.9/Borges/RequestHandler/Session.rb:135:in `start\_handler\_thread'  
&nbsp;&nbsp;/usr/local/lib/ruby/site\_ruby/1.9/Borges/RequestHandler/Session.rb:127:in `start'  
&nbsp;&nbsp;/usr/local/lib/ruby/site\_ruby/1.9/Borges/RequestHandler/Session.rb:127:in `start\_handler\_thread'  
&nbsp;&nbsp;/usr/local/lib/ruby/site\_ruby/1.9/Borges/RequestHandler/Session.rb:163:in `in\_thread'  
&nbsp;&nbsp;/usr/local/lib/ruby/site\_ruby/1.9/Borges/RequestHandler/Session.rb:92:in `enter\_session'  
&nbsp;&nbsp;/usr/local/lib/ruby/site\_ruby/1.9/Borges/RequestHandler/Session.rb:105:in `enter\_session\_with'  
&nbsp;&nbsp;/usr/local/lib/ruby/site\_ruby/1.9/Borges/RequestHandler/Application.rb:7:in `handle\_default\_request'  
&nbsp;&nbsp;/usr/local/lib/ruby/site\_ruby/1.9/Borges/RequestHandler/Registry.rb:37:in `handle\_request'  
&nbsp;&nbsp;/usr/local/lib/ruby/site\_ruby/1.9/Borges/RequestHandler/Dispatcher.rb:39:in `handle\_request'  
&nbsp;&nbsp;/usr/local/lib/ruby/site\_ruby/1.9/Borges/WEBrick.rb:35:in `do\_GET'  
&nbsp;&nbsp;/usr/local/lib/ruby/1.9/webrick/httpservlet/abstract.rb:35:in `\_\_send\_\_'  
&nbsp;&nbsp;/usr/local/lib/ruby/1.9/webrick/httpservlet/abstract.rb:35:in `service'  
&nbsp;&nbsp;/usr/local/lib/ruby/1.9/webrick/httpserver.rb:101:in `service'  
&nbsp;&nbsp;/usr/local/lib/ruby/1.9/webrick/httpserver.rb:62:in `run'  
&nbsp;&nbsp;/usr/local/lib/ruby/1.9/webrick/server.rb:153:in `start\_thread'  
&nbsp;&nbsp;/usr/local/lib/ruby/1.9/webrick/server.rb:147:in `start'  
&nbsp;&nbsp;/usr/local/lib/ruby/1.9/webrick/server.rb:147:in `start\_thread'  
&nbsp;&nbsp;/usr/local/lib/ruby/1.9/webrick/server.rb:97:in `start'  
&nbsp;&nbsp;/usr/local/lib/ruby/1.9/webrick/server.rb:89:in `each'  
&nbsp;&nbsp;/usr/local/lib/ruby/1.9/webrick/server.rb:89:in `start'  
&nbsp;&nbsp;/usr/local/lib/ruby/1.9/webrick/server.rb:79:in `start'  
&nbsp;&nbsp;/usr/local/lib/ruby/1.9/webrick/server.rb:79:in `start'  
&nbsp;&nbsp;/usr/local/lib/ruby/site\_ruby/1.9/Borges/WEBrick.rb:79:in `start'  
&nbsp;&nbsp;/usr/local/lib/ruby/site\_ruby/1.9/Borges/WEBrick.rb:85  
&nbsp;&nbsp;!!  
&nbsp;&nbsp;/usr/local/lib/ruby/1.9/thread.rb:96:in `lock'  
&nbsp;&nbsp;/usr/local/lib/ruby/site\_ruby/1.9/Borges/RequestHandler/Session.rb:171:in `in\_thread'  
&nbsp;&nbsp;/usr/local/lib/ruby/site\_ruby/1.9/Borges/RequestHandler/Session.rb:165:in `synchronize'  
&nbsp;&nbsp;/usr/local/lib/ruby/site\_ruby/1.9/Borges/RequestHandler/Session.rb:165:in `in\_thread'  
&nbsp;&nbsp;/usr/local/lib/ruby/site\_ruby/1.9/Borges/RequestHandler/Session.rb:92:in `enter\_session'  
&nbsp;&nbsp;/usr/local/lib/ruby/site\_ruby/1.9/Borges/RequestHandler/Session.rb:105:in `enter\_session\_with'  
&nbsp;&nbsp;/usr/local/lib/ruby/site\_ruby/1.9/Borges/RequestHandler/Application.rb:7:in `handle\_default\_request'  
&nbsp;&nbsp;/usr/local/lib/ruby/site\_ruby/1.9/Borges/RequestHandler/Registry.rb:37:in `handle\_request'  
&nbsp;&nbsp;/usr/local/lib/ruby/site\_ruby/1.9/Borges/RequestHandler/Dispatcher.rb:39:in `handle\_request'  
&nbsp;&nbsp;/usr/local/lib/ruby/site\_ruby/1.9/Borges/WEBrick.rb:35:in `do\_GET'  
&nbsp;&nbsp;/usr/local/lib/ruby/1.9/webrick/httpservlet/abstract.rb:35:in `\_\_send\_\_'  
&nbsp;&nbsp;/usr/local/lib/ruby/1.9/webrick/httpservlet/abstract.rb:35:in `service'  
&nbsp;&nbsp;/usr/local/lib/ruby/1.9/webrick/httpserver.rb:101:in `service'  
&nbsp;&nbsp;/usr/local/lib/ruby/1.9/webrick/httpserver.rb:62:in `run'  
&nbsp;&nbsp;/usr/local/lib/ruby/1.9/webrick/server.rb:153:in `start\_thread'  
&nbsp;&nbsp;/usr/local/lib/ruby/1.9/webrick/server.rb:147:in `start'  
&nbsp;&nbsp;/usr/local/lib/ruby/1.9/webrick/server.rb:147:in `start\_thread'  
&nbsp;&nbsp;/usr/local/lib/ruby/1.9/webrick/server.rb:97:in `start'  
&nbsp;&nbsp;/usr/local/lib/ruby/1.9/webrick/server.rb:89:in `each'  
&nbsp;&nbsp;/usr/local/lib/ruby/1.9/webrick/server.rb:89:in `start'  
&nbsp;&nbsp;/usr/local/lib/ruby/1.9/webrick/server.rb:79:in `start'  
&nbsp;&nbsp;/usr/local/lib/ruby/1.9/webrick/server.rb:79:in `start'  
&nbsp;&nbsp;/usr/local/lib/ruby/site\_ruby/1.9/Borges/WEBrick.rb:79:in `start'  
&nbsp;&nbsp;/usr/local/lib/ruby/site\_ruby/1.9/Borges/WEBrick.rb:85  
&nbsp;&nbsp;!!  
&nbsp;&nbsp;[2004-11-26 18:55:14] ERROR ThreadError: deadlock; recursive locking  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/lib/ruby/1.9/thread.rb:96:in `lock'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/lib/ruby/site\_ruby/1.9/Borges/RequestHandler/Session.rb:171:in `in\_thread'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/lib/ruby/site\_ruby/1.9/Borges/RequestHandler/Session.rb:165:in `synchronize'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/lib/ruby/site\_ruby/1.9/Borges/RequestHandler/Session.rb:165:in `in\_thread'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/lib/ruby/site\_ruby/1.9/Borges/RequestHandler/Session.rb:92:in `enter\_session'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/lib/ruby/site\_ruby/1.9/Borges/RequestHandler/Session.rb:105:in `enter\_session\_with'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/lib/ruby/site\_ruby/1.9/Borges/RequestHandler/Application.rb:7:in `handle\_default\_request'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/lib/ruby/site\_ruby/1.9/Borges/RequestHandler/Registry.rb:37:in `handle\_request'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/lib/ruby/site\_ruby/1.9/Borges/RequestHandler/Dispatcher.rb:39:in `handle\_request'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/lib/ruby/site\_ruby/1.9/Borges/WEBrick.rb:35:in `do\_GET'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/lib/ruby/1.9/webrick/httpservlet/abstract.rb:35:in `\_\_send\_\_'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/lib/ruby/1.9/webrick/httpservlet/abstract.rb:35:in `service'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/lib/ruby/1.9/webrick/httpserver.rb:101:in `service'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/lib/ruby/1.9/webrick/httpserver.rb:62:in `run'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/lib/ruby/1.9/webrick/server.rb:153:in `start\_thread'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/lib/ruby/1.9/webrick/server.rb:147:in `start'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/lib/ruby/1.9/webrick/server.rb:147:in `start\_thread'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/lib/ruby/1.9/webrick/server.rb:97:in `start'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/lib/ruby/1.9/webrick/server.rb:89:in `each'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/lib/ruby/1.9/webrick/server.rb:89:in `start'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/lib/ruby/1.9/webrick/server.rb:79:in `start'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/lib/ruby/1.9/webrick/server.rb:79:in `start'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/lib/ruby/site\_ruby/1.9/Borges/WEBrick.rb:79:in `start'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/lib/ruby/site\_ruby/1.9/Borges/WEBrick.rb:85  
&nbsp;&nbsp;  
&nbsp;&nbsp;[home.acholado.net](http://home.acholado.net) - - [26/Nov/2004:18:55:14 EST] "GET /borges/counter HTTP/1.1" 500 312  
&nbsp;&nbsp;- -\> /borges/counter  
&nbsp;&nbsp;[2004-11-26 18:55:14] ERROR `/favicon.ico' not found.  
&nbsp;&nbsp;[home.acholado.net](http://home.acholado.net) - - [26/Nov/2004:18:55:14 EST] "GET /favicon.ico HTTP/1.1" 404 286  
&nbsp;&nbsp;- -\> /favicon.ico

> **···**
>
> --  
> Lloyd Zusman  
> [ljz@asfast.com](mailto:ljz@asfast.com)  
> God bless you.

---

<div class="post-metadata">

**Author:** ![Kaspar\_Schiess](https://avatars.discourse-cdn.com/v4/letter/k/d78d45/32.png) [@Kaspar\_Schiess](https://rubytalk.org/u/Kaspar_Schiess)\
**Post date:** [29 November 2004 11:03 UTC](https://rubytalk.org/t/deadlock-in-borges-sample-apps/14994/2 "2004-11-29T11:03:11Z")

</div>

Lloyd Zusman \<ljz@asfast.com\> wrote in news:m3zn14dupf.fsf@asfast.com:

> Is borges-1.1.0 incompatible with ruby 1.9, perhaps?

Hello Lloyd,

Currently, the answer to that question is sadly YES. There is some code in  
Session.rb that is incompatible with Ruby 1.9, and frankly, also with my  
perception of how things should be done in 1.8. I have a private patched  
version that uses modern synchronisation elements instead of on the spot  
hacks, and that version should work with Ruby 1.9. I will attach that to  
this post (making it a public patch); I just did not think anyone would  
actually currently use Borges, that is why its not in CVS.

Tell me if this works for you, that might inspire me to actually check this  
in. Note that I use Borges frequently and still think that it kicks ass.

Best regards,  
kaspar

hand manufactured code - www.tua.ch/ruby

begin 644 Session.rb.gz  
M'XL(".G7CD``"U-E\<W-I;VXN\<F(`Q1G;CM0V]+T2_V!V5,B()46JU`\>T[\<YR  
M4;=J"VA95\*1EB3R.9\=,)DYM9Y8I\.\]OL5V+@/J2R7$),ZYWWS.65)A\*=$3  
M+FZH?/SX-962\1J=="\<7].^62G6.Z[\*BXLYW=[Y#:+&0[9)H1"K1S^CJVAZ;  
M$W1R@B2M5OH`H9*N$*O75#!%RVRC`\>;V2X\*8)FO]B.M2TO24L!55018CR^H  
M:D6=D(FP(R\*&!%&@5]&\*JEAQ41!\>\*U:W6!]F^L5)Y6CVH#=TGRUB%)E+Q07-  
M;@5N1FC-YU\_CKRE\*)5\*N1[-/"]PT%2.&5NZ!A75!L;8^R+1YCXV1\P:K]?S+  
M#[-/0.S+4\<)U-C/\_H[.R1`]6K%)4/$"\*([6FR+Y\*(]4.7KDPQ])Z/S\>(#Q]:  
M\_-^V346WM`8'`A"3Z!;OD=1TL`J$!$5+3#9*8`)PH(7@C6!8T6J?1U8HR\*B  
M9/;'&6#AZ.3:?,!\*H@\<05O;P\>FA+H\*)XH76/C+C0[QV!#(RYQ)(:J,Y`(WX)  
M]DY\L\>A]2)",Z2.`#)Z=%#8C#$!-;[NSG-5,5RQ?VAQRT#N@.$8NNA-^'0\*  
M3(J6)R!]9$8\*W\*IU4?+,\_"XK3C;'Z)[Y=\>R=.WRZ/]%89P`,1O0\0)'L7B`P  
M3RBD/#G?;+'8F+"E'QLF]HGH!#\*9$%1R])F0SUTAL)!)(H$1A\D%0661=QVN  
M)ETR08DR=BVV$,+XAA:LSNY?Z@AMX`VML42&"2WS^\?HQWE`)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\NBU^XL.\<KG\*EJQB  
M:C^ROY\NF?W+)$$;[J)2\_R0S]W"W,C\*M]OKA=\*4R9N$IWX\&RM3B?"1T(+O(  
ME.2C\<HS\_#\<LBR!HW^I\*S%4V\_R357@^WB8"W?E4#S=[+"(V;ZH1L6PPVV&[63  
+^\_D7[/K'#:(\<````  
`  
end

---

<div class="post-metadata">

**Author:** ![Lloyd\_Zusman](https://avatars.discourse-cdn.com/v4/letter/l/8baadc/32.png) [@Lloyd\_Zusman](https://rubytalk.org/u/Lloyd_Zusman)\
**Post date:** [29 November 2004 16:56 UTC](https://rubytalk.org/t/deadlock-in-borges-sample-apps/14994/3 "2004-11-29T16:56:48Z")

</div>

Kaspar Schiess \<eule@space.ch\> writes:

> Lloyd Zusman \<ljz@asfast.com\> wrote in news:m3zn14dupf.fsf@asfast.com:
> 
> > Is borges-1.1.0 incompatible with ruby 1.9, perhaps?
> 
> Hello Lloyd,
> 
> Currently, the answer to that question is sadly YES. There is some code in  
> Session.rb that is incompatible with Ruby 1.9, and frankly, also with my  
> perception of how things should be done in 1.8. I have a private patched  
> version that uses modern synchronisation elements instead of on the spot  
> hacks, and that version should work with Ruby 1.9. I will attach that to  
> this post (making it a public patch); I just did not think anyone would  
> actually currently use Borges, that is why its not in CVS.
> 
> Tell me if this works for you, that might inspire me to actually check this  
> in. Note that I use Borges frequently and still think that it kicks ass.

Thank you very much.

However, I'm sorry to report that the version of Session.rb that you  
sent is exactly the same version that got installed in

&nbsp;&nbsp;/usr/local/lib/ruby/site\_ruby/1.9/Borges/RequestHandler

I did the following:

&nbsp;&nbsp;- invoke this:

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;% cd /usr/local/lib/ruby/site\_ruby/1.9/Borges/RequestHandler

&nbsp;&nbsp;- copy Session.rb.gz from this message into that directory

&nbsp;&nbsp;- invoke this:

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;% mv Session.rb Session.rb.orig  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;% gunzip Session.rb.gz  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;% diff -b Session.rb.orig Session.rb  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;%

In other words, there was no output from the 'diff'. This means that  
aside from differences in white space, the Session.rb.gz that you  
attached, when uncompressed, is exactly the same as the version that got  
installed from the borges tarball.

Are you sure that you attached the correct version of Session.rb.gz to  
your message?

> **···**
>
> --  
> Lloyd Zusman  
> ljz@asfast.com  
> God bless you.

---

<div class="post-metadata">

**Author:** ![Kaspar\_Schiess](https://avatars.discourse-cdn.com/v4/letter/k/d78d45/32.png) [@Kaspar\_Schiess](https://rubytalk.org/u/Kaspar_Schiess)\
**Post date:** [29 November 2004 17:33 UTC](https://rubytalk.org/t/deadlock-in-borges-sample-apps/14994/4 "2004-11-29T17:33:57Z")

</div>

Lloyd Zusman \<ljz@asfast.com\> wrote in news:m3y8gky4w8.fsf@asfast.com:

> Are you sure that you attached the correct version of Session.rb.gz to  
> your message?

You have prooven quite conclusivly that it was the wrong one. Since there  
is no other one lying around here, that means the patch has been lost. I  
had to redevelop it, so here you have my completely fresh code as a diff -c  
patch (attachment).

Sorry for having wasted your time.  
kaspar

hand manufactured code - www.tua.ch/ruby

begin 644 borges-patch.txt  
M\*BHJ(%-E\<W-I;VXN\<F(N;W)I9PE7960@07!R(#(X(#`Q.C`P.C$P(#(P,#0-  
M"BTM+2!S97-S:6]N+G)B"4UO;B!.;W8@,CD@,3@Z,S(Z,S`@,C`P-`T\*\*BHJ  
M\*BHJ\*BHJ\*BHJ\*BHJ#0HJ\*BH@,3(R+#$R."`J*BHJ#0H@(`T\*("`@(&1E9B!S  
M=&%R=%]H86YD;&5R7W1H\<F5A9`T*("`@("`@0'-E\<W-I;VY?;75T97@@/2!-  
M=71E\>"YN97\<-"B$@("`@($!T:')E861?;75T97@@/2!-=71E\>"YN97\<N;&]C  
M:PT\*("`-"B`@("`@($!T:')E860@/2!4:')E860N\<W1A\<G0@9&\-"B`@("`@  
M("`@8W5R7W1H\<B`](%1H\<F5A9"YC=7)R96YT#0HM+2T@,3(R+#$R.2`M+2TM  
M#0H@(`T*("`@(&1E9B!S=&%R=%]H86YD;&5R7W1H\<F5A9`T*("`@("`@0'-E  
M\<W-I;VY?;75T97@@/2!-=71E\>"YN97\<-"B$@("`@($!C=E]R97%U97-T7W=A  
M:71I;F\<@/2!#;VYD:71I;VY687)I86)L92YN97\<-"B$@("`@($!C=E]R97-P  
M;VYS95]R96%D\>2`@/2!#;VYD:71I;VY687)I86)L92YN97\<-"B`@#0H@("`@  
M("!`=&AR96%D(#T@5&AR96%D+G-T87)T(&1O#0H@("`@("`@(&-U\<E]T:'(@  
M/2!4:')E860N8W5R\<F5N=`T\*\*BHJ\*BHJ\*BHJ\*BHJ\*BHJ#0HJ\*BH@,3,S+#$T  
M,R`J*BHJ#0H@(`T\*("`@("`@("!B96=I;@T\*("`@("`@("`@(&QO;W`@9&\-  
M"B$@("`@("`@("`@($!T:')E861?;75T97@N\<WEN8VAR;VYI\>F4@9&\-"B`@  
M("`@("`@("`@("`@8W5R7W1H\<ELZ\<F5T=7)N72`](&-U\<E]T:');.F)L;V-K  
M72YC86QL#0HA("`@("`@("`@("`@(&-U\<E]T:');.G)E\<W!O;G-E7V1O;F5=  
M+G5N;&]C:PT\*("`@("`@("`@("`@96YD#0HM("`@("`@("`@("!`=&AR96%D  
M7VUU=&5X+FQO8VL-"B`@("`@("`@("!E;F0-"B`@#0H@("`@("`@(')E\<V-U  
M92!%\>&-E\<'1I;VX@/3X@97)R#0HM+2T@,3,T+#$T-"`M+2TM#0H@(`T\*("`@  
M("`@("!B96=I;@T\*("`@("`@("`@(&QO;W`@9&\-"B$@("`@("`@("`@($!S  
M97-S:6]N7VUU=&5X+G-Y;F-H\<F]N:7IE(&1O#0HA("`@("`@("`@("`@($!C  
M=E]R97%U97-T7W=A:71I;F\<N=V%I="@@0'-E\<W-I;VY?;75T97@@\*2`-#0H@  
M("`@("`@("`@("`@(&-U\<E]T:');.G)E='5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\>"YS\>6YC:')O;FEZ92!D;PT\*+2`@("`@("`@(')E\<W!O  
M;G-E7VQO8VL@/2!-=71E\>"YN97\<N;&]C:R`C('5N;&]C:V5D(&)Y("-P97)F  
M;W)M7W)E\<75E\<W0-"B`@("`@("`@("`C0'1H\<F5A9%LZ\<F5Q=65S=%T@/2!R  
M97$-"B`@("`@("`@("!`=&AR96%D6SIB;&]C:UT@/2!B;&]C:PT\*(2`@("`@  
M("`@($!T:')E861;.G)E\<W!O;G-E7V1O;F5=(#T@\<F5S\<&]N\<V5?;&]C:PT\*  
M(2`@("`@("`@($!T:')E861?;75T97@N=6YL;V-K#0HA("`@("`@("`@\<F5S  
M\<&]N\<V5?;&]C:RYL;V-K#0H@("`@("`@("`@=F%L(#T@0'1H\<F5A9%LZ\<F5T  
M=7)N70T\*("`@("`@("!E;F0-"B`@#0HM+2T@,38U+#$W-"`M+2TM#0H@("`@  
M("`@('-T87)T7VAA;F1L97)?=&AR96%D('5N;&5S\<R!D969I;F5D/R!`=&AR  
M96%D#0H@(`T*("`@("`@("!`\<V5S\<VEO;E]M=71E\>"YS\>6YC:')O;FEZ92!D  
M;PT\*("`@("`@("`@("-`=&AR96%D6SIR97%U97-T72`](')E\<0T*("`@("`@  
M("`@($!T:')E861;.F)L;V-K72`](&)L;V-K#0HA("`@("`@("`@0&-V7W)E  
M\<75E\<W1?=V%I=&EN9RYS:6=N86P-"B$@("`@("`@("!`8W9?\<F5S\<&]N\<V5?  
M\<F5A9'DN=V%I="@@0'-E\<W-I;VY?;75T97@@\*0T\*("`@("`@("`@('9A;"`]  
D($!T:')E861;.G)E='5R;ET-"B`@("`@("`@96YD#0H@(`T\*  
`  
end

---

<div class="post-metadata">

**Author:** ![Lloyd\_Zusman](https://avatars.discourse-cdn.com/v4/letter/l/8baadc/32.png) [@Lloyd\_Zusman](https://rubytalk.org/u/Lloyd_Zusman)\
**Post date:** [29 November 2004 18:41 UTC](https://rubytalk.org/t/deadlock-in-borges-sample-apps/14994/5 "2004-11-29T18:41:55Z")

</div>

Kaspar Schiess \<eule@space.ch\> writes:

> Lloyd Zusman \<ljz@asfast.com\> wrote in news:m3y8gky4w8.fsf@asfast.com:
> 
> > Are you sure that you attached the correct version of Session.rb.gz to  
> > your message?
> 
> You have prooven quite conclusivly that it was the wrong one. Since there  
> is no other one lying around here, that means the patch has been lost. I  
> had to redevelop it, so here you have my completely fresh code as a diff -c  
> patch (attachment).

This new patch works perfectly with both the counter and the SushiNet  
apps! I haven't tested it with anything else yet, however.

> Sorry for having wasted your time.  
> kaspar

Not a waste of time at all ... this is what software and debugging is  
all about. I'm just very grateful that you took the time to recreate  
the patch.

Thank you very much!

> **···**
>
> > [...]
> 
> --  
> Lloyd Zusman  
> ljz@asfast.com  
> God bless you.

---

<div class="post-metadata">

**Author:** ![Kaspar\_Schiess](https://avatars.discourse-cdn.com/v4/letter/k/d78d45/32.png) [@Kaspar\_Schiess](https://rubytalk.org/u/Kaspar_Schiess)\
**Post date:** [30 November 2004 07:55 UTC](https://rubytalk.org/t/deadlock-in-borges-sample-apps/14994/6 "2004-11-30T07:55:17Z")

</div>

Hello Lloyd,

> Not a waste of time at all ... this is what software and debugging is  
> all about. I'm just very grateful that you took the time to recreate  
> the patch.

Good that it works. Just a word of warning, I am not sure about the  
exception handler that does

cur\_thr.kill  
@thread = nil

especially that last line is dangerous and insufficient. It will probably  
never get executed, so that solves the problem. It should probably go  
something like this:

@thread[:abort\_with\_error] = true  
cur\_thr.kill

And someone would have to check for that.

This popped into my head last night, for what its worth...

yours truly,  
kaspar

hand manufactured code - www.tua.ch/ruby
