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

Python 2.7 crashes in Linux environment #74663

Closed
HuyK mannequin opened this issue May 26, 2017 · 4 comments
Closed

Python 2.7 crashes in Linux environment #74663

HuyK mannequin opened this issue May 26, 2017 · 4 comments
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-crash A hard crash of the interpreter, possibly with a core dump

Comments

@HuyK
Copy link
Mannequin

HuyK mannequin commented May 26, 2017

BPO 30478
Nosy @ncoghlan, @mlouielu
Files
  • python_crashes.png: Captured picture about coredump message
  • weather_station.py: Python application
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2017-05-26.02:52:54.074>
    created_at = <Date 2017-05-26.01:48:32.322>
    labels = ['interpreter-core', 'type-crash']
    title = 'Python 2.7 crashes in Linux environment'
    updated_at = <Date 2017-05-26.02:52:54.061>
    user = 'https://bugs.python.org/HuyK'

    bugs.python.org fields:

    activity = <Date 2017-05-26.02:52:54.061>
    actor = 'ncoghlan'
    assignee = 'none'
    closed = True
    closed_date = <Date 2017-05-26.02:52:54.074>
    closer = 'ncoghlan'
    components = ['Interpreter Core']
    creation = <Date 2017-05-26.01:48:32.322>
    creator = 'HuyK'
    dependencies = []
    files = ['46903', '46904']
    hgrepos = []
    issue_num = 30478
    keywords = []
    message_count = 4.0
    messages = ['294520', '294525', '294527', '294528']
    nosy_count = 3.0
    nosy_names = ['ncoghlan', 'louielu', 'HuyK']
    pr_nums = []
    priority = 'normal'
    resolution = 'third party'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'crash'
    url = 'https://bugs.python.org/issue30478'
    versions = ['Python 2.7']

    @HuyK
    Copy link
    Mannequin Author

    HuyK mannequin commented May 26, 2017

    Hi all,

    I have a python script to run as a Weather Station application. The python script runs on Raspberry Pi 3 board. It gets weather data from OpenWeatherMap website and sends result to a remote touch-screen device via COM port to display

    It uses two main libraries to handle the task:
    https://pypi.python.org/pypi/ftd2xx
    https://github.com/csparpa/pyowm

    I got the python script just exits without any error after sometimes. Checking the return code with the command "echo $?" in Pi's console window and got 139 which means a Segmentation Fault

    We tried to generate coredump system when the python script crashes and we got this:
    "Core was generated by 'python weather_station.py'
    Program terminated with signal SIGSEGV, Segmentation fault.
    #0 0x0005b614 in complex_subtype_from_string (type=0x746150, v=0x72616843) at ../Objects/complexobject.c:1075"

    I tried to update to Python 2.7.13 but the crashes still happens.

    My question is if the segmentation fault related to complexobject.c has been reported and fixed?

    Best regards,
    HuyK

    @HuyK HuyK mannequin added interpreter-core (Objects, Python, Grammar, and Parser dirs) type-crash A hard crash of the interpreter, possibly with a core dump labels May 26, 2017
    @mlouielu
    Copy link
    Mannequin

    mlouielu mannequin commented May 26, 2017

    Hi Huyk, which version of Python does the error message generated?

    Also, could you try to provide a minimum reproduce python script and upload it? it will be more easy to debug this problem if we can reproduce this.

    @HuyK
    Copy link
    Mannequin Author

    HuyK mannequin commented May 26, 2017

    Hi Louie Lu,

    You will need a touch-screen device running corresponding firmware in order to run the python application. FYI, I tried to run only weather data fetching or only COM port communication but the crash did not happen. It happens when I run both tasks.
    Anyway, I attach the python script for your reference.
    First, I got the issue with 2.7.9. And after updating to 2.7.13, I still get the crash issue

    Thanks,
    HuyK

    @ncoghlan
    Copy link
    Contributor

    Hi HuyK, thanks for the issue report, and in particular the pointers to the key external libraries the script uses.

    It seems ftd2xx relies on ctypes to wrap an external library, which means that this report falls under the general policy of "triggering a segfault with ctypes is assumed to be a bug in the usage of ctypes, rather than a bug in ctypes itself".

    If you'd like to investigate further before filing a bug report with the ftd2xx authors, you may want to try out the Python 2.7 backport of Python 3's faulthandler library: https://faulthandler.readthedocs.io/

    That should be able to give you a Python traceback at the point where the segfault occurs, rather than trying to reverse engineer that information from the core dump.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    interpreter-core (Objects, Python, Grammar, and Parser dirs) type-crash A hard crash of the interpreter, possibly with a core dump
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant