Stack size and bypassing ulimit

Discussion in 'Ruby' started by Kalaky, Oct 26, 2004.

  1. Kalaky

    Kalaky Guest

    Hello,

    I'm embedding the ruby interpreter on a large project. I'm allocating
    the interpreter
    on a special (p)thread with pre-specified stack chunk. This is needed
    because the
    running scripts are very stack intensive and I don't want users having
    to change the
    stack limit every time we hit an stack overflow. So the game is: the
    user can choose
    a large stack-size without needing root privileges, bypassing the
    system stack limit.

    Unfortunately, Init_stack() uses getrlimit(RLIMIT_STACK) to set STACK_LEVEL_MAX
    but getrlimit does not reflect the new stack size, so when the stack
    gets higher ruby
    kills it self within ruby_stack_check().

    I think there should exist another function that is like Init_stack,
    but for hard-setting
    the stack size and stack_level. Matz, are you interested ?

    TIA,

    Kalaky
    Kalaky, Oct 26, 2004
    #1
    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. Maciej Kalisiak

    "ulimit -s" has no effect?

    Maciej Kalisiak, Feb 5, 2004, in forum: Python
    Replies:
    16
    Views:
    2,138
    Josiah Carlson
    Feb 12, 2004
  2. Maxim Veksler

    ulimit on open sockets ?

    Maxim Veksler, Apr 10, 2007, in forum: Python
    Replies:
    6
    Views:
    521
    Alex Martelli
    Apr 14, 2007
  3. Jarek Zgoda

    Set ulimit when using subprocess.Popen?

    Jarek Zgoda, Jan 28, 2008, in forum: Python
    Replies:
    3
    Views:
    710
    Rob Wolfe
    Jan 28, 2008
  4. Greg Lindahl

    ulimit stack size and python threads

    Greg Lindahl, Jan 8, 2009, in forum: Python
    Replies:
    11
    Views:
    1,597
    Martin v. Löwis
    Jan 9, 2009
  5. Patrick Gundlach

    ulimit alike in ruby?

    Patrick Gundlach, Jul 29, 2004, in forum: Ruby
    Replies:
    9
    Views:
    444
    Patrick Gundlach
    Jul 29, 2004
Loading...

Share This Page