diff options
author | Jimmy Olgeni <olgeni@FreeBSD.org> | 2016-02-16 22:20:16 +0000 |
---|---|---|
committer | Jimmy Olgeni <olgeni@FreeBSD.org> | 2016-02-16 22:20:16 +0000 |
commit | d528e16020d697be0ef471e7d39d276840c3221c (patch) | |
tree | 28691a02775b3caf8e135d20f4d449ac94ce8ece /net/rabbitmq | |
parent | bcbf138f72ebeba5a9ece840b27d6ad2c91e61bd (diff) | |
download | ports-d528e16020d697be0ef471e7d39d276840c3221c.tar.gz ports-d528e16020d697be0ef471e7d39d276840c3221c.zip |
Remove custom stderr formatting from net/rabbitmq.
From upstream commit fecd0e5 in rabbitmq/rabbitmq-common:
Opening several ports for single fd is considered undefined behaviour
in erlang. It's safe to replace this whole function with 'io:format'.
Because writing to standard_error with io:format is synchronous - after
this call has returned data was definitely sent to the port. And
`erlang:halt` guarantees that this data will be flushed afterwards.
See also ba531a1 in erlang/otp:
Instead of outputting a formatted message showing errors found, a core
was (often) created.
This commit should fix all issues related to core dumps with RabbitMQ on
Erlang 18, which were most often observed when creating or joining
clusters.
MFH requested because a beam core dump would be most certainly interpreted
as the symptom of something worse within the Erlang VM.
PR: 204147
Submitted by: Alexey Lebedeff (follow up)
MFH: 2016Q1
Notes
Notes:
svn path=/head/; revision=409020
Diffstat (limited to 'net/rabbitmq')
-rw-r--r-- | net/rabbitmq/Makefile | 2 | ||||
-rw-r--r-- | net/rabbitmq/files/patch-src_rabbit__misc.erl | 22 |
2 files changed, 23 insertions, 1 deletions
diff --git a/net/rabbitmq/Makefile b/net/rabbitmq/Makefile index ed7afe999fab..a5a2ff280be3 100644 --- a/net/rabbitmq/Makefile +++ b/net/rabbitmq/Makefile @@ -3,7 +3,7 @@ PORTNAME= rabbitmq PORTVERSION= 3.5.7 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= net MASTER_SITES= http://www.rabbitmq.com/releases/rabbitmq-server/v${PORTVERSION}/ DISTNAME= ${PORTNAME}-server-${PORTVERSION} diff --git a/net/rabbitmq/files/patch-src_rabbit__misc.erl b/net/rabbitmq/files/patch-src_rabbit__misc.erl new file mode 100644 index 000000000000..8d22f46b7e1d --- /dev/null +++ b/net/rabbitmq/files/patch-src_rabbit__misc.erl @@ -0,0 +1,22 @@ +--- src/rabbit_misc.erl.orig 2015-12-15 10:23:52 UTC ++++ src/rabbit_misc.erl +@@ -652,18 +652,7 @@ format_many(List) -> + lists:flatten([io_lib:format(F ++ "~n", A) || {F, A} <- List]). + + format_stderr(Fmt, Args) -> +- case os:type() of +- {unix, _} -> +- Port = open_port({fd, 0, 2}, [out]), +- port_command(Port, io_lib:format(Fmt, Args)), +- port_close(Port); +- {win32, _} -> +- %% stderr on Windows is buffered and I can't figure out a +- %% way to trigger a fflush(stderr) in Erlang. So rather +- %% than risk losing output we write to stdout instead, +- %% which appears to be unbuffered. +- io:format(Fmt, Args) +- end, ++ io:format(standard_error, Fmt, Args), + ok. + + unfold(Fun, Init) -> |