xpra icon
Bug tracker and wiki

Opened 9 months ago

Closed 9 months ago

Last modified 9 months ago

#2103 closed defect (fixed)

server auth test fails on macos

Reported by: Antoine Martin Owned by: Antoine Martin
Priority: critical Milestone: 2.5
Component: platforms Version: 2.4.x
Keywords: Cc:

Description

2019-01-11 14:09:24,288 authenticate(..) returncode(['/usr/bin/true', 'Connection request from fake-connection-data', '2'])=0
2019-01-11 14:09:24,289 exec.Authenticator(foo, {'command': '/usr/bin/false', 'timeout': 2, 'connection': 'fake-connection-data'})
2019-01-11 14:09:24,289 exec connection info: fake-connection-data
2019-01-11 14:09:24,289 cannot load password database entry for 'foo'
Traceback (most recent call last):
  File "/Users/gtk3/Xpra/trunk/src/xpra/server/auth/sys_auth_base.py", line 199, in __init__
    self.pw = pwd.getpwnam(username)
KeyError: "getpwnam(): name not found: 'foo'"
2019-01-11 14:09:24,292 authenticate(..) Popen(['/usr/bin/false', 'Connection request from fake-connection-data', '2'])=<subprocess.Popen object at 0x10b1ae550>
2019-01-11 14:09:24,292 add_process(<subprocess.Popen object at 0x10b1ae550>, exec auth, ['/usr/bin/false', 'Connection request from fake-connection-data', '2'], True, True) pid=34975
2019-01-11 14:09:24,293 sigchld(20, <frame at 0x10aae9da0, file '/Users/gtk3/gtk/inst/lib/python3.7/subprocess.py', line 1582, code _try_wait>)
2019-01-11 14:09:24,293 poll() procinfo list: [ProcInfo({'pid': 34975, 'name': 'exec auth', 'command': ['/usr/bin/false', 'Connection request from fake-connection-data', '2'], 'ignore': True, 'forget': True, 'callback': <bound method Authenticator.command_ended of exec>, 'process': <subprocess.Popen object at 0x10b1ae550>, 'returncode': None, 'dead': False})]
2019-01-11 14:09:24,293 reap() calling os.waitpid(-1, 'WNOHANG')
2019-01-11 14:09:24,293 reap() waitpid=34975
2019-01-11 14:09:24,294 add_dead_pid(34975) matches=[ProcInfo({'pid': 34975, 'name': 'exec auth', 'command': ['/usr/bin/false', 'Connection request from fake-connection-data', '2'], 'ignore': True, 'forget': True, 'callback': <bound method Authenticator.command_ended of exec>, 'process': <subprocess.Popen object at 0x10b1ae550>, 'returncode': None, 'dead': False})]
2019-01-11 14:09:24,294 add_dead_process(ProcInfo({'pid': 34975, 'name': 'exec auth', 'command': ['/usr/bin/false', 'Connection request from fake-connection-data', '2'], 'ignore': True, 'forget': True, 'callback': <bound method Authenticator.command_ended of exec>, 'process': <subprocess.Popen object at 0x10b1ae550>, 'returncode': None, 'dead': False}))
2019-01-11 14:09:24,294 add_dead_process returncode=None, dead=False, callback=<bound method Authenticator.command_ended of exec>
2019-01-11 14:09:24,294 Warning: process 'exec auth' is still running
2019-01-11 14:09:24,294 reap() calling os.waitpid(-1, 'WNOHANG')
2019-01-11 14:09:24,294 authenticate(..) returncode(['/usr/bin/false', 'Connection request from fake-connection-data', '2'])=0
FAIL

Change History (2)

comment:1 Changed 9 months ago by Antoine Martin

Status: newassigned

This doesn't make sense:

$ python
Python 3.7.2 (default, Jan 11 2019, 12:43:26) 
[Clang 7.0.2 (clang-700.1.81)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from subprocess import Popen
>>> cmd=['/usr/bin/false', 'Connection request from fake-connection-data', '2']
>>> proc = Popen(cmd, close_fds=True, shell=False)
>>> proc.wait()
1

comment:2 Changed 9 months ago by Antoine Martin

Resolution: fixed
Status: assignedclosed

Looks like a python2 macos bug with poll():

python
>>> import time
>>> from subprocess import Popen
>>> cmd=['/usr/bin/false', 'Connection request from fake-connection-data', '2']
>>> proc = Popen(cmd, close_fds=True, shell=False)
>>> proc.poll()
0
$ python3
Python 3.7.2 (default, Jan 11 2019, 12:43:26) 
[Clang 7.0.2 (clang-700.1.81)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from subprocess import Popen
>>> cmd=['/usr/bin/false', 'Connection request from fake-connection-data', '2']
>>> proc = Popen(cmd, close_fds=True, shell=False)
>>> proc.poll()
1

Workaround in r21343.
python3 still failed during the unit tests, so r21344 applies the workaround to both python versions.

Last edited 9 months ago by Antoine Martin (previous) (diff)
Note: See TracTickets for help on using tickets.