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

Abort on TrueOS (FreeBSD 12) in stream_engine #2761

Closed
hxw opened this issue Sep 29, 2017 · 5 comments
Closed

Abort on TrueOS (FreeBSD 12) in stream_engine #2761

hxw opened this issue Sep 29, 2017 · 5 comments

Comments

@hxw
Copy link
Contributor

hxw commented Sep 29, 2017

Issue description

I am seeing an error on close:

Connection reset by peer (src/stream_engine.cpp:157)
Abort trap

Environment

  • libzmq 4.2.2
  • OS: TrueOS (FreeBSD 12)

Problem code

Appears to be the use of a FreeBSD specific code to ignore that specific error that does not actually get included

Locating the code

# grep -nHr __FreeBSD_kernel__ work/zeromq-4.2.2/src/
work/zeromq-4.2.2/src/stream_engine.cpp:156:#ifdef __FreeBSD_kernel__
work/zeromq-4.2.2/src/thread.cpp:149:#ifdef __FreeBSD_kernel__

The symbol: __FreeBSD_kernel__ is only defined if sys/param.h is included.
Since sys/param.h is not generally included by other source files,
I suggest changing both occurences of __FreeBSD_kernel__ to __FreeBSD__
would be the simplest option.

Here is a diff: zmq4.diff.txt to change the two files.

@bluca
Copy link
Member

bluca commented Sep 29, 2017

Hi,

__FreeBSD_kernel__ is the definition exported by Debian's kFreeBSD port, so it looks like the right solution is to check for either of them: #if defined(__FreeBSD_kernel__) || defined (__FreeBSD__)

Could you please test if that works, and if so, send a pull request? Thanks!

@hxw
Copy link
Contributor Author

hxw commented Oct 2, 2017

I have made the change on my system, and will run for a couple of days; then make pull request.

@bluca
Copy link
Member

bluca commented Oct 2, 2017

Great, thanks

@hxw
Copy link
Contributor Author

hxw commented Oct 5, 2017

I have over 48hr of run time on my program with this patch, so I sent it as a pull request

@bluca
Copy link
Member

bluca commented Oct 5, 2017

Merged, thank you very much!

@bluca bluca closed this as completed Oct 5, 2017
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