Ruby not exiting when developing extension

D

Derek Lewis

I've been working on ruby bindings to libxosd2 for a couple days. It's
all going quite well, and the library is in a state that I'm ready to
release it, except for one thing.
Sometimes (and it seems fairly random to me) the ruby process that's
requiring the library just refuses to exit. I can't ctrl-C it, all I can
do is kill it.
I've written a small test script that seems to cause the problem about as
often as I can get it to, and I'm hoping someone with a bit more
experience with writing extensions can take a look and help me out. I've
so far experienced the problems on ruby 1.6.8 and 1.8.0, both on Linux on
i386.
I can ctrl-Z the process, and doing a 'ps', I see this:
PID TTY TIME CMD
16727 pts/16 00:00:00 bash
17321 pts/16 00:00:00 ruby
17322 pts/16 00:00:00 ruby <defunct>
17359 pts/16 00:00:00 ps

If anyone wants to help me out, you'll need libxosd2, and the equivalent
development package installed, as well as libxosd2-ruby from cvs.

Here's the cvs info for libxosd2-ruby:

cvs -d:pserver:[email protected]:/var/cvs/libxosd-ruby login
(password is blank)

cvs -z3 -d:pserver:[email protected]:/var/cvs/libxosd-ruby co libxosd2-ruby

The these three commands:
1. ruby extconf.rb
2. make
3. ruby break1.rb

Executing the 3rd one repeatedly should eventually cause it to not exit,
and not respond to ctrl-C.

Derek Lewis

===================================================================
Java Web-Application Developer

Email : (e-mail address removed)
Cellular : 604.312.2846
Website : http://www.lewisd.com

"If you've got a 5000-line JSP page that has "all in one" support
for three input forms and four follow-up screens, all controlled
by "if" statements in scriptlets, well ... please don't show it
to me :). Its almost dinner time, and I don't want to lose my
appetite :)."
- Craig R. McClanahan
 
T

ts

D> I've written a small test script that seems to cause the problem about as
D> often as I can get it to, and I'm hoping someone with a bit more
D> experience with writing extensions can take a look and help me out.

It use pthread.

Now don't expect it to work actually with ruby thread. If you want to use
xosd_wait_until_no_display() emulate it like described in the manual page.

Perhaps you can also use the CVS version of ruby, compiled with
--enable-pthread


Guy Decoux
 
Z

Zachary P. Landau

--IpbVkmxF4tDyP/Kb
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

=20
I've been working on ruby bindings to libxosd2 for a couple days. It's
all going quite well, and the library is in a state that I'm ready to
release it, except for one thing.

Looks like I should have posted earlier. A few weeks ago I wrote some
libxosd bindings. I was waiting to release it, though, because I was
having the same problem you were.
Sometimes (and it seems fairly random to me) the ruby process that's
requiring the library just refuses to exit. I can't ctrl-C it, all I can
do is kill it.

I noticed the problem when trying to set an invalid font. Sometimes it
would just get an error, as it is supposed to, but sometimes the program
would sit there and refuse to exit.=20

I haven't been working on it lately, but if you find a solution, I'd
definitely like to know what it is.

--=20
Zachary P. Landau <[email protected]>
GPG: gpg --recv-key 0x24E5AD99 | http://kapheine.hypa.net/kapheine.asc

--IpbVkmxF4tDyP/Kb
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQE/z3K3CwWyMCTlrZkRAq8KAJ9H/lUgGNGPbZbegviw9OSlVICGyQCfdlXH
bMc5lWu/QwY5YJOQyFzCML0=
=zhLk
-----END PGP SIGNATURE-----

--IpbVkmxF4tDyP/Kb--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top