Opened 5 years ago

Closed 5 years ago

#8266 closed defect (fixed)

ValueError: NULL pointer access in stem.util.system.get_process_name()

Reported by: gsathya Owned by: atagar
Priority: Medium Milestone:
Component: Core Tor/Stem Version:
Severity: Keywords:
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

Running integ tests causes -

ERROR: test_set_process_name
----------------------------------------------------------------------
Traceback:
  File "/Users/sathya/Documents/stem/test/integ/util/system.py", line 405, in test_set_process_name
    initial_name = stem.util.system.get_process_name()
  File "/Users/sathya/Documents/stem/stem/util/system.py", line 726, in get_process_name
    if argc[i] is None:
ValueError: NULL pointer access

Child Tickets

Change History (9)

comment:1 Changed 5 years ago by atagar

Status: newneeds_information

comment:2 Changed 5 years ago by gsathya

Ha, I just tried that myself ;)

FAIL: test_set_process_name
----------------------------------------------------------------------
Traceback:
  File "/Users/sathya/Documents/stem/test/integ/util/system.py", line 406, in test_set_process_name
    self.assertTrue("run_tests.py" in initial_name)
AssertionError: False is not true

----------------------------------------------------------------------
Ran 19 tests in 1.342s

Debugging with pdb says, argc is empty and i = 0

comment:3 Changed 5 years ago by atagar

This might be a test that we should skip on your platform (get/set_process_name() may not work everywhere). However, I'm a little surprised that this hasn't come up before since test_set_process_name is pretty old.

Is this OSX? What does 'ps -p <pid> -o args' give you? Do you know something else that'll work on your platform for getting the process name?

comment:4 in reply to:  3 Changed 5 years ago by gsathya

Replying to atagar:

This might be a test that we should skip on your platform (get/set_process_name() may not work everywhere). However, I'm a little surprised that this hasn't come up before since test_set_process_name is pretty old.

Indeed.

Is this OSX?

Yes

What does 'ps -p <pid> -o args' give you?

stem git:(master) : ps -p 60437 -o args 
ARGS
tor --socksport 9050

Do you know something else that'll work on your platform for getting the process name?

Not sure.

comment:5 Changed 5 years ago by atagar

Resolution: fixed
Status: needs_informationclosed

Thanks! This should do the trick...

https://gitweb.torproject.org/stem.git/commitdiff/bdbb508ae2ffcaa5480992d33c28ec52a6e61b7e

Feel free to reopen if it doesn't. :)

comment:6 Changed 5 years ago by gsathya

stem git:(master) : git pull --rebase atagar_https master
error: SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed while accessing https://git.torproject.org/stem.git/info/refs

fatal: HTTP request failed

wow .. my univ proxy is doing some wankery here. I'll check if it's been fixed once I get home :)

comment:7 Changed 5 years ago by gsathya

Resolution: fixed
Status: closedreopened

fun, new stacktrace

ERROR: test_set_process_name
----------------------------------------------------------------------
Traceback:
  File "/Users/sathya/Documents/stem/test/integ/util/system.py", line 412, in test_set_process_name
    stem.util.system.set_process_name(initial_name)
  File "/Users/sathya/Documents/stem/stem/util/system.py", line 774, in set_process_name
    _set_proc_title(process_name)
  File "/Users/sathya/Documents/stem/stem/util/system.py", line 831, in _set_proc_title
    libc.setproctitle(ctypes.byref(name_buffer))
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 366, in __getattr__
    func = self.__getitem__(name)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 371, in __getitem__
    func = self._FuncPtr((name_or_ordinal, self))
AttributeError: dlsym(0x7fff6a41d1e0, setproctitle): symbol not found

comment:8 Changed 5 years ago by atagar

Weee, so many issues with these process renaming functions. Lets try this...

https://gitweb.torproject.org/stem.git/commitdiff/13de78a989b4e9ba68ffcecdd6022335baae4b39

comment:9 in reply to:  8 Changed 5 years ago by gsathya

Resolution: fixed
Status: reopenedclosed

Replying to atagar:

Weee, so many issues with these process renaming functions. Lets try this...

https://gitweb.torproject.org/stem.git/commitdiff/13de78a989b4e9ba68ffcecdd6022335baae4b39

Works. Thanks!

Closing ticket.

Note: See TracTickets for help on using tickets.