1. Askar Yusupov
  2. pylibcurl
  3. Issues
Issue #3 new

Crash on Mac OS X

Anonymous created an issue

Попробовал запустить на Mac OS X версию 0.7.12. Тест "http_curl.py" вывалился с ошибкой "Segmentation fault" и повалил python.

Comments (4)

  1. Anonymous

    Вот результаты запуска тестов на Маке:

    $ python http_curl.py 
    Segmentation fault
    
    $ python http_multi.py 
    ...E.
    ======================================================================
    ERROR: test_socket_action_epoll (__main__.HttpTest)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "http_multi.py", line 78, in test_socket_action_epoll
        from pylibcurl.shortcuts import event_epoll2curl, event_curl2epoll,\
    ImportError: cannot import name event_epoll2curl
    
    ----------------------------------------------------------------------
    Ran 5 tests in 10.377s
    
    FAILED (errors=1)
    
    
    $ python http_share.py 
    timeout:  1
    timeout:  1
    timeout:  1
    timeout:  1
    timeout:  0
    timeout:  0
    timeout:  0
    timeout:  0
    timeout:  0
    timeout:  0
    timeout:  0
    timeout:  0
    timeout:  0
    timeout:  0
    timeout:  0
    timeout:  0
    timeout:  0
    timeout:  0
    timeout:  0
    timeout:  0
    socket:  3 event:  2
    socket:  5 event:  2
    socket:  6 event:  2
    socket:  7 event:  2
    socket:  8 event:  2
    socket:  9 event:  2
    socket:  10 event:  2
    socket:  11 event:  2
    socket:  12 event:  2
    socket:  13 event:  2
    socket:  14 event:  2
    socket:  15 event:  2
    socket:  16 event:  2
    socket:  17 event:  2
    socket:  18 event:  2
    socket:  19 event:  2
    socket:  20 event:  2
    socket:  21 event:  2
    socket:  22 event:  2
    socket:  23 event:  2
    timeout:  29974
    socket:  3 event:  1
    timeout:  29749
    socket:  5 event:  1
    timeout:  29748
    socket:  7 event:  1
    socket:  8 event:  1
    socket:  9 event:  1
    socket:  12 event:  1
    socket:  6 event:  1
    timeout:  29746
    socket:  10 event:  1
    timeout:  29746
    socket:  11 event:  1
    timeout:  29746
    socket:  14 event:  1
    socket:  13 event:  1
    timeout:  29744
    socket:  15 event:  1
    timeout:  29744
    socket:  16 event:  1
    timeout:  29744
    socket:  17 event:  1
    timeout:  29743
    socket:  18 event:  1
    timeout:  29743
    socket:  21 event:  1
    socket:  22 event:  1
    socket:  23 event:  1
    socket:  19 event:  1
    timeout:  29741
    socket:  20 event:  1
    socket:  22 event:  4
    socket:  15 event:  4
    socket:  5 event:  4
    socket:  3 event:  4
    socket:  6 event:  4
    socket:  10 event:  4
    socket:  19 event:  4
    socket:  9 event:  4
    socket:  13 event:  4
    socket:  16 event:  4
    socket:  21 event:  4
    socket:  7 event:  4
    socket:  12 event:  4
    socket:  20 event:  4
    socket:  18 event:  4
    socket:  11 event:  4
    socket:  17 event:  4
    socket:  8 event:  4
    socket:  14 event:  4
    socket:  23 event:  4
    .
    ----------------------------------------------------------------------
    Ran 1 test in 4.813s
    
    OK
    
    $ python http_stackless.py 
    Traceback (most recent call last):
      File "http_stackless.py", line 3, in <module>
        from pylibcurl._stackless import Curl
      File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pylibcurl/_stackless.py", line 3, in <module>
        import stackless
    ImportError: No module named stackless
    
    $ python thread_curl.py 
    Start url: http://google.com/search?q=машина
    Perform url: http://google.com/search?q=машина
    Start url: http://api.jquery.com/attr/
    Perform url: http://api.jquery.com/attr/
    Start url: http://docs.python.org/library/inspect.html#module-inspect
    Perform url: http://docs.python.org/library/inspect.html#module-inspect
    Done url: http://docs.python.org/library/inspect.html#module-inspect 49925
    Start url: http://docs.djangoproject.com/en/1.2/topics/http/urls/#django.core.urlresolvers.resolve
    Perform url: http://docs.djangoproject.com/en/1.2/topics/http/urls/#django.core.urlresolvers.resolve
    Done url: http://api.jquery.com/attr/ 50328
    Start url: http://docs.djangoproject.com/en/1.2/ref/models/fields/#verbose-name
    Perform url: http://docs.djangoproject.com/en/1.2/ref/models/fields/#verbose-name
    Done url: http://google.com/search?q=машина 81359
    Done url: http://docs.djangoproject.com/en/1.2/topics/http/urls/#django.core.urlresolvers.resolve 84166
    Done url: http://docs.djangoproject.com/en/1.2/ref/models/fields/#verbose-name 118664
    .
    ----------------------------------------------------------------------
    Ran 1 test in 2.345s
    
    OK
    
  2. Anonymous

    Судя по всему, падает вот на этой строке в тесте:

    _curl.httpheader = ['X-Client: 1', 'Bot: 1']
    

    Если их закомментировать, то дальше тест работает.

    $ python http_curl.py 
    
    setUp done
    
    
    start test_curl_error
    
    
    tearDown done
    
    .
    setUp done
    
    
    start test_curl_version
    
    libcurl/7.19.7 OpenSSL/0.9.8l zlib/1.2.3
    age:  3
    version:  7.19.7
    version_num:  463623
    host:  universal-apple-darwin10.0
    features:  573
    ssl_version:  OpenSSL/0.9.8l
    ssl_version_num:  0
    libz_version:  1.2.3
    protocols: 
      tftp
      ftp
      telnet
      dict
      ldap
      http
      file
      https
      ftps
    ares:  None
    ares_num:  0
    libind:  None
    iconv_ver_num:  0
    libssh_version:  None
    
    tearDown done
    
    .
    setUp done
    
    
    start test_get_curl
    
    curl_info
    	cookielist: ['www.yandex.ru\tFALSE\t/\tFALSE\t986580748\tS\t', '.yandex.ru\tTRUE\t/\tFALSE\t986580748\tS\t', '.yandex.ru\tTRUE\t/\tFALSE\t1617300676\tyandexuid\t2064663151301940676']
    	redirect_time: 0.0
    	redirect_count: 0
    	redirect_url: None
    	speed_download: 11379.0
    	effective_url: http://www.yandex.ru
    	ssl_engines: ['dynamic']
    
    tearDown done
    
    .
    setUp done
    
    
    start test_head_curl
    
    
    tearDown done
    
    .
    setUp done
    
    
    start test_n_perform
    
    0
    * About to connect() to www.yandex.ru port 80 (#0)
    *   Trying 77.88.21.3... * connected
    * Connected to www.yandex.ru (77.88.21.3) port 80 (#0)
    > GET / HTTP/1.1
    User-Agent: Opera
    Host: www.yandex.ru
    Accept: */*
    Accept-Encoding: deflate, gzip
    Cookie: yandexuid=2064663151301940676
    
    < HTTP/1.1 200 OK
    < Server: nginx
    < Date: Mon, 04 Apr 2011 18:12:28 GMT
    < Content-Type: text/html; charset=UTF-8
    < Transfer-Encoding: chunked
    < Connection: close
    < Cache-Control: no-cache,no-store,max-age=0,must-revalidate
    < Expires: Mon Apr  4 18:12:29 2011 GMT
    < Last-Modified: Mon Apr  4 18:12:29 2011 GMT
    < P3P: policyref="/w3c/p3p.xml", CP="NON DSP ADM DEV PSD IVDo OUR IND STP PHY PRE NAV UNI"
    * Replaced cookie S="" for domain www.yandex.ru, path /, expire 986580748
    < Set-Cookie: S=; path=/; expires=Fri, 06-Apr-2001 18:12:28 GMT
    * Replaced cookie S="" for domain yandex.ru, path /, expire 986580748
    < Set-Cookie: S=; domain=.yandex.ru; path=/; expires=Fri, 06-Apr-2001 18:12:28 GMT
    < X-XRDS-Location: http://openid.yandex.ru/server_xrds/
    < Content-Encoding: gzip
    < 
    * Closing connection #0
    1
    * About to connect() to www.yandex.ru port 80 (#0)
    *   Trying 77.88.21.3... * connected
    * Connected to www.yandex.ru (77.88.21.3) port 80 (#0)
    > GET / HTTP/1.1
    User-Agent: Opera
    Host: www.yandex.ru
    Accept: */*
    Accept-Encoding: deflate, gzip
    Cookie: yandexuid=2064663151301940676
    
    < HTTP/1.1 200 OK
    < Server: nginx
    < Date: Mon, 04 Apr 2011 18:12:28 GMT
    < Content-Type: text/html; charset=UTF-8
    < Transfer-Encoding: chunked
    < Connection: close
    < Cache-Control: no-cache,no-store,max-age=0,must-revalidate
    < Expires: Mon Apr  4 18:12:29 2011 GMT
    < Last-Modified: Mon Apr  4 18:12:29 2011 GMT
    < P3P: policyref="/w3c/p3p.xml", CP="NON DSP ADM DEV PSD IVDo OUR IND STP PHY PRE NAV UNI"
    * Replaced cookie S="" for domain www.yandex.ru, path /, expire 986580748
    < Set-Cookie: S=; path=/; expires=Fri, 06-Apr-2001 18:12:28 GMT
    * Replaced cookie S="" for domain yandex.ru, path /, expire 986580748
    < Set-Cookie: S=; domain=.yandex.ru; path=/; expires=Fri, 06-Apr-2001 18:12:28 GMT
    < X-XRDS-Location: http://openid.yandex.ru/server_xrds/
    < Content-Encoding: gzip
    < 
    * Closing connection #0
    2
    * About to connect() to www.yandex.ru port 80 (#0)
    *   Trying 77.88.21.3... * connected
    * Connected to www.yandex.ru (77.88.21.3) port 80 (#0)
    > GET / HTTP/1.1
    User-Agent: Opera
    Host: www.yandex.ru
    Accept: */*
    Accept-Encoding: deflate, gzip
    Cookie: yandexuid=2064663151301940676
    
    < HTTP/1.1 200 OK
    < Server: nginx
    < Date: Mon, 04 Apr 2011 18:12:29 GMT
    < Content-Type: text/html; charset=UTF-8
    < Transfer-Encoding: chunked
    < Connection: close
    < Cache-Control: no-cache,no-store,max-age=0,must-revalidate
    < Expires: Mon Apr  4 18:12:29 2011 GMT
    < Last-Modified: Mon Apr  4 18:12:29 2011 GMT
    < P3P: policyref="/w3c/p3p.xml", CP="NON DSP ADM DEV PSD IVDo OUR IND STP PHY PRE NAV UNI"
    * Replaced cookie S="" for domain www.yandex.ru, path /, expire 986580749
    < Set-Cookie: S=; path=/; expires=Fri, 06-Apr-2001 18:12:29 GMT
    * Replaced cookie S="" for domain yandex.ru, path /, expire 986580749
    < Set-Cookie: S=; domain=.yandex.ru; path=/; expires=Fri, 06-Apr-2001 18:12:29 GMT
    < X-XRDS-Location: http://openid.yandex.ru/server_xrds/
    < Content-Encoding: gzip
    < 
    * Closing connection #0
    
    tearDown done
    
    .
    setUp done
    
    
    start test_post_curl
    
    * About to connect() to www.yandex.ru port 80 (#0)
    *   Trying 77.88.21.3... * connected
    * Connected to www.yandex.ru (77.88.21.3) port 80 (#0)
    > POST / HTTP/1.1
    User-Agent: Opera
    Host: www.yandex.ru
    Accept: */*
    Accept-Encoding: deflate, gzip
    Cookie: yandexuid=2064663151301940676
    Content-Length: 96
    Content-Type: application/x-www-form-urlencoded
    
    < HTTP/1.1 200 OK
    < Server: nginx
    < Date: Mon, 04 Apr 2011 18:12:29 GMT
    < Content-Type: text/html; charset=UTF-8
    < Transfer-Encoding: chunked
    < Connection: close
    < Cache-Control: no-cache,no-store,max-age=0,must-revalidate
    < Expires: Mon Apr  4 18:12:29 2011 GMT
    < Last-Modified: Mon Apr  4 18:12:29 2011 GMT
    < P3P: policyref="/w3c/p3p.xml", CP="NON DSP ADM DEV PSD IVDo OUR IND STP PHY PRE NAV UNI"
    * Replaced cookie S="" for domain www.yandex.ru, path /, expire 986580749
    < Set-Cookie: S=; path=/; expires=Fri, 06-Apr-2001 18:12:29 GMT
    * Replaced cookie S="" for domain yandex.ru, path /, expire 986580749
    < Set-Cookie: S=; domain=.yandex.ru; path=/; expires=Fri, 06-Apr-2001 18:12:29 GMT
    < X-XRDS-Location: http://openid.yandex.ru/server_xrds/
    < Content-Encoding: gzip
    < 
    * Closing connection #0
    
    tearDown done
    
    .
    setUp done
    
    
    start test_reset
    
    
    tearDown done
    
    .
    setUp done
    
    
    start test_str_error
    
    
    tearDown done
    
    .
    ----------------------------------------------------------------------
    Ran 8 tests in 1.016s
    
    OK
    

    Дальше, прошу прощения, не разбирался. Но, думаю, что место с ошибкой понятно.

  3. Log in to comment