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

ugreen + pycurl multi_curl: buffer overflow detected :-) #37

Closed
77cc33 opened this issue Oct 29, 2012 · 10 comments
Closed

ugreen + pycurl multi_curl: buffer overflow detected :-) #37

77cc33 opened this issue Oct 29, 2012 · 10 comments

Comments

@77cc33
Copy link

77cc33 commented Oct 29, 2012

hi,

I'am using ugreen to wait answer from pycurl E_CALL_MULTI what looks something like this:

        while True:
            ret, num_handles = m.perform()
            if ret != pycurl.E_CALL_MULTI_PERFORM:
                break
        read, write, exc = m.fdset()
        if read:
            uwsgi.wait_fd_read(read[0], 1) 
            uwsgi.suspend()
        elif write:
            uwsgi.wait_fd_write(write[0], 1)
            uwsgi.suspend()

most times this code works ok, but as soon as I have more load (so more connections) uwsgi starts to crash with this backtrace

*** buffer overflow detected ***: uwsgi terminated
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(__fortify_fail+0x37)[0x7ff12eafa807]
/lib/x86_64-linux-gnu/libc.so.6(+0x109700)[0x7ff12eaf9700]
/lib/x86_64-linux-gnu/libc.so.6(+0x10a7be)[0x7ff12eafa7be]
/usr/lib/x86_64-linux-gnu/libcurl.so.4(curl_multi_fdset+0xa3)[0x7feec71a72f3]
/usr/local/lib/python2.7/dist-packages/pycurl.so(+0x711b)[0x7feec73d511b]
/usr/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x556f)[0x7ff12ee40a0f]
/usr/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x855)[0x7ff12ee0b605]
/usr/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x5420)[0x7ff12ee408c0]
/usr/lib/libpython2.7.so.1.0(+0x5b76b)[0x7ff12ee0a76b]
/usr/lib/libpython2.7.so.1.0(PyIter_Next+0xb)[0x7ff12ee6308b]
uwsgi(uwsgi_response_subhandler_wsgi+0x5a)[0x44cf1a]
uwsgi(uwsgi_request_wsgi+0x3df)[0x44bc0f]
uwsgi(u_green_request+0x19)[0x45e6e9]
/lib/x86_64-linux-gnu/libc.so.6(+0x48650)[0x7ff12ea38650]
======= Memory map: ========
00400000-0047d000 r-xp 00000000 08:01 37625315                           /usr/local/bin/uwsgi
0067c000-0067d000 r--p 0007c000 08:01 37625315                           /usr/local/bin/uwsgi
0067d000-00688000 rw-p 0007d000 08:01 37625315                           /usr/local/bin/uwsgi
00688000-0068c000 rw-p 00000000 00:00 0 
01e88000-02c03000 rw-p 00000000 00:00 0                                  [heap]
02c03000-0535e000 rw-p 00000000 00:00 0                                  [heap]
7feec2fcf000-7feec30d1000 rw-p 00000000 00:00 0 
7feec30d1000-7feec30da000 r-xp 00000000 08:01 38798499                   /lib/x86_64-linux-gnu/libcrypt-2.15.so
7feec30da000-7feec32da000 ---p 00009000 08:01 38798499                   /lib/x86_64-linux-gnu/libcrypt-2.15.so
7feec32da000-7feec32db000 r--p 00009000 08:01 38798499                   /lib/x86_64-linux-gnu/libcrypt-2.15.so
7feec32db000-7feec32dc000 rw-p 0000a000 08:01 38798499                   /lib/x86_64-linux-gnu/libcrypt-2.15.so
7feec32dc000-7feec330a000 rw-p 00000000 00:00 0 
7feec330a000-7feec33a8000 r-xp 00000000 08:01 37618266                   /usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6
7feec33a8000-7feec35a8000 ---p 0009e000 08:01 37618266                   /usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6
7feec35a8000-7feec35aa000 r--p 0009e000 08:01 37618266                   /usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6
7feec35aa000-7feec35ac000 rw-p 000a0000 08:01 37618266                   /usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6
7feec35ac000-7feec35ad000 rw-p 00000000 00:00 0 
7feec35ad000-7feec35f2000 r-xp 00000000 08:01 37623540                   /usr/lib/x86_64-linux-gnu/libhx509.so.5.0.0
7feec35f2000-7feec37f2000 ---p 00045000 08:01 37623540                   /usr/lib/x86_64-linux-gnu/libhx509.so.5.0.0
7feec37f2000-7feec37f4000 r--p 00045000 08:01 37623540                   /usr/lib/x86_64-linux-gnu/libhx509.so.5.0.0
7feec37f4000-7feec37f6000 rw-p 00047000 08:01 37623540                   /usr/lib/x86_64-linux-gnu/libhx509.so.5.0.0
7feec37f6000-7feec37f7000 rw-p 00000000 00:00 0 
7feec37f7000-7feec3805000 r-xp 00000000 08:01 37623538                   /usr/lib/x86_64-linux-gnu/libheimbase.so.1.0.0
7feec3805000-7feec3a04000 ---p 0000e000 08:01 37623538                   /usr/lib/x86_64-linux-gnu/libheimbase.so.1.0.0
7feec3a04000-7feec3a05000 r--p 0000d000 08:01 37623538                   /usr/lib/x86_64-linux-gnu/libheimbase.so.1.0.0
7feec3a05000-7feec3a06000 rw-p 0000e000 08:01 37623538                   /usr/lib/x86_64-linux-gnu/libheimbase.so.1.0.0
7feec3a06000-7feec3a2e000 r-xp 00000000 08:01 37623568                   /usr/lib/x86_64-linux-gnu/libwind.so.0.0.0
7feec3a2e000-7feec3c2d000 ---p 00028000 08:01 37623568                   /usr/lib/x86_64-linux-gnu/libwind.so.0.0.0
7feec3c2d000-7feec3c2e000 r--p 00027000 08:01 37623568                   /usr/lib/x86_64-linux-gnu/libwind.so.0.0.0
7feec3c2e000-7feec3c2f000 rw-p 00028000 08:01 37623568                   /usr/lib/x86_64-linux-gnu/libwind.so.0.0.0
7feec3c2f000-7feec3c32000 r-xp 00000000 08:01 38798326                   /lib/x86_64-linux-gnu/libkeyutils.so.1.4
7feec3c32000-7feec3e31000 ---p 00003000 08:01 38798326                   /lib/x86_64-linux-gnu/libkeyutils.so.1.4
7feec3e31000-7feec3e32000 r--p 00002000 08:01 38798326                   /lib/x86_64-linux-gnu/libkeyutils.so.1.4
7feec3e32000-7feec3e33000 rw-p 00003000 08:01 38798326                   /lib/x86_64-linux-gnu/libkeyutils.so.1.4
7feec3e33000-7feec3e36000 r-xp 00000000 08:01 38798324                   /lib/x86_64-linux-gnu/libgpg-error.so.0.8.0
7feec3e36000-7feec4035000 ---p 00003000 08:01 38798324                   /lib/x86_64-linux-gnu/libgpg-error.so.0.8.0
7feec4035000-7feec4036000 r--p 00002000 08:01 38798324                   /lib/x86_64-linux-gnu/libgpg-error.so.0.8.0
7feec4036000-7feec4037000 rw-p 00003000 08:01 38798324                   /lib/x86_64-linux-gnu/libgpg-error.so.0.8.0
7feec4037000-7feec4048000 r-xp 00000000 08:01 37623552                   /usr/lib/x86_64-linux-gnu/libp11-kit.so.0.0.0
7feec4048000-7feec4247000 ---p 00011000 08:01 37623552                   /usr/lib/x86_64-linux-gnu/libp11-kit.so.0.0.0
7feec4247000-7feec4248000 r--p 00010000 08:01 37623552                   /usr/lib/x86_64-linux-gnu/libp11-kit.so.0.0.0
7feec4248000-7feec4249000 rw-p 00011000 08:01 37623552                   /usr/lib/x86_64-linux-gnu/libp11-kit.so.0.0.0
7feec4249000-7feec4259000 r-xp 00000000 08:01 37619106                   /usr/lib/x86_64-linux-gnu/libtasn1.so.3.1.12
7feec4259000-7feec4458000 ---p 00010000 08:01 37619106                   /usr/lib/x86_64-linux-gnu/libtasn1.so.3.1.12
7feec4458000-7feec4459000 r--p 0000f000 08:01 37619106                   /usr/lib/x86_64-linux-gnu/libtasn1.so.3.1.12
7feec4459000-7feec445a000 rw-p 00010000 08:01 37619106                   /usr/lib/x86_64-linux-gnu/libtasn1.so.3.1.12
7feec445a000-7feec446e000 r-xp 00000000 08:01 37623560                   /usr/lib/x86_64-linux-gnu/libroken.so.18.1.0
7feec446e000-7feec466d000 ---p 00014000 08:01 37623560                   /usr/lib/x86_64-linux-gnu/libroken.so.18.1.0
7feec466d000-7feec466e000 r--p 00013000 08:01 37623560                   /usr/lib/x86_64-linux-gnu/libroken.so.18.1.0
7feec466e000-7feec466f000 rw-p 00014000 08:01 37623560                   /usr/lib/x86_64-linux-gnu/libroken.so.18.1.0
7feec466f000-7feec46a0000 r-xp 00000000 08:01 37623537                   /usr/lib/x86_64-linux-gnu/libhcrypto.so.4.1.0
7feec46a0000-7feec48a0000 ---p 00031000 08:01 37623537                   /usr/lib/x86_64-linux-gnu/libhcrypto.so.4.1.0
7feec48a0000-7feec48a1000 r--p 00031000 08:01 37623537                   /usr/lib/x86_64-linux-gnu/libhcrypto.so.4.1.0
7feec48a1000-7feec48a2000 rw-p 00032000 08:01 37623537                   /usr/lib/x86_64-linux-gnu/libhcrypto.so.4.1.0
7feec48a2000-7feec48a3000 rw-p 00000000 00:00 0 
7feec48a3000-7feec493e000 r-xp 00000000 08:01 37623510                   /usr/lib/x86_64-linux-gnu/libasn1.so.8.0.0
7feec493e000-7feec4b3d000 ---p 0009b000 08:01 37623510                   /usr/lib/x86_64-linux-gnu/libasn1.so.8.0.0
7feec4b3d000-7feec4b3f000 r--p 0009a000 08:01 37623510                   /usr/lib/x86_64-linux-gnu/libasn1.so.8.0.0
7feec4b3f000-7feec4b43000 rw-p 0009c000 08:01 37623510                   /usr/lib/x86_64-linux-gnu/libasn1.so.8.0.0
7feec4b43000-7feec4bc3000 r-xp 00000000 08:01 37623543                   /usr/lib/x86_64-linux-gnu/libkrb5.so.26.0.0
7feec4bc3000-7feec4dc3000 ---p 00080000 08:01 37623543                   /usr/lib/x86_64-linux-gnu/libkrb5.so.26.0.0
7feec4dc3000-7feec4dc5000 r--p 00080000 08:01 37623543                   /usr/lib/x86_64-linux-gnu/libkrb5.so.26.0.0
7feec4dc5000-7feec4dc9000 rw-p 00082000 08:01 37623543                   /usr/lib/x86_64-linux-gnu/libkrb5.so.26.0.0
7feec4dc9000-7feec4dcf000 r-xp 00000000 08:01 37623539                   /usr/lib/x86_64-linux-gnu/libheimntlm.so.0.1.0
7feec4dcf000-7feec4fce000 ---p 00006000 08:01 37623539                   /usr/lib/x86_64-linux-gnu/libheimntlm.so.0.1.0
7feec4fce000-7feec4fcf000 r--p 00005000 08:01 37623539                   /usr/lib/x86_64-linux-gnu/libheimntlm.so.0.1.0
7feec4fcf000-7feec4fd0000 rw-p 00006000 08:01 37623539                   /usr/lib/x86_64-linux-gnu/libheimntlm.so.0.1.0
7feec4fd0000-7feec4fd7000 r-xp 00000000 08:01 37619119                   /usr/lib/x86_64-linux-gnu/libkrb5support.so.0.1
7feec4fd7000-7feec51d6000 ---p 00007000 08:01 37619119                   /usr/lib/x86_64-linux-gnu/libkrb5support.so.0.1
7feec51d6000-7feec51d7000 r--p 00006000 08:01 37619119                   /usr/lib/x86_64-linux-gnu/libkrb5support.so.0.1
7feec51d7000-7feec51d8000 rw-p 00007000 08:01 37619119                   /usr/lib/x86_64-linux-gnu/libkrb5support.so.0.1
7feec51d8000-7feec51db000 r-xp 00000000 08:01 38798313                   /lib/x86_64-linux-gnu/libcom_err.so.2.1
7feec51db000-7feec53da000 ---p 00003000 08:01 38798313                   /lib/x86_64-linux-gnu/libcom_err.so.2.1
7feec53da000-7feec53db000 r--p 00002000 08:01 38798313                   /lib/x86_64-linux-gnu/libcom_err.so.2.1
7feec53db000-7feec53dc000 rw-p 00003000 08:01 38798313                   /lib/x86_64-linux-gnu/libcom_err.so.2.1
7feec53dc000-7feec5401000 r-xp 00000000 08:01 37619112                   /usr/lib/x86_64-linux-gnu/libk5crypto.so.3.1
7feec5401000-7feec5601000 ---p 00025000 08:01 37619112                   /usr/lib/x86_64-linux-gnu/libk5crypto.so.3.1
7feec5601000-7feec5602000 r--p 00025000 08:01 37619112                   /usr/lib/x86_64-linux-gnu/libk5crypto.so.3.1
7feec5602000-7feec5603000 rw-p 00026000 08:01 37619112                   /usr/lib/x86_64-linux-gnu/libk5crypto.so.3.1
7feec5603000-7feec5604000 rw-p 00000000 00:00 0 
7feec5604000-7feec56c8000 r-xp 00000000 08:01 37619117                   /usr/lib/x86_64-linux-gnu/libkrb5.so.3.3
7feec56c8000-7feec58c7000 ---p 000c4000 08:01 37619117                   /usr/lib/x86_64-linux-gnu/libkrb5.so.3.3
7feec58c7000-7feec58d1000 r--p 000c3000 08:01 37619117                   /usr/lib/x86_64-linux-gnu/libkrb5.so.3.3
7feec58d1000-7feec58d2000 rw-p 000cd000 08:01 37619117                   /usr/lib/x86_64-linux-gnu/libkrb5.so.3.3
7feec58d2000-7feec594c000 r-xp 00000000 08:01 38797330                   /lib/x86_64-linux-gnu/libgcrypt.so.11.7.0
7feec594c000-7feec5b4c000 ---p 0007a000 08:01 38797330                   /lib/x86_64-linux-gnu/libgcrypt.so.11.7.0
7feec5b4c000-7feec5b4d000 r--p 0007a000 08:01 38797330                   /lib/x86_64-linux-gnu/libgcrypt.so.11.7.0
7feec5b4d000-7feec5b50000 rw-p 0007b000 08:01 38797330                   /lib/x86_64-linux-gnu/libgcrypt.so.11.7.0
7feec5b50000-7feec5c04000 r-xp 00000000 08:01 37619109                   /usr/lib/x86_64-linux-gnu/libgnutls.so.26.21.8
7feec5c04000-7feec5e04000 ---p 000b4000 08:01 37619109                   /usr/lib/x86_64-linux-gnu/libgnutls.so.26.21.8
7feec5e04000-7feec5e0a000 r--p 000b4000 08:01 37619109                   /usr/lib/x86_64-linux-gnu/libgnutls.so.26.21.8
7feec5e0a000-7feec5e0b000 rw-p 000ba000 08:01 37619109                   /usr/lib/x86_64-linux-gnu/libgnutls.so.26.21.8
7feec5e0b000-7feec5e0c000 rw-p 00000000 00:00 0 
7feec5e0c000-7feec5e46000 r-xp 00000000 08:01 37623534                   /usr/lib/x86_64-linux-gnu/libgssapi.so.3.0.0
7feec5e46000-7feec6046000 ---p 0003a000 08:01 37623534                   /usr/lib/x86_64-linux-gnu/libgssapi.so.3.0.0
7feec6046000-7feec6047000 r--p 0003a000 08:01 37623534                   /usr/lib/x86_64-linux-gnu/libgssapi.so.3.0.0
7feec6047000-7feec604a000 rw-p 0003b000 08:01 37623534                   /usr/lib/x86_64-linux-gnu/libgssapi.so.3.0.0
7feec604a000-7feec6064000 r-xp 00000000 08:01 37619132                   /usr/lib/x86_64-linux-gnu/libsasl2.so.2.0.25
7feec6064000-7feec6263000 ---p 0001a000 08:01 37619132                   /usr/lib/x86_64-linux-gnu/libsasl2.so.2.0.25
7feec6263000-7feec6264000 r--p 00019000 08:01 37619132                   /usr/lib/x86_64-linux-gnu/libsasl2.so.2.0.25
7feec6264000-7feec6265000 rw-p 0001a000 08:01 37619132                   /usr/lib/x86_64-linux-gnu/libsasl2.so.2.0.25
7feec6265000-7feec627d000 r-xp 00000000 08:01 38798495                   /lib/x86_64-linux-gnu/libresolv-2.15.so
7feec627d000-7feec647d000 ---p 00018000 08:01 38798495                   /lib/x86_64-linux-gnu/libresolv-2.15.so
7feec647d000-7feec647e000 r--p 00018000 08:01 38798495                   /lib/x86_64-linux-gnu/libresolv-2.15.so
7feec647e000-7feec647f000 rw-p 00019000 08:01 38798495                   /lib/x86_64-linux-gnu/libresolv-2.15.so
7feec647f000-7feec6481000 rw-p 00000000 00:00 0 
7feec6481000-7feec6499000 r-xp 00000000 08:01 37623561                   /usr/lib/x86_64-linux-gnu/librtmp.so.0
7feec6499000-7feec6699000 ---p 00018000 08:01 37623561                   /usr/lib/x86_64-linux-gnu/librtmp.so.0
7feec6699000-7feec669a000 r--p 00018000 08:01 37623561                   /usr/lib/x86_64-linux-gnu/librtmp.so.0
7feec669a000-7feec669b000 rw-p 00019000 08:01 37623561                   /usr/lib/x86_64-linux-gnu/librtmp.so.0
7feec669b000-7feec66d6000 r-xp 00000000 08:01 37619115                   /usr/lib/x86_64-linux-gnu/libgssapi_krb5.so.2.2
7feec66d6000-7feec68d6000 ---p 0003b000 08:01 37619115                   /usr/lib/x86_64-linux-gnu/libgssapi_krb5.so.2.2
7feec68d6000-7feec68d7000 r--p 0003b000 08:01 37619115                   /usr/lib/x86_64-linux-gnu/libgssapi_krb5.so.2.2
7feec68d7000-7feec68d9000 rw-p 0003c000 08:01 37619115                   /usr/lib/x86_64-linux-gnu/libgssapi_krb5.so.2.2
7feec68d9000-7feec68e0000 r-xp 00000000 08:01 38798494                   /lib/x86_64-linux-gnu/librt-2.15.so
7feec68e0000-7feec6adf000 ---p 00007000 08:01 38798494                   /lib/x86_64-linux-gnu/librt-2.15.so
7feec6adf000-7feec6ae0000 r--p 00006000 08:01 38798494                   /lib/x86_64-linux-gnu/librt-2.15.so
7feec6ae0000-7feec6ae1000 rw-p 00007000 08:01 38798494                   /lib/x86_64-linux-gnu/librt-2.15.so
7feec6ae1000-7feec6b2c000 r-xp 00000000 08:01 37619136                   /usr/lib/x86_64-linux-gnu/libldap_r-2.4.so.2.8.1
7feec6b2c000-7feec6d2b000 ---p 0004b000 08:01 37619136                   /usr/lib/x86_64-linux-gnu/libldap_r-2.4.so.2.8.1
7feec6d2b000-7feec6d2d000 r--p 0004a000 08:01 37619136                   /usr/lib/x86_64-linux-gnu/libldap_r-2.4.so.2.8.1
7feec6d2d000-7feec6d2e000 rw-p 0004c000 08:01 37619136                   /usr/lib/x86_64-linux-gnu/libldap_r-2.4.so.2.8.1
7feec6d2e000-7feec6d30000 rw-p 00000000 00:00 0 
7feec6d30000-7feec6d3d000 r-xp 00000000 08:01 37619140                   /usr/lib/x86_64-linux-gnu/liblber-2.4.so.2.8.1
7feec6d3d000-7feec6f3c000 ---p 0000d000 08:01 37619140                   /usr/lib/x86_64-linux-gnu/liblber-2.4.so.2.8.1
7feec6f3c000-7feec6f3d000 r--p 0000c000 08:01 37619140                   /usr/lib/x86_64-linux-gnu/liblber-2.4.so.2.8.1
7feec6f3d000-7feec6f3e000 rw-p 0000d000 08:01 37619140                   /usr/lib/x86_64-linux-gnu/liblber-2.4.so.2.8.1
7feec6f3e000-7feec6f70000 r-xp 00000000 08:01 37623541                   /usr/lib/x86_64-linux-gnu/libidn.so.11.6.6
7feec6f70000-7feec716f000 ---p 00032000 08:01 37623541                   /usr/lib/x86_64-linux-gnu/libidn.so.11.6.6
7feec716f000-7feec7170000 r--p 00031000 08:01 37623541                   /usr/lib/x86_64-linux-gnu/libidn.so.11.6.6
7feec7170000-7feec7171000 rw-p 00032000 08:01 37623541                   /usr/lib/x86_64-linux-gnu/libidn.so.11.6.6
7feec7171000-7feec71cb000 r-xp 00000000 08:01 37623512                   /usr/lib/x86_64-linux-gnu/libcurl.so.4.2.0
7feec71cb000-7feec73cb000 ---p 0005a000 08:01 37623512                   /usr/lib/x86_64-linux-gnu/libcurl.so.4.2.0
7feec73cb000-7feec73cd000 r--p 0005a000 08:01 37623512                   /usr/lib/x86_64-linux-gnu/libcurl.so.4.2.0
7feec73cd000-7feec73ce000 rw-p 0005c000 08:01 37623512                   /usr/lib/x86_64-linux-gnu/libcurl.so.4.2.0
7feec73ce000-7feec73dd000 r-xp 00000000 08:01 37625382                   /usr/local/lib/python2.7/dist-packages/pycurl.so
7feec73dd000-7feec75dc000 ---p 0000f000 08:01 37625382                   /usr/local/lib/python2.7/dist-packages/pycurl.so
7feec75dc000-7feec75dd000 r--p 0000e000 08:01 37625382                   /usr/local/lib/python2.7/dist-packages/pycurl.so
7feec75dd000-7feec75df000 rw-p 0000f000 08:01 37625382                   /usr/local/lib/python2.7/dist-packages/pycurl.so
7feec75df000-7feec7661000 rw-p 00000000 00:00 0 
7feec7661000-7feec7664000 r-xp 00000000 08:01 37622669                   /usr/lib/python2.7/lib-dynload/_heapq.so
7feec7664000-7feec7863000 ---p 00003000 08:01 37622669                   /usr/lib/python2.7/lib-dynload/_heapq.so
7feec7863000-7feec7864000 r--p 00002000 08:01 37622669                   /usr/lib/python2.7/lib-dynload/_heapq.so
7feec7864000-7feec7866000 rw-p 00003000 08:01 37622669                   /usr/lib/python2.7/lib-dynload/_heapq.so
7feec7866000-7feec78e8000 rw-p 00000000 00:00 0 
7feec78e9000-7feec83f9000 rw-p 00000000 00:00 0 
7feec83f9000-7feecfc3f000 rw-s 00000000 00:04 264730989                  /dev/zero (deleted)
7feecfc3f000-7feed7237000 rw-s 00000000 00:04 264730988                  /dev/zero (deleted)
7feed7237000-7feed80f6000 rw-s 00000000 00:04 264730987                  /dev/zero (deleted)
7feed80f6000-7feeda0c2000 rw-s 00000000 00:04 264730986                  /dev/zero (deleted)
7feeda0c2000-7feeda0d2000 rw-s 00000000 00:04 264730985                  /dev/zero (deleted)
7feeda0d2000-7feee1918000 rw-s 00000000 00:04 264730984                  /dev/zero (deleted)
7feee1918000-7feee8f10000 rw-s 00000000 00:04 264730983                  /dev/zero (deleted)
7feee8f10000-7feee9dcf000 rw-s 00000000 00:04 264730982                  /dev/zero (deleted)
7feee9dcf000-7feeebd9b000 rw-s 00000000 00:04 264730981                  /dev/zero (deleted)
7feeebd9b000-7feeebdab000 rw-s 00000000 00:04 264730980                  /dev/zero (deleted)
7feeebdab000-7feef35f1000 rw-s 00000000 00:04 264730979                  /dev/zero (deleted)
7feef35f1000-7feefabe9000 rw-s 00000000 00:04 264730978                  /dev/zero (deleted)
7feefabe9000-7feefbaa8000 rw-s 00000000 00:04 264730977                  /dev/zero (deleted)
7feefbaa8000-7feefda74000 rw-s 00000000 00:04 264730976                  /dev/zero (deleted)
7feefda74000-7feefda84000 rw-s 00000000 00:04 264730975                  /dev/zero (deleted)
7feefda84000-7fef052ca000 rw-s 00000000 00:04 264730974                  /dev/zero (deleted)
7fef052ca000-7fef0c8c2000 rw-s 00000000 00:04 264730973                  /dev/zero (deleted)
7fef0c8c2000-7fef0d781000 rw-s 00000000 00:04 264730972                  /dev/zero (deleted)
7fef0d781000-7fef0f74d000 rw-s 00000000 00:04 264730971                  /dev/zero (deleted)
7fef0f74d000-7fef0f75d000 rw-s 00000000 00:04 264730970                  /dev/zero (deleted)
7fef0f75d000-7fef16fa3000 rw-s 00000000 00:04 264730969                  /dev/zero (deleted)
7fef16fa3000-7fef1e59b000 rw-s 00000000 00:04 264730968                  /dev/zero (deleted)
7fef1e59b000-7fef1f45a000 rw-s 00000000 00:04 264730967                  /dev/zero (deleted)
7fef1f45a000-7fef21426000 rw-s 00000000 00:04 264730966                  /dev/zero (deleted)
7fef21426000-7fef21436000 rw-s 00000000 00:04 264730965                  /dev/zero (deleted)
7fef21436000-7fef28c7c000 rw-s 00000000 00:04 264730964                  /dev/zero (deleted)
7fef28c7c000-7fef30274000 rw-s 00000000 00:04 264730963                  /dev/zero (deleted)
7fef30274000-7fef31133000 rw-s 00000000 00:04 264730962                  /dev/zero (deleted)
7fef31133000-7fef330ff000 rw-s 00000000 00:04 264730961                  /dev/zero (deleted)
7fef330ff000-7fef3310f000 rw-s 00000000 00:04 264730960                  /dev/zero (deleted)
7fef3310f000-7fef3a955000 rw-s 00000000 00:04 264730959                  /dev/zero (deleted)
7fef3a955000-7fef41f4d000 rw-s 00000000 00:04 264730958                  /dev/zero (deleted)
7fef41f4d000-7fef42e0c000 rw-s 00000000 00:04 264730957                  /dev/zero (deleted)
7fef42e0c000-7fef44dd8000 rw-s 00000000 00:04 264730956                  /dev/zero (deleted)
7fef44dd8000-7fef44de8000 rw-s 00000000 00:04 264730955                  /dev/zero (deleted)
7fef44de8000-7fef44dea000 rw-s 00000000 00:04 264730954                  /dev/zero (deleted)
7fef44dea000-7fef44fec000 r--p 00000000 08:01 37618640                   /usr/lib/locale/locale-archive

I tried uwsgi 1.2.x but situation is the same, I think that it started to happen when I moved to Python 2.7, but not sure.

I also tried greenlet instead of ugreen, but no success.

I'am using ubuntu 12.04 64 bit with python 2.7.3

any chance to see the fix in near future for this bug? or I should look for some other solution instead of uwsgi/pycurl combo?

@unbit
Copy link
Owner

unbit commented Oct 29, 2012

When you say you tried with 'greenlet', you mean you get the same error ?

@77cc33
Copy link
Author

77cc33 commented Oct 29, 2012

not really, lot of these errors on every request. and page doesn't load till the end (not always, some time just transferring forever)

epoll_ctl(): File exists [core/event.c line 272]
epoll_ctl(): Bad file descriptor [core/event.c line 387]
epoll_ctl(): Bad file descriptor [core/event.c line 387]
epoll_ctl(): Bad file descriptor [core/event.c line 387]
epoll_ctl(): File exists [core/event.c line 272]
epoll_ctl(): Bad file descriptor [core/event.c line 387]
epoll_ctl(): Bad file descriptor [core/event.c line 387]
epoll_ctl(): Bad file descriptor [core/event.c line 387]
epoll_ctl(): File exists [core/event.c line 272]
epoll_ctl(): Bad file descriptor [core/event.c line 387]
epoll_ctl(): File exists [core/event.c line 272]
epoll_ctl(): Bad file descriptor [core/event.c line 387]
epoll_ctl(): Bad file descriptor [core/event.c line 387]
epoll_ctl(): Bad file descriptor [core/event.c line 387]
epoll_ctl(): Bad file descriptor [core/event.c line 387]
epoll_ctl(): File exists [core/event.c line 272]
epoll_ctl(): Bad file descriptor [core/event.c line 387]
epoll_ctl(): Bad file descriptor [core/event.c line 387]
epoll_ctl(): File exists [core/event.c line 272]
epoll_ctl(): File exists [core/event.c line 272]
epoll_ctl(): Bad file descriptor [core/event.c line 387]

@unbit
Copy link
Owner

unbit commented Oct 29, 2012

I will check-it in the next few days as i have an idea of revamp the async mode for some callback-based (like node.js) framework. In the last year the gevent plugin became the de-facto standard for non-blocking programming in uWSGI, so i suggest you to give a look at it (the current github version is extremely advanced). If you do not want to use gevent, then, just wait a bit ;)

@77cc33
Copy link
Author

77cc33 commented Oct 29, 2012

thank you

well I think that in my case ugreen will be much faster. just some internal feeling, but anyway will try to check this solution - thanks for the tip. and for sure will test your fix in a few days ))

@77cc33
Copy link
Author

77cc33 commented Oct 29, 2012

just tried gevent (not pycurl, but used urlib2 and it's much slower ;-((( )

even static yield 'abcd' with ugreen is much faster and CPU effective than the save with gevent. so hope that you'll fix ugreen as it's super fast thing.

@77cc33
Copy link
Author

77cc33 commented Oct 29, 2012

also do you have any idea of async mode with uwsgi and pypy? is there some solution so I could use uwsgi with PYPY in async mode?

@unbit
Copy link
Owner

unbit commented Oct 30, 2012

i have made a bunch of modification to the current master. Can you try with the github code ?

@77cc33
Copy link
Author

77cc33 commented Nov 1, 2012

hi,

installed from master 1.4-dev, but nothing changed

DAMN ! worker 2 (pid: 9923) died, killed by signal 6 :( trying respawn ...
Respawned uWSGI worker 2 (new pid: 9929)
*** buffer overflow detected ***: uwsgi terminated
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(__fortify_fail+0x37)[0x7f58f37c6807]
/lib/x86_64-linux-gnu/libc.so.6(+0x109700)[0x7f58f37c5700]
/lib/x86_64-linux-gnu/libc.so.6(+0x10a7be)[0x7f58f37c67be]
/usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4(curl_multi_fdset+0xa3)[0x7f57599dcb33]
/usr/lib/python2.7/dist-packages/pycurl.so(+0x6cfb)[0x7f5759c0acfb]
/usr/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x556f)[0x7f58f3d45a0f]
/usr/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x855)[0x7f58f3d10605]
/usr/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x5420)[0x7f58f3d458c0]
/usr/lib/libpython2.7.so.1.0(+0x5b76b)[0x7f58f3d0f76b]
/usr/lib/libpython2.7.so.1.0(PyIter_Next+0xb)[0x7f58f3d6808b]
uwsgi(uwsgi_response_subhandler_wsgi+0x55)[0x453425]
uwsgi(uwsgi_request_wsgi+0x3df)[0x45211f]
uwsgi(u_green_request+0x19)[0x466de9]
/lib/x86_64-linux-gnu/libc.so.6(+0x48650)[0x7f58f3704650]
======= Memory map: ========
00400000-0048a000 r-xp 00000000 08:01 103554630                          /usr/local/bin/uwsgi
00689000-0068a000 r--p 00089000 08:01 103554630                          /usr/local/bin/uwsgi
0068a000-00695000 rw-p 0008a000 08:01 103554630                          /usr/local/bin/uwsgi
00695000-0069a000 rw-p 00000000 00:00 0 
02500000-030b6000 rw-p 00000000 00:00 0                                  [heap]
030b6000-04dc5000 rw-p 00000000 00:00 0                                  [heap]
7f5758756000-7f5758817000 rw-p 00000000 00:00 0 
7f5758817000-7f575881a000 r-xp 00000000 08:01 110101494                  /lib/x86_64-linux-gnu/libkeyutils.so.1.4
7f575881a000-7f5758a19000 ---p 00003000 08:01 110101494                  /lib/x86_64-linux-gnu/libkeyutils.so.1.4
7f5758a19000-7f5758a1a000 r--p 00002000 08:01 110101494                  /lib/x86_64-linux-gnu/libkeyutils.so.1.4
7f5758a1a000-7f5758a1b000 rw-p 00003000 08:01 110101494                  /lib/x86_64-linux-gnu/libkeyutils.so.1.4
7f5758a1b000-7f5758a22000 r-xp 00000000 08:01 103548335                  /usr/lib/x86_64-linux-gnu/libkrb5support.so.0.1
7f5758a22000-7f5758c21000 ---p 00007000 08:01 103548335                  /usr/lib/x86_64-linux-gnu/libkrb5support.so.0.1
7f5758c21000-7f5758c22000 r--p 00006000 08:01 103548335                  /usr/lib/x86_64-linux-gnu/libkrb5support.so.0.1
7f5758c22000-7f5758c23000 rw-p 00007000 08:01 103548335                  /usr/lib/x86_64-linux-gnu/libkrb5support.so.0.1
7f5758c23000-7f5758c48000 r-xp 00000000 08:01 103548328                  /usr/lib/x86_64-linux-gnu/libk5crypto.so.3.1
7f5758c48000-7f5758e48000 ---p 00025000 08:01 103548328                  /usr/lib/x86_64-linux-gnu/libk5crypto.so.3.1
7f5758e48000-7f5758e49000 r--p 00025000 08:01 103548328                  /usr/lib/x86_64-linux-gnu/libk5crypto.so.3.1
7f5758e49000-7f5758e4a000 rw-p 00026000 08:01 103548328                  /usr/lib/x86_64-linux-gnu/libk5crypto.so.3.1
7f5758e4a000-7f5758e4b000 rw-p 00000000 00:00 0 
7f5758e4b000-7f5758f0f000 r-xp 00000000 08:01 103548333                  /usr/lib/x86_64-linux-gnu/libkrb5.so.3.3
7f5758f0f000-7f575910e000 ---p 000c4000 08:01 103548333                  /usr/lib/x86_64-linux-gnu/libkrb5.so.3.3
7f575910e000-7f5759118000 r--p 000c3000 08:01 103548333                  /usr/lib/x86_64-linux-gnu/libkrb5.so.3.3
7f5759118000-7f5759119000 rw-p 000cd000 08:01 103548333                  /usr/lib/x86_64-linux-gnu/libkrb5.so.3.3
7f5759119000-7f5759131000 r-xp 00000000 08:01 103552777                  /usr/lib/x86_64-linux-gnu/librtmp.so.0
7f5759131000-7f5759331000 ---p 00018000 08:01 103552777                  /usr/lib/x86_64-linux-gnu/librtmp.so.0
7f5759331000-7f5759332000 r--p 00018000 08:01 103552777                  /usr/lib/x86_64-linux-gnu/librtmp.so.0
7f5759332000-7f5759333000 rw-p 00019000 08:01 103552777                  /usr/lib/x86_64-linux-gnu/librtmp.so.0
7f5759333000-7f575936e000 r-xp 00000000 08:01 103548331                  /usr/lib/x86_64-linux-gnu/libgssapi_krb5.so.2.2
7f575936e000-7f575956e000 ---p 0003b000 08:01 103548331                  /usr/lib/x86_64-linux-gnu/libgssapi_krb5.so.2.2
7f575956e000-7f575956f000 r--p 0003b000 08:01 103548331                  /usr/lib/x86_64-linux-gnu/libgssapi_krb5.so.2.2
7f575956f000-7f5759571000 rw-p 0003c000 08:01 103548331                  /usr/lib/x86_64-linux-gnu/libgssapi_krb5.so.2.2
7f5759571000-7f5759578000 r-xp 00000000 08:01 110101662                  /lib/x86_64-linux-gnu/librt-2.15.so
7f5759578000-7f5759777000 ---p 00007000 08:01 110101662                  /lib/x86_64-linux-gnu/librt-2.15.so
7f5759777000-7f5759778000 r--p 00006000 08:01 110101662                  /lib/x86_64-linux-gnu/librt-2.15.so
7f5759778000-7f5759779000 rw-p 00007000 08:01 110101662                  /lib/x86_64-linux-gnu/librt-2.15.so
7f5759779000-7f57597ab000 r-xp 00000000 08:01 103552757                  /usr/lib/x86_64-linux-gnu/libidn.so.11.6.6
7f57597ab000-7f57599aa000 ---p 00032000 08:01 103552757                  /usr/lib/x86_64-linux-gnu/libidn.so.11.6.6
7f57599aa000-7f57599ab000 r--p 00031000 08:01 103552757                  /usr/lib/x86_64-linux-gnu/libidn.so.11.6.6
7f57599ab000-7f57599ac000 rw-p 00032000 08:01 103552757                  /usr/lib/x86_64-linux-gnu/libidn.so.11.6.6
7f57599ac000-7f5759a01000 r-xp 00000000 08:01 103552724                  /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4.2.0
7f5759a01000-7f5759c01000 ---p 00055000 08:01 103552724                  /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4.2.0
7f5759c01000-7f5759c03000 r--p 00055000 08:01 103552724                  /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4.2.0
7f5759c03000-7f5759c04000 rw-p 00057000 08:01 103552724                  /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4.2.0
7f5759c04000-7f5759c13000 r-xp 00000000 08:01 103553259                  /usr/lib/python2.7/dist-packages/pycurl.so
7f5759c13000-7f5759e12000 ---p 0000f000 08:01 103553259                  /usr/lib/python2.7/dist-packages/pycurl.so
7f5759e12000-7f5759e13000 r--p 0000e000 08:01 103553259                  /usr/lib/python2.7/dist-packages/pycurl.so
7f5759e13000-7f5759e15000 rw-p 0000f000 08:01 103553259                  /usr/lib/python2.7/dist-packages/pycurl.so
7f5759e15000-7f5759e18000 r-xp 00000000 08:01 103551885                  /usr/lib/python2.7/lib-dynload/_heapq.so
7f5759e18000-7f575a017000 ---p 00003000 08:01 103551885                  /usr/lib/python2.7/lib-dynload/_heapq.so
7f575a017000-7f575a018000 r--p 00002000 08:01 103551885                  /usr/lib/python2.7/lib-dynload/_heapq.so
7f575a018000-7f575a01a000 rw-p 00003000 08:01 103551885                  /usr/lib/python2.7/lib-dynload/_heapq.so
7f575a01a000-7f575a76e000 rw-p 00000000 00:00 0 
7f575a76e000-7f575f715000 rw-s 00000000 00:04 1310665                    /dev/zero (deleted)
7f575f715000-7f5764535000 rw-s 00000000 00:04 1310664                    /dev/zero (deleted)
7f5764535000-7f5764ef9000 rw-s 00000000 00:04 1310663                    /dev/zero (deleted)
7f5764ef9000-7f576642f000 rw-s 00000000 00:04 1310662                    /dev/zero (deleted)
7f576642f000-7f576643f000 rw-s 00000000 00:04 1310661                    /dev/zero (deleted)
7f576643f000-7f576b3e6000 rw-s 00000000 00:04 1310660                    /dev/zero (deleted)
7f576b3e6000-7f5770206000 rw-s 00000000 00:04 1310659                    /dev/zero (deleted)
7f5770206000-7f5770bca000 rw-s 00000000 00:04 1310658                    /dev/zero (deleted)
7f5770bca000-7f5772100000 rw-s 00000000 00:04 1310657                    /dev/zero (deleted)
7f5772100000-7f5772110000 rw-s 00000000 00:04 1310656                    /dev/zero (deleted)
7f5772110000-7f57770b7000 rw-s 00000000 00:04 1310655                    /dev/zero (deleted)
7f57770b7000-7f577bed7000 rw-s 00000000 00:04 1310654                    /dev/zero (deleted)
7f577bed7000-7f577c89b000 rw-s 00000000 00:04 1310653                    /dev/zero (deleted)
7f577c89b000-7f577ddd1000 rw-s 00000000 00:04 1310652                    /dev/zero (deleted)
7f577ddd1000-7f577dde1000 rw-s 00000000 00:04 1310651                    /dev/zero (deleted)
7f577dde1000-7f5782d88000 rw-s 00000000 00:04 1310650                    /dev/zero (deleted)
7f5782d88000-7f5787ba8000 rw-s 00000000 00:04 1310649                    /dev/zero (deleted)
7f5787ba8000-7f578856c000 rw-s 00000000 00:04 1310648                    /dev/zero (deleted)
7f578856c000-7f5789aa2000 rw-s 00000000 00:04 1310647                    /dev/zero (deleted)
7f5789aa2000-7f5789ab2000 rw-s 00000000 00:04 1310646                    /dev/zero (deleted)
7f5789ab2000-7f578ea59000 rw-s 00000000 00:04 1310645                    /dev/zero (deleted)
7f578ea59000-7f5793879000 rw-s 00000000 00:04 1310644                    /dev/zero (deleted)
7f5793879000-7f579423d000 rw-s 00000000 00:04 1310643                    /dev/zero (deleted)
7f579423d000-7f5795773000 rw-s 00000000 00:04 1310642                    /dev/zero (deleted)
7f5795773000-7f5795783000 rw-s 00000000 00:04 1310641                    /dev/zero (deleted)
7f5795783000-7f579a72a000 rw-s 00000000 00:04 1310640                    /dev/zero (deleted)
7f579a72a000-7f579f54a000 rw-s 00000000 00:04 1310639                    /dev/zero (deleted)
7f579f54a000-7f579ff0e000 rw-s 00000000 00:04 1310638                    /dev/zero (deleted)
7f579ff0e000-7f57a1444000 rw-s 00000000 00:04 1310637                    /dev/zero (deleted)
7f57a1444000-7f57a1454000 rw-s 00000000 00:04 1310636                    /dev/zero (deleted)
7f57a1454000-7f57a63fb000 rw-s 00000000 00:04 1310635                    /dev/zero (deleted)
7f57a63fb000-7f57ab21b000 rw-s 00000000 00:04 1310634                    /dev/zero (deleted)
7f57ab21b000-7f57abbdf000 rw-s 00000000 00:04 1310633                    /dev/zero (deleted)
7f57abbdf000-7f57ad115000 rw-s 00000000 00:04 1310632                    /dev/zero (deleted)
7f57ad115000-7f57ad125000 rw-s 00000000 00:04 1310631                    /dev/zero (deleted)
7f57ad125000-7f57ad327000 r--p 00000000 08:01 103547856                  /usr/lib/locale/locale-archive
7f57ad359000-7f57ad3db000 rw-p 00000000 00:00 0 
7f57ad3db000-7f57ad3dc000 ---p 00000000 00:00 0 
7f57ad3dc000-7f57ad41c000 rwxp 00000000 00:00 0 

@77cc33
Copy link
Author

77cc33 commented Nov 12, 2012

hi,

finally we solved this issue. this issue is related to curl function curl_multi_fdset and was fixed in libcurl 7.23.0 (curl_multi_fdset: avoid FD_SET out of bounds)

anyway thank you for your help! and please don't drop uGREEN mode, it's much faster and lighter than gevent.

@unbit
Copy link
Owner

unbit commented Nov 12, 2012

uGreen is used in other components too so removing it is not expected ;)

@unbit unbit closed this as completed Nov 12, 2012
jsirois added a commit to jsirois/pex that referenced this issue Jan 23, 2020
It turned out the fundamental issue was a bad version of curl which was
actually hinted at by the dump originally included in pex-tool#477. We've since
updated our linux image to bionic which happened to fix the issue moving
to a newer curl as a side-effect.

This change re-enables disabled tests as well as converting a test
skipped previously due to this blanket issue to a more specific,
legitimate skip. The `.travis.yml` is also cleaned up a bit.

The hint this might be worth pursing came from:
  unbit/uwsgi#37 (comment)

Fixes pex-tool#477
jsirois added a commit to pex-tool/pex that referenced this issue Jan 23, 2020
It turned out the fundamental issue was a bad version of curl which was
actually hinted at by the dump originally included in #477. We've since
updated our linux image to bionic which happened to fix the issue moving
to a newer curl as a side-effect.

This change re-enables disabled tests as well as converting a test
skipped previously due to this blanket issue to a more specific,
legitimate skip. The `.travis.yml` is also cleaned up a bit.

The hint this might be worth pursing came from:
  unbit/uwsgi#37 (comment)

Fixes #477
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