[Bro-Dev] #862: btest path length limitations

Bro Tracker bro at tracker.bro-ids.org
Thu Aug 2 13:19:19 PDT 2012


#862: btest path length limitations
---------------------+------------------------
 Reporter:  jsiwek   |      Owner:
     Type:  Problem  |     Status:  new
 Priority:  Normal   |  Milestone:  Bro2.2
Component:  BTest    |    Version:  git/master
 Keywords:           |
---------------------+------------------------
 btest looks like it fails to create a unix socket when running in paths
 that are particularly long:

 {{{
 jenkins at ubuntu12-04:btest$ pwd
 /home/jenkins/workspace/BuildAll/label/Ubuntu_12.04_x86_64/bro/testing/btest

 jenkins at ubuntu12-04:btest$ ../../aux/btest/btest core/
 Process TestManager-1:
 Traceback (most recent call last):
   File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in
 _bootstrap
     self.run()
   File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run
     self._target(*self._args, **self._kwargs)
   File "/usr/lib/python2.7/multiprocessing/managers.py", line 550, in
 _run_server
     server = cls._Server(registry, address, authkey, serializer)
   File "/usr/lib/python2.7/multiprocessing/managers.py", line 162, in
 __init__
     self.listener = Listener(address=address, backlog=16)
   File "/usr/lib/python2.7/multiprocessing/connection.py", line 132, in
 __init__
     self._listener = SocketListener(address, family, backlog)
   File "/usr/lib/python2.7/multiprocessing/connection.py", line 254, in
 __init__
     self._socket.bind(address)
   File "/usr/lib/python2.7/socket.py", line 224, in meth
     return getattr(self._sock,name)(*args)
 error: AF_UNIX path too long
 Traceback (most recent call last):
   File "../../aux/btest/btest", line 1162, in <module>
     (succeeded, failed, skipped) = TestManager().run(copy.deepcopy(tests),
 output_handler)
   File "../../aux/btest/btest", line 136, in run
     self.start()
   File "/usr/lib/python2.7/multiprocessing/managers.py", line 528, in
 start
     self._address = reader.recv()
 EOFError
 }}}

 Doing this change fixes it:

 {{{
 iff --git a/btest b/btest
 index fedaa63..dee3247 100755
 --- a/btest
 +++ b/btest
 @@ -129,8 +129,8 @@ ConfigParser.ConfigParser._interpolate =
 cpExpandBackticks

  # Main class distributing the work across threads.
  class TestManager(multiprocessing.managers.SyncManager):
 -    def __init__(self):
 -        super(TestManager, self).__init__()
 +    def __init__(self, *args, **kwargs):
 +        super(TestManager, self).__init__(*args, **kwargs)

      def run(self, tests, output_handler):
          self.start()
 @@ -1158,7 +1158,7 @@ mkdir(BaselineDir)
  mkdir(TmpDir)

  try:
 -    (succeeded, failed, skipped) =
 TestManager().run(copy.deepcopy(tests), output_handler)
 +    (succeeded, failed, skipped) =
 TestManager(address="/tmp/blah").run(copy.deepcopy(tests), output_handler)
      total = succeeded + failed + skipped
  except KeyboardInterrupt:
      print >>sys.stderr, "Aborted."
 }}}

 But obviously the path of the socket should be determined more
 dynamically.  I didn't know if it always makes sense to try to use
 something short in /tmp or should it only be changed through a command
 line switch?

-- 
Ticket URL: <http://tracker.bro-ids.org/bro/ticket/862>
Bro Tracker <http://tracker.bro-ids.org/bro>
Bro Issue Tracker



More information about the bro-dev mailing list