[Bro-Dev] [JIRA] (BIT-862) btest path length limitations

Seth Hall (JIRA) jira at bro-tracker.atlassian.net
Sun Feb 9 21:34:37 PST 2014


     [ https://bro-tracker.atlassian.net/browse/BIT-862?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Seth Hall updated BIT-862:
--------------------------

    Assignee: Robin Sommer

> btest path length limitations
> -----------------------------
>
>                 Key: BIT-862
>                 URL: https://bro-tracker.atlassian.net/browse/BIT-862
>             Project: Bro Issue Tracker
>          Issue Type: Problem
>          Components: BTest
>    Affects Versions: git/master
>            Reporter: Jon Siwek
>            Assignee: Robin Sommer
>             Fix For: 2.3
>
>
> btest looks like it fails to create a unix socket when running in paths that are particularly long:
> {noformat}
> 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
> {noformat}
> Doing this change fixes it:
> {noformat}
> 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."
> {noformat}
> 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?



--
This message was sent by Atlassian JIRA
(v6.2-OD-09-036#6252)


More information about the bro-dev mailing list