Skip to content

Makefile: Fix build on ubuntu 16.04 with pkg-config.#626

Merged
sangjinhan merged 1 commit intoNetSys:masterfrom
ddiproietto:fix_makefile_ubuntu1604
Sep 4, 2017
Merged

Makefile: Fix build on ubuntu 16.04 with pkg-config.#626
sangjinhan merged 1 commit intoNetSys:masterfrom
ddiproietto:fix_makefile_ubuntu1604

Conversation

@ddiproietto
Copy link
Copy Markdown
Contributor

Instead of listing twice the libraries that we want to link dynamically
with, we can simply filter those out from the result of pkg-config.

This should fix the build in ubuntu 16.04 (although I wasn't able to
reproduce the problem).

Reported and suggested by @Codeacious

Instead of listing twice the libraries that we want to link dynamically
with, we can simply filter those out from the result of pkg-config.

This should fix the build in ubuntu 16.04 (although I wasn't able to
reproduce the problem).

Reported and suggested by @Codeacious
@Codeacious
Copy link
Copy Markdown

I'm able to build successfully with this change. Thanks!

@chris3torek
Copy link
Copy Markdown
Collaborator

I don't see why this is stalling on Travis, but something goes wrong during test_list_modules (pybess.test_bess.TestBESS) ... (test never finishes). It seems to be consistent though: all six of the matrix builds stall out in the same spot.

@xnhp0320
Copy link
Copy Markdown

Hi, have this Travis issued been fixed? I am also hitting on this issue, and by using your patch, I can build bess now.

@ddiproietto
Copy link
Copy Markdown
Contributor Author

I'm still investigating the issue, it doesn't appear to be related to this PR.

I can reproduce the problem locally by upgrading python grpcio to 1.6.0 (@chris3torek and I noticed that it has been updated on pypi yesterday).

test_kill appears to cause problems (

def test_kill(self):
), if I skip it everything seems fine.

This is the output with debug set to true (

self.debug = False
), it appears that the channel doesn't recover from TRANSIENT_FAILURE

I'm still investigating, worst case we can ask pip to install grpcio 1.4.0

test_connect (pybess.test_bess.TestBESS) ... Channel status: None -> ChannelConnectivity.IDLE
Channel status: ChannelConnectivity.IDLE -> ChannelConnectivity.CONNECTING
Channel status: ChannelConnectivity.CONNECTING -> ChannelConnectivity.READY
ok
test_create_port (pybess.test_bess.TestBESS) ... Channel status: None -> ChannelConnectivity.IDLE
Channel status: ChannelConnectivity.IDLE -> ChannelConnectivity.CONNECTING
Channel status: ChannelConnectivity.CONNECTING -> ChannelConnectivity.READY
==== /bess.pb.BESSControl/CreatePort
---> CreatePortRequest
{'arg': {'type_url': 'type.googleapis.com/bess.pb.PCAPPortArg',
         'value': '\n\x03rnd'},
 'driver': 'PCAPPort',
 'name': 'p0'}
<--- CreatePortResponse
{'name': 'p0'}
==== /bess.pb.BESSControl/CreatePort
---> CreatePortRequest
{'arg': {'type_url': 'type.googleapis.com/bess.pb.PMDPortArg',
         'value': '\x08\x01\x10\xf5o'},
 'driver': 'PMDPort',
 'name': 'p0'}
<--- CreatePortResponse
{'name': 'p0'}
==== /bess.pb.BESSControl/CreatePort
---> CreatePortRequest
{'arg': {'type_url': 'type.googleapis.com/bess.pb.UnixSocketPortArg',
         'value': '\n\t/ajksd/dd'},
 'driver': 'UnixSocketPort',
 'name': 'p0'}
<--- CreatePortResponse
{'name': 'p0'}
==== /bess.pb.BESSControl/CreatePort
---> CreatePortRequest
{'arg': {'type_url': 'type.googleapis.com/bess.pb.VPortArg',
         'value': '\n\x05veth0\x18\xd4\xb4\x01*\x03\x01\x02\x030{8{J\x071.2.3.4J\x0f255.254.253.252'},
 'driver': 'VPort',
 'name': 'p0'}
<--- CreatePortResponse
{'name': 'p0'}
Channel status: ChannelConnectivity.READY -> ChannelConnectivity.TRANSIENT_FAILURE
Channel status: AbnormalDisconnection -> ChannelConnectivity.IDLE
ok
test_kill (pybess.test_bess.TestBESS) ... Channel status: None -> ChannelConnectivity.IDLE
Channel status: ChannelConnectivity.IDLE -> ChannelConnectivity.CONNECTING
Channel status: ChannelConnectivity.CONNECTING -> ChannelConnectivity.READY
==== /bess.pb.BESSControl/KillBess
---> EmptyRequest
<--- EmptyResponse
ok
test_list_modules (pybess.test_bess.TestBESS) ... Channel status: None -> ChannelConnectivity.IDLE
Channel status: ChannelConnectivity.IDLE -> ChannelConnectivity.READY
==== /bess.pb.BESSControl/ListModules
---> EmptyRequest
<--- ListModulesResponse
Channel status: ChannelConnectivity.READY -> ChannelConnectivity.TRANSIENT_FAILURE
ok
test_run_module_command (pybess.test_bess.TestBESS)Channel status: AbnormalDisconnection -> ChannelConnectivity.IDLE
 ... Channel status: None -> ChannelConnectivity.IDLE
Channel status: ChannelConnectivity.IDLE -> ChannelConnectivity.TRANSIENT_FAILURE
Channel status: ChannelConnectivity.TRANSIENT_FAILURE -> ChannelConnectivity.IDLE
�Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/lib/python2.7/unittest/__main__.py", line 12, in <module>
    main(module=None)
  File "/usr/lib/python2.7/unittest/main.py", line 95, in __init__
    self.runTests()
  File "/usr/lib/python2.7/unittest/main.py", line 232, in runTests
    self.result = testRunner.run(self.test)
  File "/usr/lib/python2.7/unittest/runner.py", line 151, in run
    test(result)
  File "/usr/lib/python2.7/unittest/suite.py", line 70, in __call__
    return self.run(*args, **kwds)
  File "/usr/lib/python2.7/unittest/suite.py", line 108, in run
    test(result)
  File "/usr/lib/python2.7/unittest/suite.py", line 70, in __call__
    return self.run(*args, **kwds)
  File "/usr/lib/python2.7/unittest/suite.py", line 108, in run
    test(result)
  File "/usr/lib/python2.7/unittest/suite.py", line 70, in __call__
    return self.run(*args, **kwds)
  File "/usr/lib/python2.7/unittest/suite.py", line 108, in run
    test(result)
  File "/usr/lib/python2.7/unittest/case.py", line 393, in __call__
    return self.run(*args, **kwds)
  File "/usr/lib/python2.7/unittest/case.py", line 329, in run
    testMethod()
  File "/home/ddp/bess/pybess/test_bess.py", line 138, in test_run_module_command
    client.connect(port=self.PORT)
  File "/home/ddp/bess/pybess/bess.py", line 193, in connect
    time.sleep(0.1)
KeyboardInterrupt

@sangjinhan
Copy link
Copy Markdown
Member

In my local setup, the test suite failed even without test_kill; test_list_modules succeeds but its next one fails...

With some investigation, I am fairly certain that it's a bug of grpc 1.6.0. If a channel has been closed by the server (self.server.stop()), in some conditions the client doesn't seem to create a new socket for subsequent channels but tries to reuse the already broken file descriptor (shutdown()ed but not close()ed).

#628 would work, but given that pip does not support maintaining multiple package versions, forcing a specific version of grpcio could interfere with other applications using the package.

As a (not ideal either) workaround, we can launch/terminate the dummy gRPC server per testcase (rather than per individual test), so that the channel is not disrupted by between every two tests. This can be done by simply switching setUp()/tearDown() to setUpClass()/tearDownClass().

@codecov
Copy link
Copy Markdown

codecov Bot commented Sep 1, 2017

Codecov Report

Merging #626 into master will increase coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #626      +/-   ##
=========================================
+ Coverage    69.3%   69.3%   +<.01%     
=========================================
  Files         204     204              
  Lines       13072   13078       +6     
=========================================
+ Hits         9059    9064       +5     
- Misses       4013    4014       +1
Impacted Files Coverage Δ
core/modules/flowgen.cc 73.7% <0%> (-0.38%) ⬇️
pybess/test_bess.py 100% <0%> (ø) ⬆️
pybess/bess.py 43.09% <0%> (+0.06%) ⬆️
core/drivers/unix_socket.cc 81.67% <0%> (+1.52%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 78c6c00...229392a. Read the comment docs.

Copy link
Copy Markdown
Collaborator

@chris3torek chris3torek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like the right fix, we get the statics and dynamics all listed separately now.

@sangjinhan sangjinhan merged commit 57497af into NetSys:master Sep 4, 2017
@sangjinhan
Copy link
Copy Markdown
Member

tumblr_mbvspunb551qhwmnpo1_1280

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants