classification
Title: Work around gethostbyaddr_r bug
Type: crash Stage: resolved
Components: Extension Modules Versions: Python 3.0, Python 3.1, Python 2.7, Python 2.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: collinwinter, jyasskin, rpetrov
Priority: normal Keywords: patch

Created on 2009-01-08 19:08 by jyasskin, last changed 2009-01-10 17:51 by jyasskin. This issue is now closed.

Files
File name Uploaded Description Edit
fix_gethostbyaddr.patch jyasskin, 2009-01-08 19:08
Messages (4)
msg79429 - (view) Author: Jeffrey Yasskin (jyasskin) * (Python committer) Date: 2009-01-08 19:08
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.
msg79485 - (view) Author: Jeffrey Yasskin (jyasskin) * (Python committer) Date: 2009-01-09 18:51
Committed as r68450.
msg79546 - (view) Author: Roumen Petrov (rpetrov) * Date: 2009-01-10 15:31
What about socket_gethostbyname_ex() ?
msg79564 - (view) Author: Jeffrey Yasskin (jyasskin) * (Python committer) Date: 2009-01-10 17:51
socket_gethostbyname_ex() calls gethostbyname_r() rather than
gethostbyaddr_r(), and that appears not to have the bug.
History
Date User Action Args
2009-01-10 17:51:23jyasskinsetmessages: + msg79564
2009-01-10 15:31:56rpetrovsetnosy: + rpetrov
messages: + msg79546
2009-01-09 18:51:16jyasskinsetstatus: open -> closed
resolution: fixed
messages: + msg79485
stage: patch review -> resolved
2009-01-08 19:08:14jyasskincreate