Ruby not exiting when developing extension

Discussion in 'Ruby' started by Derek Lewis, Dec 4, 2003.

  1. Derek Lewis

    Derek Lewis Guest

    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::/var/cvs/libxosd-ruby login
    (password is blank)

    cvs -z3 -d:pserver::/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 :
    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
    Derek Lewis, Dec 4, 2003
    #1
    1. Advertising

  2. Derek Lewis

    ts Guest

    >>>>> "D" == Derek Lewis <> writes:

    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
    ts, Dec 4, 2003
    #2
    1. Advertising

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

    On Thu, Dec 04, 2003 at 10:05:11AM +0900, Derek Lewis wrote:
    >=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 <>
    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--
    Zachary P. Landau, Dec 4, 2003
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Chen Bin
    Replies:
    0
    Views:
    271
    Chen Bin
    Jul 2, 2004
  2. Steven J. Sobol

    Firefox not exiting (JApplet)

    Steven J. Sobol, Sep 5, 2006, in forum: Java
    Replies:
    4
    Views:
    449
    Steven J. Sobol
    Sep 6, 2006
  3. Jeremy
    Replies:
    1
    Views:
    369
    Carl Banks
    Nov 24, 2006
  4. Jason Burgett

    Exiting a ruby script

    Jason Burgett, Mar 11, 2007, in forum: Ruby
    Replies:
    2
    Views:
    94
    Jason Burgett
    Mar 13, 2007
  5. Iñaki Baz Castillo
    Replies:
    2
    Views:
    209
    Iñaki Baz Castillo
    Apr 20, 2011
Loading...

Share This Page