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

attached script causes python segfault #40399

Closed
fmitha mannequin opened this issue Jun 15, 2004 · 4 comments
Closed

attached script causes python segfault #40399

fmitha mannequin opened this issue Jun 15, 2004 · 4 comments
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs)

Comments

@fmitha
Copy link
Mannequin

fmitha mannequin commented Jun 15, 2004

BPO 972917
Nosy @tim-one, @hyeshik
Files
  • python_debug.tar.gz: script and instructions for reproducing bug
  • 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 2004-06-15.02:34:23.000>
    created_at = <Date 2004-06-15.01:41:25.000>
    labels = ['interpreter-core']
    title = 'attached script causes python segfault'
    updated_at = <Date 2004-06-15.02:34:23.000>
    user = 'https://bugs.python.org/fmitha'

    bugs.python.org fields:

    activity = <Date 2004-06-15.02:34:23.000>
    actor = 'tim.peters'
    assignee = 'none'
    closed = True
    closed_date = None
    closer = None
    components = ['Interpreter Core']
    creation = <Date 2004-06-15.01:41:25.000>
    creator = 'fmitha'
    dependencies = []
    files = ['1307']
    hgrepos = []
    issue_num = 972917
    keywords = []
    message_count = 4.0
    messages = ['21188', '21189', '21190', '21191']
    nosy_count = 3.0
    nosy_names = ['tim.peters', 'hyeshik.chang', 'fmitha']
    pr_nums = []
    priority = 'normal'
    resolution = 'wont fix'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue972917'
    versions = ['Python 2.3']

    @fmitha
    Copy link
    Mannequin Author

    fmitha mannequin commented Jun 15, 2004

    I have filed a detailed report at
    http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=252517

    This corresponds to Debian bug bpo-252517

    The python maintainer, Matthias Klose, can reproduce
    this without any Debian patches. On the other hand, I
    cannot reproduce it on either of the two RedHat
    machines I tried. In any case, it seems possible this
    is an upstream problem.

    The operating system is Debian sarge on i386 (Athlon XP
    1700). The version of python I am using 2.3.3, the
    current Debian defaults. The relevant Debian packages are

    ii python2.3 2.3.4-1
    ii python2.3-numarray 0.9-3

    For convenience, I attach a tar.gz file
    (python_debug.tar.gz) which contains enough information
    to reproduce the problem. See the included README.
    Please refer to the Debian bug report for more
    information and comments.

    Please also copy (if possible) the Debian bug report
    with relevant info. You can do so by emailing/ccing
    252517@bugs.debian.org.

    Thanks.
    Faheem.

    @fmitha fmitha mannequin closed this as completed Jun 15, 2004
    @fmitha fmitha mannequin added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Jun 15, 2004
    @fmitha fmitha mannequin closed this as completed Jun 15, 2004
    @fmitha fmitha mannequin added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Jun 15, 2004
    @tim-one
    Copy link
    Member

    tim-one commented Jun 15, 2004

    Logged In: YES
    user_id=31435

    There's no file attached. Note that SourceForge requires
    that you check the "Check to Upload and Attach a File" box,
    it's not enough just to fill in the filepath name.

    @hyeshik
    Copy link
    Contributor

    hyeshik commented Jun 15, 2004

    Logged In: YES
    user_id=55188

    It's just a stack overflow due to excessive recursion calls
    of factorial().

    Your code:
    sys.setrecursionlimit(1000000)

    This may very dangerous in CPython. Consider spanning
    factorial() function to for-loops or using Stackless Python.

    @tim-one
    Copy link
    Member

    tim-one commented Jun 15, 2004

    Logged In: YES
    user_id=31435

    Looking at the original Debian report, I agree with perky that
    the recursive factorial is most likely to blame. Python sets
    the default recursion limit to a much smaller value, because it
    can't reliably detect overflow of the C stack. If you boost it
    above its default, you indeed risk segfaults. The docs for
    setrecursion limit warn about this, too.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 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)
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants