Skip to content

Work around gethostbyaddr_r bug #49134

Closed
Closed

Description

@jyasskin
mannequin
BPO 4884
Files
  • fix_gethostbyaddr.patch
  • 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 2009-01-09.18:51:16.648>
    created_at = <Date 2009-01-08.19:08:14.134>
    labels = ['extension-modules', 'type-crash']
    title = 'Work around gethostbyaddr_r bug'
    updated_at = <Date 2009-01-10.17:51:23.972>
    user = 'https://bugs.python.org/jyasskin'

    bugs.python.org fields:

    activity = <Date 2009-01-10.17:51:23.972>
    actor = 'jyasskin'
    assignee = 'none'
    closed = True
    closed_date = <Date 2009-01-09.18:51:16.648>
    closer = 'jyasskin'
    components = ['Extension Modules']
    creation = <Date 2009-01-08.19:08:14.134>
    creator = 'jyasskin'
    dependencies = []
    files = ['12654']
    hgrepos = []
    issue_num = 4884
    keywords = ['patch']
    message_count = 4.0
    messages = ['79429', '79485', '79546', '79564']
    nosy_count = 3.0
    nosy_names = ['collinwinter', 'jyasskin', 'rpetrov']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'crash'
    url = 'https://bugs.python.org/issue4884'
    versions = ['Python 2.6', 'Python 3.0', 'Python 3.1', 'Python 2.7']

    Activity

    1. jyasskin commented on Jan 8, 2009

      jyasskinmannequin
      MannequinAuthor

      glibc until 2.10 has a bug in gethostbyaddr_r that assumes the buffer
      argument is 8-byte aligned
      (http://sources.redhat.com/ml/libc-alpha/2009-01/msg00000.html). gcc
      seems to always provide such alignment for the call in
      socketmodule.c:socket_gethostbyaddr(), but llvm-gcc (possibly only HEAD,
      not 2.4) does not, which causes a segfault in test_socket.py. The llvm
      bug investigating the problem is http://llvm.org/bugs/show_bug.cgi?id=3233.

      The attached patch specifies the alignment so that llvm-gcc and unfixed
      glibcs work together.

      I'll commit this tomorrow if there are no objections.

    2. added
      type-crashA hard crash of the interpreter, possibly with a core dump
      on Jan 8, 2009
    3. jyasskin commented on Jan 9, 2009

      jyasskinmannequin
      MannequinAuthor

      Committed as r68450.

    4. rpetrov commented on Jan 10, 2009

      rpetrovmannequin
      Mannequin

      What about socket_gethostbyname_ex() ?

    5. jyasskin commented on Jan 10, 2009

      jyasskinmannequin
      MannequinAuthor

      socket_gethostbyname_ex() calls gethostbyname_r() rather than
      gethostbyaddr_r(), and that appears not to have the bug.

    6. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      extension-modulesC modules in the Modules dirtype-crashA hard crash of the interpreter, possibly with a core dump

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions