Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SIGSEGV when running tracebacker on loaded workers #29

Closed
anthonyrisinger opened this issue Oct 22, 2012 · 4 comments
Closed

SIGSEGV when running tracebacker on loaded workers #29

anthonyrisinger opened this issue Oct 22, 2012 · 4 comments

Comments

@anthonyrisinger
Copy link
Contributor

DETAILS

per discussion on ML, i've found a repro case. this uses the dumbloop, as it matrches the exact problem i'm dealing with (and makes it easy to keep worker loaded).

example simulates a loaded AMQP worker by publishing to the loopback on an artificial memory:// transport (see queue_worker.py for more detail), and then rapidly connects to the tracebacker using a socat busy loop; should segfault in approx 5-10 seconds.

REPRODUCE

  1. get uWSGI HEAD
  2. add dumbloop to build
  3. build uWSGI
  4. get Kombu and deps
  5. run queue_worker.py
  6. die in ~5s :)

COMMANDS

export PIP_REQUIRE_VIRTUALENV=
export PYTHON=$(type -p python2.7 python2.6 python2 python | head -n1)

git clone --depth 1 https://github.com/unbit/uwsgi __bug &&
cd __bug &&
sed -i 's/python/dumbloop,&/' buildconf/default.ini &&
"$PYTHON" uwsgiconfig.py --build &&
"$PYTHON" -m pip install --target eggs kombu &&
wget https://raw.github.com/gist/3934532/c9c1e3b9822e006ae0ce3bcc895fa07be5ef1cf7/queue_worker.py &&
(

    ./uwsgi --master --pp=eggs --loop=dumb --dumbloop-code=queue_worker.py \
        --dumbloop-function=main --enable-threads --py-tracebacker=trace &
    sleep 3
    while socat UNIX-CLIENT:trace1 FILE:/dev/null; do :; done
    kill -INT %%

)
@unbit
Copy link
Owner

unbit commented Oct 23, 2012

Ok, i have managed to reproduce it, let's see what i will find...

@unbit
Copy link
Owner

unbit commented Oct 24, 2012

hi, it should be fixed now (and should not leak memory anymore)

@anthonyrisinger
Copy link
Contributor Author

damn, i was pretty close ... i know i missed the Py_INCREF for sure. anyways, i can confirm fixed by 15 minutes of non-crashing... sooo LGTM!

thanks Roberto!

@anthonyrisinger
Copy link
Contributor Author

oh btw if you drop a #29 (or really, #ISSUE) github will link issues back to commits... just FYI in-case you didn't know :) makes it nice for reference later on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants