Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ConnectionTestSuite.h hangs in MacOS #146

Open
phmasek opened this issue Jan 10, 2017 · 9 comments
Open

ConnectionTestSuite.h hangs in MacOS #146

phmasek opened this issue Jan 10, 2017 · 9 comments

Comments

@phmasek
Copy link
Contributor

phmasek commented Jan 10, 2017

I've traced a ConnectionTestSuite.h timeout failure to one line of code.

This line hangs when the testsuite runs. This results in a testsuite timeout without any Errors other than a timeout in accordance to this variable.

More specifically I believe it is a bug related to function ssize_t send(int, const void *, size_t, int); found in sys/socket.h.

@chrberger
Copy link
Contributor

Can you please test changing the port from 12345 to 12347 in this test case:

Let's test if the socket from the first test case is in a "closing" state making it not readily available for the last test case.

@phmasek
Copy link
Contributor Author

phmasek commented Jan 11, 2017

Didn't work. I get the same issue after changing both the acceptor port and connection port to 12347.

@chrberger
Copy link
Contributor

Can you systematically disable two out of the three test cases by added "no" to the test cases' method name to see, what test case passes and what no?

@phmasek
Copy link
Contributor Author

phmasek commented Jan 17, 2017

testErrorHandler()and testAcceptAndConnect() work flawlessly by themselves while testTransfer() does not work no matter configuration.

@phmasek
Copy link
Contributor Author

phmasek commented Jan 17, 2017

It actually seems to be failing at this line https://github.com/se-research/OpenDaVINCI/blob/master/libopendavinci/src/odcore/data/Container.cpp#L254

This is probably a result of the performance improvements which were committed here. Not sure why this works in Linux but not MacOS, any clue?

@chrberger
Copy link
Contributor

@pletron: is this issue still relevant?

@phmasek
Copy link
Contributor Author

phmasek commented Jun 11, 2017

@chrberger I've done some digging. It seems that the function pubsetbuf at line 212 and 227 does not do anything in the standard c++ library in Mac OS, it simply returns this.

Here is a post regarding the same issue, however, the link refers to an issue in Microsoft Visual Studio. I had a look in the c++ library files in Mac OS and found that the case is the same for Mac OS. Here is a snippet with the function from Mac OS.

A possible fix might be to use the function sputn (reference) although I'm not very familiar with these parts of c++.

@chrberger
Copy link
Contributor

@Pletron Thanks for the description; your pastebin snippet refers to the super-class basic_streambuf. The comment suggests that deriving subclasses shall overwrite that behavior. Can you verify that stringstream is indeed not overwriting that behavior?

@chrberger
Copy link
Contributor

@Pletron The lines 212 and 227 could also be changed with an #ifdef directive separating MacOS/Win from "correct" implementations by simply copying the content from vector into bufferIn (even though that might be expensive).

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

No branches or pull requests

2 participants