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

segfault on macOS when running Python getaddrinfo for '0' #930

Closed
aviramha opened this issue Jan 11, 2023 · 1 comment
Closed

segfault on macOS when running Python getaddrinfo for '0' #930

aviramha opened this issue Jan 11, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@aviramha
Copy link
Member

Bug Description

This crashes because the ip is an empty string which for some reason panics.

Steps to Reproduce

import sys, signal
import http.server
import socketserver

# Reading portnumber from command line
if sys.argv[1:]:
  port = int(sys.argv[1])
else:
  port = 90

# Note ForkingTCPServer does not work on Windows as the os.fork()
# function is not available on that OS. Instead we must use the
# subprocess server to handle multiple requests
server = socketserver.ThreadingTCPServer(('',port), http.server.SimpleHTTPRequestHandler )

#Ensures that Ctrl-C cleanly kills all spawned threads
server.daemon_threads = True
#Quicker rebinding
server.allow_reuse_address = True

try:
  while True:
    sys.stdout.flush()
    server.serve_forever()
except KeyboardInterrupt:
  pass

server.server_close()

Backtrace

No response

Relevant Logs

No response

Your operating system and version

macOS

Local process

Python

Local process version

No response

Additional Info

No response

@aviramha aviramha added the bug Something isn't working label Jan 11, 2023
@aviramha
Copy link
Member Author

Closed with #938

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant