[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

 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
   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
     server = cls._Server(registry, address, authkey, serializer)
   File "/usr/lib/python2.7/multiprocessing/managers.py", line 162, in
     self.listener = Listener(address=address, backlog=16)
   File "/usr/lib/python2.7/multiprocessing/connection.py", line 132, in
     self._listener = SocketListener(address, family, backlog)
   File "/usr/lib/python2.7/multiprocessing/connection.py", line 254, in
   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),
   File "../../aux/btest/btest", line 136, in run
   File "/usr/lib/python2.7/multiprocessing/managers.py", line 528, in
     self._address = reader.recv()

 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 =

  # 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):
 @@ -1158,7 +1158,7 @@ mkdir(BaselineDir)

 -    (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