[Pharo-project] leaking semaphores
Hi! I am continuing my search of why does my remote headless image run out of semaphores eventually. I have found the culprit this time. It is most definitively related to RFBServer. I am using version 38 from http://source.lukas-renggli.ch/unsorted. Every time I disconnect from the image with my VNC client (I click the disconnect icon) the count of leaked semaphores increases by 3. Since there is 3 semaphores per socket, I guess this is related to sockets. Now what do I do? What do I check? I am running the a Pharo image and Cog I got from CI server yesterday. This is the script I use to count leaked semaphores: | semaphores arr res | arr := ExternalSemaphoreTable unprotectedExternalObjects. semaphores := arr reject: #isNil. res := semaphores collect: [:sema | sema pointersTo reject: [:ptr | ptr == arr or: [ptr == semaphores ] ] ]. res := res select: [ :each | each isEmpty ]. res size. -- Milan Mimica http://sparklet.sf.net
I find it funny, that your "interference" is actually root of all problems :) I don't know much about RFBServer , the only thing i know is that it is quite old (not in terms that it rusty, but in terms of it existence). Can't say what happens, but probably on terminating connection it does some nasty/incompatible things. On 29 February 2012 23:08, Milan Mimica <milan.mimica@gmail.com> wrote:
Hi!
I am continuing my search of why does my remote headless image run out of semaphores eventually.
I have found the culprit this time. It is most definitively related to RFBServer. I am using version 38 from http://source.lukas-renggli.ch/unsorted. Every time I disconnect from the image with my VNC client (I click the disconnect icon) the count of leaked semaphores increases by 3. Since there is 3 semaphores per socket, I guess this is related to sockets.
Now what do I do? What do I check?
I am running the a Pharo image and Cog I got from CI server yesterday.
This is the script I use to count leaked semaphores:
| semaphores arr res | arr := ExternalSemaphoreTable unprotectedExternalObjects. semaphores := arr reject: #isNil.
res := semaphores collect: [:sema | sema pointersTo reject: [:ptr | ptr == arr or: [ptr == semaphores ] ] ]. res := res select: [ :each | each isEmpty ]. res size.
-- Milan Mimica http://sparklet.sf.net
-- Best regards, Igor Stasenko.
On Feb 29, 2012, at 10:08 PM, Milan Mimica wrote:
Now what do I do? What do I check?
Modify RFBSocket class >> #acceptFrom: to read: ^RFBSocketInstances add: (super acceptFrom: aSocket) super new works for Socket, since it avoids calling the actual #new implementation in Socket, same is not true its subclasses call super⦠Note to tracker: Might be a good idea to "bulletproof" Socket>>acceptFrom:, by either 1) having it unregister existing handle/semaphores (The "I hope you weren't using that!" approach), or 2) raise an error in that case. (The "Surely you jest, madame?" approach) As someone rarely using sockets, I would prefer 2 but have no strong opinion on the matter, what do the rest of you think? Cheers, Henry
On 1 March 2012 02:11, Henrik Johansen <henrik.s.johansen@veloxit.no> wrote:
Modify RFBSocket class >> #acceptFrom: to read: ^RFBSocketInstances add: (super acceptFrom: aSocket)
Congratulations! You have just turned Pharo from so-so to awesome. -- Milan Mimica http://sparklet.sf.net
On 1 March 2012 18:20, Milan Mimica <milan.mimica@gmail.com> wrote:
On 1 March 2012 02:11, Henrik Johansen <henrik.s.johansen@veloxit.no> wrote:
Modify RFBSocket class >> #acceptFrom: to read: ^RFBSocketInstances add: (super acceptFrom: aSocket)
Congratulations! You have just turned Pharo from so-so to awesome.
With one line of code? No, you must be joking! :) -- Best regards, Igor Stasenko.
On Mar 1, 2012, at 7:28 PM, Igor Stasenko wrote:
On 1 March 2012 18:20, Milan Mimica <milan.mimica@gmail.com> wrote:
On 1 March 2012 02:11, Henrik Johansen <henrik.s.johansen@veloxit.no> wrote:
Modify RFBSocket class >> #acceptFrom: to read: ^RFBSocketInstances add: (super acceptFrom: aSocket)
Congratulations! You have just turned Pharo from so-so to awesome.
With one line of code? No, you must be joking! :)
Not an entire line of code, -1 word :) Cheers, Henry
participants (3)
-
Henrik Johansen -
Igor Stasenko -
Milan Mimica