推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
love
V2EX  ›  Python

python 程序随机 segment fault 有什么方法知道是哪个模块抛的吗?

  •  
  •   love · Jun 9, 2015 · 4208 views
    This topic created in 4167 days ago, the information mentioned may be changed or developed.
    线上的程序随机打印一句segment fault就死翘了,没有栈信息。
    代码太复杂很难一块块定位,有什么办法知道是哪个语句的问题吗?

    我估计是lxml或pillow其中一个,因为只有这二个用了原生代码。
    8 replies  •  2015-06-25 17:11:59 +08:00
    skydiver
    skydiver
    Jun 9, 2015❤️1
    1
    看吐的core dump呗……
    jokester
    jokester
    Jun 9, 2015❤️1
    2
    segfault的地方(時間和代碼位置)可能和native lib差非常遠
    有條件的話隔離開做壓力測試吧..
    ca1n
    ca1n
    Jun 10, 2015
    3
    core dump....不过超级麻烦 也可以单步调试 有次我也是出segement fault 更新了一下第三方模块就好了
    love
    love
    OP
    Jun 10, 2015
    4
    我去。。。lxml和pillow的嫌疑都被排除了,纯py都会segfault,怀疑是系统问题了。

    @ca1n 你是哪个模块有问题,是带C模块吗?
    ca1n
    ca1n
    Jun 10, 2015
    5
    @love 具体忘了哪个模块了 某个上层http模块应该是 你更新一下系统试试
    startover
    startover
    Jun 13, 2015
    6
    你这个问题,用oneapm(国内)或newrelic(国外)应该就很好定位
    xiazi
    xiazi
    Jun 16, 2015
    7
    ctypes可能会segfault, 你为什么不在debugger下运行python
    hayao650
    hayao650
    Jun 25, 2015
    8
    应该会有core文件吧,dbx core可以查看哪里出问题
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1282 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 20:29 · PVG 04:29 · LAX 12:29 · JFK 15:29
    ♥ Do have faith in what you're doing.