From jesper.louis.andersen@REDACTED Tue Feb 1 23:22:00 2011 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Tue, 1 Feb 2011 23:22:00 +0100 Subject: Patch to remove useless casts from the ERTS emulator Message-ID: This patch, git fetch git://github.com/jlouis/otp.git cocci-useless-cast serves two purposes. First, it removes all useless casts from the C code of the ERTS emulator. A useless cast is a cast of an expression that already has the type casted into. Second, it is an attempt to use Coccinelle, http://coccinelle.lip6.fr/ on the Erlang C source. While this is a simple Coccinelle-patch it is highly useful for doing transformations in-the-large on the code base as a whole. The semantic patch used is a mere 7 lines, but the patch in the branch is 120 changes. I have run the test suite for the emulator part only and it passes that. The caveat, however, is that I can only run a single platform here. Thus, I hope for an inclusion into 'pu' for some more cooking. I am also aware you may refrain from taking this patch as it is too invasive. On the other hand, useless casts are potentially dangerous if the type of the value is changed later as the cast then masks the type error that would have otherwise occurred. -- J. From taylor@REDACTED Wed Feb 2 01:26:04 2011 From: taylor@REDACTED (Taylor Venable) Date: Tue, 1 Feb 2011 19:26:04 -0500 Subject: Patch for infinite loop in edoc Message-ID: Hi, this is my first patch for Erlang/OTP and also my first time using Git, so hopefully I've done it OK. The command to fetch the patch is: git fetch git://github.com/metasyntax/otp.git edoc_loop_fix The change is simple: modify edoc_wiki:strip_empty_lines/2 to return when passed an empty list. This is the case when the end of the edoc comment is encountered after a starting ``` sequence, but before an ending ''' sequence. Without this patch, processing the following file with edoc triggers an infinite recursion in strip_empty_lines/2: ==== test.erl ==== %% @doc start %% ``` %% ''' %% end -module(test). -export([foo/0]). foo() -> ok. ==== END OF FILE ==== This only affects using ``` because neither `` nor ` call strip_empty_lines/1. With this patch in place, this input file causes the same error behaviour that using `` or ` does: 2> edoc:get_doc("test.erl"). test.erl, in module header: at line 2: ```-quote ended unexpectedly at line 2 ** exception exit: error in function edoc_tags:parse_tag/4 in call from edoc_tags:parse_tags/5 in call from edoc_extract:get_tags/5 in call from edoc_extract:source/4 Thanks, -- Taylor C. Venable http://metasyntax.net/ From burbas@REDACTED Wed Feb 2 10:52:32 2011 From: burbas@REDACTED (Niclas Axelsson) Date: Wed, 2 Feb 2011 10:52:32 +0100 Subject: [erlang-patches] Patch to remove useless casts from the ERTS emulator In-Reply-To: References: Message-ID: <4D492960.6040403@erlang.org> On 02/01/2011 11:22 PM, Jesper Louis Andersen wrote: > This patch, > > git fetch git://github.com/jlouis/otp.git cocci-useless-cast > > serves two purposes. First, it removes all useless casts from the C > code of the ERTS emulator. A useless cast is a cast of an expression > that already has the type casted into. Second, it is an attempt to use > Coccinelle, http://coccinelle.lip6.fr/ on the Erlang C source. While > this is a simple Coccinelle-patch it is highly useful for doing > transformations in-the-large on the code base as a whole. The semantic > patch used is a mere 7 lines, but the patch in the branch is 120 > changes. > > I have run the test suite for the emulator part only and it passes > that. The caveat, however, is that I can only run a single platform > here. Thus, I hope for an inclusion into 'pu' for some more cooking. I > am also aware you may refrain from taking this patch as it is too > invasive. On the other hand, useless casts are potentially dangerous > if the type of the value is changed later as the cast then masks the > type error that would have otherwise occurred. > > Thanks Jesper. I'll include your patch into 'pu' and let it cook for a while. If there's any errors during test, I'll let you know. Regards, Niclas Axelsson, Erlang/OTP From kostis@REDACTED Wed Feb 2 11:50:49 2011 From: kostis@REDACTED (Kostis Sagonas) Date: Wed, 02 Feb 2011 12:50:49 +0200 Subject: [erlang-bugs] HiPE bug with comparison of floats with integers In-Reply-To: References: Message-ID: <4D493709.7050909@cs.ntua.gr> Paul Guyot wrote: > Hello, > > There is a bug in HiPE compilation with the comparison of floats with integers. > This bug happens with the following two functions: > > ------ > -module(hipe_zero). > -export([f/1, g/2]). > > f(X) -> > Y = X / 2, > Y == 0. > > g(X, Z) -> > Y = X / 2, > case Z of > test when Y == 0 -> test_zero; > test -> test_non_zero; > other -> other > end. > ------ > > Beam will evaluate hipe_zero:f(0) and hipe_zero:f(0.0) to true, while HiPE will evaluate hipe_zero:f(0) and hipe_zero:f(0.0) to false. HiPE properly evaluates hipe_zero:f/1 to true if passed {icode_inline_bifs, false}. However, not inlining the '==' bif just masks the bug as HiPE does not properly evaluate hipe_zero:g(0, test) to test_zero. This has now been fixed. The relevant fetch command is: git fetch git://github.com/kostis/otp.git icode-range-fix If one wants to apply the change manually to a previous OTP version, the last commit on that branch shows the fix that needs to be applied (basically change two calls in hipe_icode_range.erl from lists:any/2 to calls to lists:all/2). Thanks to Paul for reporting this. Kostis From tuncer.ayaz@REDACTED Wed Feb 2 15:57:49 2011 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Wed, 2 Feb 2011 15:57:49 +0100 Subject: erts: Fix doc typos, duplication and readability Message-ID: git fetch git://github.com/tuncer/otp.git erts-doc From burbas@REDACTED Wed Feb 2 17:13:07 2011 From: burbas@REDACTED (Niclas Axelsson) Date: Wed, 2 Feb 2011 17:13:07 +0100 Subject: [erlang-patches] Fixed gen_stream patch now available In-Reply-To: References: Message-ID: <4D498293.1000501@erlang.org> On 01/31/2011 07:12 PM, jay@REDACTED wrote: > With special thanks to Tuncer for the git help, I now have a clean > commit of gen_stream with a fix for the shell_SUITE error. The > problem that I discovered was there were some leaked internal > processes which were causing c:i() to fail when listing information > about active processes. I have added calls to c:i() in the test suite > to ensure that the problem doesn't recur. > > Since I can't directly observe the shell_SUITE error that you see, > there may be other issues that remain but a few days of tests > should bear out any unresolved errors. > > > git fetch git://github.com/jaynel/otp.git gen_stream > > > > commit a2423e4d428151d895ba003183421a14eefbde48 > Author: Jay Nelson > Date: Mon Jan 31 09:42:02 2011 -0800 > > Add gen_stream behaviour > > This is a new OTP behaviour designed to serve serial streams > as an ordered sequence of "blocks" of data. The stream is > loaded concurrently to a process-striped internal buffer so > that slow streams such as disk files can be efficiently > delivered. The internal buffering can be massaged by > supplying a transform function to manipulate the data blocks > between the source and the internal buffers to perform > such tasks as chopping lines of text, compressing / > decompressing or encrypting / unencrypting. > > The abstraction also allows the creation of functionally > generated streams and infinite streams. Both of these > cases allow for continuous streaming without a large > memory footprint. > > This patch includes a new module in stdlib (gen_stream.erl), > a new test suite (gen_stream_SUITE.erl) and a new page in > the documentation (gen_stream.xml). > > > jay > > > > ________________________________________________________________ > erlang-patches (at) erlang.org mailing list. > See http://www.erlang.org/faq.html > To unsubscribe; mailto:erlang-patches-unsubscribe@REDACTED > Thanks Jay. I've updated your branch in 'pu'. If there's testcases that fails due to your branch I will let you know :-). Regards, Niclas Axelsson, Erlang/OTP From burbas@REDACTED Wed Feb 2 17:14:39 2011 From: burbas@REDACTED (Niclas Axelsson) Date: Wed, 2 Feb 2011 17:14:39 +0100 Subject: [erlang-patches] Patch for infinite loop in edoc In-Reply-To: References: Message-ID: <4D4982EF.3050604@erlang.org> On 02/02/2011 01:26 AM, Taylor Venable wrote: > Hi, this is my first patch for Erlang/OTP and also my first time using > Git, so hopefully I've done it OK. The command to fetch the patch is: > > git fetch git://github.com/metasyntax/otp.git edoc_loop_fix > > The change is simple: modify edoc_wiki:strip_empty_lines/2 to return > when passed an empty list. This is the case when the end of the edoc > comment is encountered after a starting ``` sequence, but before an > ending ''' sequence. Without this patch, processing the following file > with edoc triggers an infinite recursion in strip_empty_lines/2: > > ==== test.erl ==== > %% @doc start > %% ``` > > %% ''' > %% end > > -module(test). > -export([foo/0]). > > foo() -> ok. > ==== END OF FILE ==== > > This only affects using ``` because neither `` nor ` call > strip_empty_lines/1. With this patch in place, this input file causes > the same error behaviour that using `` or ` does: > > 2> edoc:get_doc("test.erl"). > test.erl, in module header: at line 2: ```-quote ended unexpectedly at line 2 > ** exception exit: error > in function edoc_tags:parse_tag/4 > in call from edoc_tags:parse_tags/5 > in call from edoc_extract:get_tags/5 > in call from edoc_extract:source/4 > > Thanks, > > Thanks Taylor. I've included your branch into 'pu'. Regards, Niclas Axelsson, Erlang/OTP From burbas@REDACTED Wed Feb 2 17:15:36 2011 From: burbas@REDACTED (Niclas Axelsson) Date: Wed, 2 Feb 2011 17:15:36 +0100 Subject: [erlang-patches] Re: [erlang-bugs] HiPE bug with comparison of floats with integers In-Reply-To: <4D493709.7050909@cs.ntua.gr> References: <4D493709.7050909@cs.ntua.gr> Message-ID: <4D498328.5010209@erlang.org> On 02/02/2011 11:50 AM, Kostis Sagonas wrote: > Paul Guyot wrote: >> Hello, >> >> There is a bug in HiPE compilation with the comparison of floats with >> integers. >> This bug happens with the following two functions: >> >> ------ >> -module(hipe_zero). >> -export([f/1, g/2]). >> >> f(X) -> >> Y = X / 2, >> Y == 0. >> >> g(X, Z) -> >> Y = X / 2, >> case Z of >> test when Y == 0 -> test_zero; >> test -> test_non_zero; >> other -> other >> end. >> ------ >> >> Beam will evaluate hipe_zero:f(0) and hipe_zero:f(0.0) to true, while >> HiPE will evaluate hipe_zero:f(0) and hipe_zero:f(0.0) to false. HiPE >> properly evaluates hipe_zero:f/1 to true if passed >> {icode_inline_bifs, false}. However, not inlining the '==' bif just >> masks the bug as HiPE does not properly evaluate hipe_zero:g(0, test) >> to test_zero. > > This has now been fixed. The relevant fetch command is: > > git fetch git://github.com/kostis/otp.git icode-range-fix > > If one wants to apply the change manually to a previous OTP version, > the last commit on that branch shows the fix that needs to be applied > (basically change two calls in hipe_icode_range.erl from lists:any/2 > to calls to lists:all/2). > > Thanks to Paul for reporting this. > > Kostis > > ________________________________________________________________ > erlang-patches (at) erlang.org mailing list. > See http://www.erlang.org/faq.html > To unsubscribe; mailto:erlang-patches-unsubscribe@REDACTED Thanks Kostis and Paul, The patch is now included into 'pu'. Regards, Niclas Axelsson, Erlang/OTP From burbas@REDACTED Wed Feb 2 17:16:04 2011 From: burbas@REDACTED (Niclas Axelsson) Date: Wed, 2 Feb 2011 17:16:04 +0100 Subject: [erlang-patches] erts: Fix doc typos, duplication and readability In-Reply-To: References: Message-ID: <4D498344.5020309@erlang.org> On 02/02/2011 03:57 PM, Tuncer Ayaz wrote: > git fetch git://github.com/tuncer/otp.git erts-doc > > ________________________________________________________________ > erlang-patches (at) erlang.org mailing list. > See http://www.erlang.org/faq.html > To unsubscribe; mailto:erlang-patches-unsubscribe@REDACTED > Thanks Tuncer. Your fix is included into 'pu'. Regards, Niclas Axelsson, Erlang/OTP From jay@REDACTED Wed Feb 2 18:08:11 2011 From: jay@REDACTED (jay@REDACTED) Date: Wed, 2 Feb 2011 09:08:11 -0800 Subject: [erlang-patches] Fixed gen_stream patch now available In-Reply-To: <4D498293.1000501@erlang.org> References: <4D498293.1000501@erlang.org> Message-ID: <0d12b6fae4d885e56aede78747b6cf4f.squirrel@s98814.gridserver.com> > > I've updated your branch in 'pu'. If there's testcases that fails due to > your > branch I will let you know :-). > > Regards, > Niclas Axelsson, Erlang/OTP > Also check that shell_SUITE completes successfully when gen_stream_SUITE precedes it in the tests. jay From kostis@REDACTED Thu Feb 3 14:29:20 2011 From: kostis@REDACTED (Kostis Sagonas) Date: Thu, 03 Feb 2011 15:29:20 +0200 Subject: Fix translation of bs_add's fail label to Icode Message-ID: <4D4AADB0.4000701@cs.ntua.gr> Please fetch git fetch git://github.com/kostis/otp.git bs_add-fail-labels The change fixes a bug in the translation of 'bs_add' BEAM instruction to HiPE's Icode representation and can be pushed immediately to 'dev'. When these instructions appeared in a guard context the previous translation was obviously buggy. Kostis From burbas@REDACTED Thu Feb 3 15:38:50 2011 From: burbas@REDACTED (Niclas Axelsson) Date: Thu, 3 Feb 2011 15:38:50 +0100 Subject: [erlang-patches] Fix translation of bs_add's fail label to Icode In-Reply-To: <4D4AADB0.4000701@cs.ntua.gr> References: <4D4AADB0.4000701@cs.ntua.gr> Message-ID: <4D4ABDFA.2040209@erlang.org> On 02/03/2011 02:29 PM, Kostis Sagonas wrote: > Please fetch > > git fetch git://github.com/kostis/otp.git bs_add-fail-labels > > The change fixes a bug in the translation of 'bs_add' BEAM instruction > to HiPE's Icode representation and can be pushed immediately to 'dev'. > When these instructions appeared in a guard context the previous > translation was obviously buggy. > > Kostis > > ________________________________________________________________ > erlang-patches (at) erlang.org mailing list. > See http://www.erlang.org/faq.html > To unsubscribe; mailto:erlang-patches-unsubscribe@REDACTED Thanks Kostis, Will merge it into 'dev'. Regards Niclas Axelsson, Erlang/OTP From burbas@REDACTED Fri Feb 4 18:11:59 2011 From: burbas@REDACTED (Niclas Axelsson) Date: Fri, 4 Feb 2011 18:11:59 +0100 Subject: What's cooking in erlang/otp (2011-02-04) Message-ID: <201102041711.p14HBvsN020541@smaug.otp.ericsson.se> ------------------------------------------------------------ [Graduated] * ks/bs_add-fail-labels (hipe) (2011-02-03) 1 commit + Fix translation of bs_add's fail labels (64c8d86) * ks/bs_start_match-fails (hipe) (2011-01-06) 1 commit + Fix erroneous fail info of a hipe_bs_primop (1791b2d) * uw/xmerl-expand-simple (xmerl) (2010-10-25) 1 commit + Track parents when expanding #xmlElement records (4e28e50) ------------------------------------------------------------ [New topics] * fd/supervisor-delete-child-spec-on-child-termination (stdlib) (2011-01-19) 1 commit - Added supervisor:start_child/3 (bdf27ab) * gl/gen_server-doc (erts, otp, xmerl) (2011-01-29) 6 commits - Update Handling Other Messages section in gen_server, gen_fsm, gen_events overviews (c1a9537) - Support more top-level primary expressions (0f19985) - Set `vsn` field in `#xmlDecl` record (29017b4) - Track parents in `#xmlPI` nodes (b265acb) - Fix namespace-conformance constraints (7452055) - Add back documentation on .erlang processing. (0db8fad) * hw/erl-clarify-detached-doc (erts) (2011-01-24) 1 commit - Mention that "-detached" implies "-noinput" (98e954d) * ja/cocci-useless-cast (erts) (2011-02-01) 1 commit - Remove useless casts from the emulator (4163493) * ks/code-spec-fixes (hipe, kernel) (2011-01-30) 1 commit - Sanitize the specs of the code module (2697ce8) * ks/dialyzer-fullpath (dialyzer) (2011-01-20) 1 commit - Add a --fullpath option to Dialyzer (b4c3711) * ks/hipe-icode-range-fix (hipe, xmerl) (2011-02-02) 3 commits - Fix bug in the simplification of inexact comparisons (5fe3efd) - Various cleanups and cosmetic changes (235ce15) - Track parents when expanding #xmlElement records (d8269b6) * ms/ei-buffer-overflow-when-decoding-atoms (erl_interface) (2011-01-23) 1 commit - ei: buffer overflow when decoding atoms (caba1ef) * ms/ei-fix-buffer-overflows (erl_interface) (2011-01-23) 1 commit - erl_interface: fix buffer overflows (ce7fa36) * ms/file-fix-hang-reading-compressed-files (erts, kernel) (2011-01-30) 1 commit - file: fix hang reading compressed files (292ecd0) * pg/hipe-remove-constants-pool (erts) (2011-01-29) 1 commit - Remove hipe constants pool (0c16b09) * ta/binary-part-typo (stdlib) (2011-01-22) 1 commit - Fix typo in binary:part/2 example (98f51f2) * ta/efficiencyguide-typos (otp) (2011-01-27) 1 commit - Fix typos in efficiency guide (5d62504) * ta/erts-doc (erts) (2011-02-01) 1 commit - erts: Fix doc typos, duplication and readability (87d2d2b) * tv/edoc-loop-fix (edoc) (2011-02-01) 1 commit - Fix infinite loop for malformed edoc input (6ac05e5) * uw/mnesia-majority (mnesia) (2011-01-30) 8 commits - Add documentation text about majority checking (f5b8427) - add mnesia_majority_test suite (9c2f765) - where_to_wlock optimization + change_table_majority/2 (a535b6c) - bug in mnesia_tm:needs_majority/2 (eb81e20) - optimize sticky_lock maj. check (5b304d4) - check majority for sticky locks (ae9e1fa) - Write locks now check majority when needed. (6f02d2e) - Add {majority, boolean()} per-table option. (c3241c0) * vb/shell (erts, kernel, stdlib) (2011-01-21) 6 commits - Add expandfmt_fun option for io:setopts (f139eab) - Correct JCL's help indentation (95672fa) - Handle JCL's "r" command error when no pool started (ba4b196) - Fix tab expansion in remote shell (e2077cb) - edlin_expand: fix matches formatting (838b84a) - Take into account arity len when calculating field's width (ff28c52) ------------------------------------------------------------ [Stalled] * jn/gen_stream (stdlib) (2011-01-31) 1 commit - Add gen_stream behaviour (a2423e4) . Add new gen_stream behaviour for efficiently consuming serial streams (65f3db8) This topic branch has a failing test case: shell_SUITE:start_restricted_from_shell; We have now tested with and without this topic branch and when it is present that test case fails. We consider it proved to be guilty. The test case does not fail when run standalone so it seems to be tricky... Also, some of its own test cases fail sporadicly. Action expected from: Topic author. * jp/dependencies_makefile (compiler, erts) (2009-12-14) 1 commit - Add dependencies Makefile generation to erlc(1) and compile(3) (4945add) Approved in principle by the OTP Technical Board; now awaits a closer review of the implementation. Action expected from: Bj??rn Gustavsson (the reviewer) ------------------------------------------------------------ [Cooking] * bg/temp-hipe-fixes (compiler, hipe, kernel) (2010-03-15) 6 commits - Avoid crash by skipping compilation_SUITE:on_load/1 (8592a02) - Inline less aggressively for native-code compilation (e699ad4) - Crudely fix return type for the lists:key{search,find,member}/3 (2b72202) - seq_trace_SUITE: Don't native-compile (2712344) - Disable native code if on_load is used (e8d0ea4) - andor_SUITE: Don't native-compile (e25ef8c) This branch contains temporary workarounds to avoid failing test cases and is never intended to graduate. * bsmr/fix-makefile-in-for-xref-mod-app-escript (otp) (2010-12-10) 1 commit - Fix for Makefile.in invoking xref_mod_app.escript (10d4235) * bw/efile_exists (erts) (2010-10-07) 1 commit - prim_file:exists/{1,2} which is lightweight file existence check (7203932) * bw/tv-render-fix (tv) (2010-10-06) 1 commit - tv: Allow table viewer to display refs, ports and small binaries (5eff630) * cg/fix-prng (stdlib) (2010-10-06) 1 commit - Fix a bug in the implementation of the pseudo-random number generator (863ec4d) * cr/httpc-docs (inets, kernel) (2010-12-15) 1 commit - inets/httpc: Polish documentation (e6180a6) * dk/agent-capabilities (snmp) (2010-12-01) 1 commit - AGENT-CAPABILITIES handling added to SNMP mib compiler (17c3b19) * fd/httpc-man-page-fixes (inets) (2010-12-16) 1 commit - Grammar and typo fixes for the httpc module documentation (778a608) * fd/unix-efile-readdir-fix (erts) (2010-12-15) 1 commit - Fix call to strncat, 3rd arg should be of type size_t and not a pointer (78cfdaf) * fm/dict-man-page (stdlib) (2010-12-13) 2 commits - Fixes to the orddict module documentation (18777e8) - Fixes to the dict module documentation (c537777) * fm/httpc-upload-body-streaming (inets) (2010-12-01) 1 commit - httpc: added support for streaming the body of an upload request (PUT or POST). Examples: (6ec259d) * fm/posix-fallocate (erts, kernel) (2011-01-10) 2 commits - Fix build on Solaris (38a922d) - Added file:allocate/2 (9870d9b) * gc/gen-format-status-improvements (stdlib) (2010-06-12) 1 commit - Fix format_status bug for unregistered gen_event processes (95ed86f) * gl/erts-doterlang-docs (erts) (2010-12-19) 1 commit - Add back documentation on .erlang processing. (a80ace9) * hw/call-chmod-without-f (asn1, common_test, compiler, cosFileTransfer, crypto, debugger, docbuilder, edoc, erl_interface, erts, et, inets, inviso, kernel, megaco, mnesia, orber, parsetools, percept, public_key, reltool, runtime_tools, snmp, ssl, stdlib, syntax_tools, test_server, tools) (2010-11-15) 1 commit - Call chmod without the "-f" flag (7ed11a8) * hw/epmd-bind-to-address (erts) (2010-11-10) 1 commit - Allow user to specify the IP address epmd binds to (bcf3b3d) * hw/fix-epmd-perror (erts) (2010-11-13) 1 commit - Fix epmd's dbg_perror() output (b363d7d) * ih/calendar-iso-8601-erl (stdlib) (2010-12-14) 1 commit - Add ISO week number calculation functions to the calendar module in stdlib (d82b0eb) * jf/run_erl-disable-flow-control (erts) (2010-03-05) 1 commit - Teach run_erl RUN_ERL_DISABLE_FLOWCNTRL for disabling flow control (d0775cd) * km/pool_connect-to-running-nodes (stdlib) (2010-09-02) 1 commit - Change pool module to attempt to attach to nodes that are already running (a9f4cbc) * ks/asn1-dialyzer-fixes (asn1) (2010-11-18) 1 commit - Shut off some dialyzer warnings (508a6d2) * ks/reltool-spec-fixes (reltool) (2011-01-12) 1 commit - Fix two erroneous specs of reltool.erl (96c81d6) * mk/net-kernel-epmd-return-list (kernel) (2010-12-10) 1 commit - Fix list returned by net_kernel:epmd_module (169d7e4) * ms/epmd-local-access-check (erts) (2010-11-24) 1 commit - epmd: include host address in local access check (5b68030) * nox/xmerl-namespace-axis (xmerl) (2010-12-07) 12 commits - Implement namespace axis (27d791f) - Add `#xmlPI` support to xmerl_xpath:write_node/1 (75e67f5) - Fix processing-instruction(name?) (f05e78b) - Fix path filters (610df56) - Support more top-level primary expressions (770d6d9) - Accumulate comments in element nodes (e5b6b3a) - Add `default_attrs` option (18584c5) - Allow whole documents to be returned (aef3dea) - Track parents and namespace in `#xmlAttribute` nodes (dc9b220) - Track parents in `#xmlPI` nodes (5095331) - Set `vsn` field in `#xmlDecl` record (d712331) - Fix namespace-conformance constraints (e062270) * pg/des-cfb-functions (crypto) (2010-10-16) 1 commit - Add DES and Triple DES cipher feedback (CFB) mode functions (2c79ae7) * pg/fix-hibernate-with-hipe (erts, otp) (2010-09-27) 1 commit - Fix several bugs related to hibernate/3 and HiPE (ce00ecb) . Fix several bugs related to hibernate/3 and HiPE (babd761) * pg/honor-start-type-in-rel-files (sasl) (2010-06-06) 1 commit - Honor start type in .rel files when building relup files (7599900) * sa/callback-attr (compiler, inets, kernel, otp, stdlib) (2010-06-08) 7 commits - Add callback specs into 'application' module in kernel (85ae9d7) - Add callback specs to tftp module following internet documentation (019e6d1) - Add callback specs to inets_service module following possibly deprecated comments (575c7af) - Add '-callback' attributes in stdlib's behaviours (a9da5cc) - Update primary bootstrap (d5d255b) - Automatically generate 'behaviour_info' function from '-callback' attributes (1155c86) - Add '-callback' attribute to language syntax (1a1cc4b) * sa/dialyzer-fix-guards (dialyzer) (2011-01-14) 3 commits - Fix warnings about guards containing not (271ee93) - Fix errors in the handling of 'and'/'or' guards (02e0f98) - Cosmetic changes (326ec4e) * sa/float_to_list_2 (erts, stdlib) (2011-01-12) 1 commit - new float_to_list/2 (3beeabd) * sb/make-files-like-erlc (tools) (2010-05-18) 1 commit - Change make:files to behave more like erlc (5e9d051) * sg/fix-diskless-booted-relup (sasl) (2010-09-19) 1 commit - Remove traces of release_handler reading from filesystem when it has Masters list (54cb5df) * ta/asn1-reporting (asn1) (2010-04-23) 1 commit - asn1ct: Make formatting of errors and warnings consistent (93face2) * ta/driver-entry-typos (erts) (2010-12-26) 1 commit - Fix a couple typos in driver_entry(3) (08edf97) * ta/ensure-dot-ssh-exists (ssh) (2010-09-02) 1 commit - ssh: ensure ~/.ssh exists (2c14d90) * ta/epmd-typo (erts) (2011-01-09) 1 commit - Fix typo in epmd help (ce956a8) * ta/erlsrv-typos (erts) (2010-12-14) 1 commit - Fix two typos in erlsrv log messages (31b82e8) * ta/httpc-typo (inets) (2011-01-09) 1 commit - Fix typo in httpc documentation (e331e0d) * ta/sendfile (erts, kernel) (2011-01-13) 1 commit - Implement file:sendfile (b68ee2b) * ta/ssh-ensure-userdir (ssh) (2010-09-02) 1 commit - ssh: ensure ~/.ssh exists (267b3a0) * ts/cover-with-export_all (tools) (2010-09-23) 1 commit - add user specified compiler options on form reloading (eb02beb) ------------------------------------------------------------ [Dropped] * mh/dialyzer-full-path-option (dialyzer) (2010-09-15) 1 commit . Dialyzer: add --fullpath option for printing full paths in warnings (3703ea6) * ml/add-os-pid-to-port-info (erts) (2010-08-19) 1 commit . Extend erlang:port_info/1,2 to show the OS pid of a spawned process (b2d85bf) * ml/better-error-message-on-shell-input-eof (stdlib) (2010-12-12) 1 commit . Be more helpful when the shell encounters EOF (b2315b0) From jay@REDACTED Fri Feb 4 19:28:55 2011 From: jay@REDACTED (jay@REDACTED) Date: Fri, 4 Feb 2011 10:28:55 -0800 Subject: What's Cooking / gen_stream Message-ID: > [Stalled] > > * jn/gen_stream (stdlib) (2011-01-31) 1 commit > - Add gen_stream behaviour (a2423e4) > > . Add new gen_stream behaviour for efficiently consuming serial streams (65f3db8) > > This topic branch has a failing test case: > > shell_SUITE:start_restricted_from_shell; > We have now tested with and without this topic branch and when > it is present that test case fails. We consider it proved > to be guilty. The test case does not fail when run standalone > so it seems to be tricky... Also, some of its own test cases > fail sporadicly. > > Action expected from: Topic author. I had previous submissions which eliminated sporadic failures within gen_stream_SUITE a while back. Are you seeing sporadic failures now? The latest submission should have taken care of the shell_SUITE failures. Can you update the state to something along the lines of "purported fix submitted, status pending further testing" ? jay From kostis@REDACTED Sat Feb 5 12:12:14 2011 From: kostis@REDACTED (Kostis Sagonas) Date: Sat, 05 Feb 2011 13:12:14 +0200 Subject: prim_file fixes Message-ID: <4D4D308E.5010108@cs.ntua.gr> The documentation of erlang:open_port/2 states: open_port(PortName, PortSettings) -> port() where PortName = {spawn, Command} | ... Command = string() while in prim_file.erl there are calls to this function (via drv_open/2) drv_open(Driver, Portopts) -> try erlang:open_port({spawn, Driver}, Portopts) of % line 821 .... where the Driver is an atom and dialyzer does not like that. This comes from the use of the ?FD_DRV macro. Change this macro from: -define(FD_DRV, efile). to -define(FD_DRV, "efile"). While at it, do some cosmetic cleanups. Fetch by: git fetch git://github.com/kostis/otp.git prim_file-fixes Kostis From tuncer.ayaz@REDACTED Sat Feb 5 15:27:42 2011 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Sat, 5 Feb 2011 15:27:42 +0100 Subject: [erlang-patches] erts: Fix doc typos, duplication and readability In-Reply-To: <4D498344.5020309@erlang.org> References: <4D498344.5020309@erlang.org> Message-ID: On Wed, Feb 2, 2011 at 5:16 PM, Niclas Axelsson wrote: > Thanks Tuncer. > > Your fix is included into 'pu'. Updated the patch with another fix. Please re-fetch. From tuncer.ayaz@REDACTED Sat Feb 5 19:35:53 2011 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Sat, 5 Feb 2011 19:35:53 +0100 Subject: [erlang-patches] sendfile() In-Reply-To: <4D2F27EB.6080109@erlang.org> References: <4CFD112B.704@erlang.org> <4D2F27EB.6080109@erlang.org> Message-ID: On Thu, Jan 13, 2011 at 5:27 PM, Niclas Axelsson wrote: > Thanks Tuncer. Refetched your branch. Please refetch. Moved chunk handling to efile_drv. From kostis@REDACTED Sun Feb 6 18:18:37 2011 From: kostis@REDACTED (Kostis Sagonas) Date: Sun, 06 Feb 2011 19:18:37 +0200 Subject: typer Message-ID: <4D4ED7ED.8040404@cs.ntua.gr> Major typer cleanup, bug fixes and reorganization of the code: git fetch git://github.com/kostis/otp.git typer Can be added directly to 'dev'. Kostis From kostis@REDACTED Thu Feb 10 02:21:11 2011 From: kostis@REDACTED (Kostis Sagonas) Date: Thu, 10 Feb 2011 03:21:11 +0200 Subject: HiPE backend for PPC64 Message-ID: <4D533D87.6000803@cs.ntua.gr> There is a new back end of the HiPE native code compiler for PPC64 (PowerPC 64). The relevant fetch command is: git fetch git://github.com/kostis/otp.git hipe-ppc64 Please include into 'pu'/'dev'. Also, I would appreciate some feedback from interested users who want to test this early on whether this is auto-enabled in PPC64 architectures and native compiled code works OK for things they have tried -- I have only very limited access to such a machine. Kostis From burbas@REDACTED Mon Feb 14 11:48:39 2011 From: burbas@REDACTED (Niclas Axelsson) Date: Mon, 14 Feb 2011 11:48:39 +0100 Subject: [erlang-patches] prim_file fixes In-Reply-To: <4D4D308E.5010108@cs.ntua.gr> References: <4D4D308E.5010108@cs.ntua.gr> Message-ID: <4D590887.60602@erlang.org> On 02/05/2011 12:12 PM, Kostis Sagonas wrote: > > Fetch by: > > git fetch git://github.com/kostis/otp.git prim_file-fixes > > > Kostis Thanks Kostis. Merged your branch into 'pu'. Regards Niclas Axelsson, Erlang/OTP From magnus.henoch@REDACTED Mon Feb 14 12:54:22 2011 From: magnus.henoch@REDACTED (Magnus Henoch) Date: Mon, 14 Feb 2011 11:54:22 +0000 (GMT) Subject: [PATCH] Fix -spec for file:write_file/3 In-Reply-To: <821556714.437751297684442029.JavaMail.root@zimbra> Message-ID: <373783405.437771297684462115.JavaMail.root@zimbra> Change type for second parameter from binary() to iodata(), since the function explicitly takes steps to accept lists as well as binaries. --- lib/kernel/src/file.erl | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/lib/kernel/src/file.erl b/lib/kernel/src/file.erl index bc95359..a7a6e96 100644 --- a/lib/kernel/src/file.erl +++ b/lib/kernel/src/file.erl @@ -240,7 +240,7 @@ write_file(Name, Bin) -> %% when it is time to change file server protocol again. %% Meanwhile, it is implemented here, slightly less efficient. --spec write_file(Name :: name(), Bin :: binary(), Modes :: [mode()]) -> +-spec write_file(Name :: name(), Bin :: iodata(), Modes :: [mode()]) -> 'ok' | {'error', posix()}. write_file(Name, Bin, ModeList) when is_list(ModeList) -> -- 1.7.0.4 From kostis@REDACTED Mon Feb 14 13:17:12 2011 From: kostis@REDACTED (Kostis Sagonas) Date: Mon, 14 Feb 2011 14:17:12 +0200 Subject: [erlang-patches] [PATCH] Fix -spec for file:write_file/3 In-Reply-To: <373783405.437771297684462115.JavaMail.root@zimbra> References: <373783405.437771297684462115.JavaMail.root@zimbra> Message-ID: <4D591D48.9090207@cs.ntua.gr> Magnus Henoch wrote: > Change type for second parameter from binary() to iodata(), since the > function explicitly takes steps to accept lists as well as binaries. Let me add a comment, more FYI. The intention for specs in files is to correspond to the published OTP documentation. So, actually in this case the change that Magnus suggested needs to happen not only for the reason he mentions, but primarily so that it corresponds to the published documentation which states iodata() for the second argument of this function. Well spotted Magnus! Please contribute more such patches when you notice some discrepancy between the spec of some function and its published documentation. Kostis > --- > lib/kernel/src/file.erl | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/lib/kernel/src/file.erl b/lib/kernel/src/file.erl > index bc95359..a7a6e96 100644 > --- a/lib/kernel/src/file.erl > +++ b/lib/kernel/src/file.erl > @@ -240,7 +240,7 @@ write_file(Name, Bin) -> > %% when it is time to change file server protocol again. > %% Meanwhile, it is implemented here, slightly less efficient. > > --spec write_file(Name :: name(), Bin :: binary(), Modes :: [mode()]) -> > +-spec write_file(Name :: name(), Bin :: iodata(), Modes :: [mode()]) -> > 'ok' | {'error', posix()}. > > write_file(Name, Bin, ModeList) when is_list(ModeList) -> From burbas@REDACTED Mon Feb 14 14:26:09 2011 From: burbas@REDACTED (Niclas Axelsson) Date: Mon, 14 Feb 2011 14:26:09 +0100 Subject: [erlang-patches] [patch] new float_to_list/2 In-Reply-To: <4D2D3FA8.1000009@aleynikov.org> References: <4D2D3FA8.1000009@aleynikov.org> Message-ID: <4D592D71.1060501@erlang.org> On 01/12/2011 06:44 AM, Serge Aleynikov wrote: > Attached please find a patch that adds a new float_to_list/2 BIF. The > patch was created off of the master branch of > https://github.com/erlang/otp. > > This BIF solves a problem of float_to_list/1 that doesn't allow > specifying the number of digits after the decimal point when > formatting floats. > > float_to_list(Float, Options) -> string() > > Float = float() > Options = [Option] > Option = {precision, Precision::integer()} | compact > > Text representation of a float formatted using given options > > Returns a string which corresponds to the text > representation of Float using fixed decimal point formatting. > When precision option is specified > the returned value will contain at most Precision number of > digits past the decimal point. When compact option is provided > the trailing zeros at the end of the list are truncated. > > 1> float_to_list(7.12, [{precision, 4}]). > "7.1200" > 2> float_to_list(7.12, [{precision, 4}, compact]). > "7.12" > > Documentation and test cases are updated to reflect the changes. > > Though I included identical support for this new bif in > unix/win/vxworks I only tested it on Linux. > > Regards, > > Serge > > > > ________________________________________________________________ > erlang-patches (at) erlang.org mailing list. > See http://www.erlang.org/faq.html > To unsubscribe; mailto:erlang-patches-unsubscribe@REDACTED Thanks Serge. Sorry for a late response. Your branch is merged into 'pu'. Regards, Niclas Axelsson, Erlang/OTP From burbas@REDACTED Mon Feb 14 15:07:23 2011 From: burbas@REDACTED (Niclas Axelsson) Date: Mon, 14 Feb 2011 15:07:23 +0100 Subject: [erlang-questions] HiPE backend for PPC64 In-Reply-To: <4D533D87.6000803@cs.ntua.gr> References: <4D533D87.6000803@cs.ntua.gr> Message-ID: <4D59371B.3000402@erlang.org> On 02/10/2011 02:21 AM, Kostis Sagonas wrote: > There is a new back end of the HiPE native code compiler for PPC64 > (PowerPC 64). The relevant fetch command is: > > git fetch git://github.com/kostis/otp.git hipe-ppc64 > > Please include into 'pu'/'dev'. > > Also, I would appreciate some feedback from interested users who want > to test this early on whether this is auto-enabled in PPC64 > architectures and native compiled code works OK for things they have > tried -- I have only very limited access to such a machine. > > Kostis > > ________________________________________________________________ > erlang-patches (at) erlang.org mailing list. > See http://www.erlang.org/faq.html > To unsubscribe; mailto:erlang-patches-unsubscribe@REDACTED Thank you, Kostis. Will include this branch in 'pu' for a couple of days. Regards Niclas Axelsson, Erlang/OTP From burbas@REDACTED Mon Feb 14 15:15:21 2011 From: burbas@REDACTED (Niclas Axelsson) Date: Mon, 14 Feb 2011 15:15:21 +0100 Subject: [erlang-patches] [PATCH] Fix -spec for file:write_file/3 In-Reply-To: <373783405.437771297684462115.JavaMail.root@zimbra> References: <373783405.437771297684462115.JavaMail.root@zimbra> Message-ID: <4D5938F9.4060108@erlang.org> On 02/14/2011 12:54 PM, Magnus Henoch wrote: > Change type for second parameter from binary() to iodata(), since the > function explicitly takes steps to accept lists as well as binaries. > --- > lib/kernel/src/file.erl | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/lib/kernel/src/file.erl b/lib/kernel/src/file.erl > index bc95359..a7a6e96 100644 > --- a/lib/kernel/src/file.erl > +++ b/lib/kernel/src/file.erl > @@ -240,7 +240,7 @@ write_file(Name, Bin) -> > %% when it is time to change file server protocol again. > %% Meanwhile, it is implemented here, slightly less efficient. > > --spec write_file(Name :: name(), Bin :: binary(), Modes :: [mode()]) -> > +-spec write_file(Name :: name(), Bin :: iodata(), Modes :: [mode()]) -> > 'ok' | {'error', posix()}. > > write_file(Name, Bin, ModeList) when is_list(ModeList) -> > Thanks Magnus. I've merged your patch into 'pu' but will move it to 'dev' within a couple of days. Regards Niclas Axelsson, Erlang/OTP From burbas@REDACTED Mon Feb 14 15:16:32 2011 From: burbas@REDACTED (Niclas Axelsson) Date: Mon, 14 Feb 2011 15:16:32 +0100 Subject: [erlang-patches] Update Handling Other Messages section in gen_server, gen_fsm, gen_event overviews In-Reply-To: References: Message-ID: <4D593940.5010300@erlang.org> On 01/29/2011 09:58 PM, G?bor Lipt?k wrote: > Please fetch from: > > git fetch git://github.com/gliptak/otp.git gen_server_doc > > Thanks > > ________________________________________________________________ > erlang-patches (at) erlang.org mailing list. > See http://www.erlang.org/faq.html > To unsubscribe; mailto:erlang-patches-unsubscribe@REDACTED > Thanks G?bor. Merged your branch into 'pu'. Regards, Niclas Axelsson, Erlang/OTP From burbas@REDACTED Mon Feb 14 16:02:46 2011 From: burbas@REDACTED (Niclas Axelsson) Date: Mon, 14 Feb 2011 16:02:46 +0100 Subject: [erlang-patches] typer In-Reply-To: <4D4ED7ED.8040404@cs.ntua.gr> References: <4D4ED7ED.8040404@cs.ntua.gr> Message-ID: <4D594416.1040603@erlang.org> On 02/06/2011 06:18 PM, Kostis Sagonas wrote: > Major typer cleanup, bug fixes and reorganization of the code: > > git fetch git://github.com/kostis/otp.git typer > > Can be added directly to 'dev'. > > Kostis > > ________________________________________________________________ > erlang-patches (at) erlang.org mailing list. > See http://www.erlang.org/faq.html > To unsubscribe; mailto:erlang-patches-unsubscribe@REDACTED Thanks Kostis. I'll merge it into 'pu' and let it cook there for a couple of days before moving it to 'dev'. Regards, Niclas Axelsson, Erlang/OTP From burbas@REDACTED Fri Feb 18 18:43:22 2011 From: burbas@REDACTED (Niclas Axelsson) Date: Fri, 18 Feb 2011 18:43:22 +0100 Subject: What's cooking in erlang/otp (2011-02-18) Message-ID: <201102181743.p1IHhJ6S007426@smaug.otp.ericsson.se> ------------------------------------------------------------ [Graduated] * jp/dependencies_makefile (compiler, erts) (2009-12-14) 1 commit + Add dependencies Makefile generation to erlc(1) and compile(3) (dd3e666) * ks/asn1-dialyzer-fixes (asn1) (2010-11-18) 1 commit + Shut off some dialyzer warnings (508a6d2) * mh/file-fix_spec (kernel) (2011-02-14) 1 commit + Fix -spec for file:write_file/3 (d26eac5) * sf/rsa_pub_key (public_key) (2011-01-18) 1 commit + Improved support for RSA and DSA public keys (c730d2f) * ta/asn1-reporting (asn1) (2010-04-23) 1 commit + asn1ct: Make formatting of errors and warnings consistent (93face2) ------------------------------------------------------------ [New topics] * ks/hipe-ppc64 (erts, hipe, kernel) (2011-02-10) 8 commits - Enable HiPE by default when compiling for PPC64 (577a628) - Translate RTL to PPC code on PPC64 too (6f40a86) - Changes in ppc files for PPC64 (ea5edef) - Additions for the PPC64 backend (861cfc9) - Changes for the PPC64 backend (dbba32b) - Added loader for ppc64 (60826a5) - New files for the 64-bit backends (7c53e28) - Cleanup tags (e34f3a0) * ks/prim_file-fixes (erts) (2011-02-05) 3 commits - New version of the file (ca86ed3) - Driver names should be strings, not atoms (b8ea40c) - Cleanup and cosmetic changes (6adc116) * ks/typer (typer) (2011-02-10) 21 commits - Strengthen some specs (e70b5f1) - Allow for --show_success_typings spelling also (bb66841) - Add '--show_success_typings' option (8376b29) - Fix crash in oveloaded contracts with overlapping domains (752b058) - Fix a type error and do some further cleanup (0ef74b6) - Type cleanups and simplifications (39bf5ad) - Cleanup the analysis record (0b1d045) - Remove typer_annotator.erl and typer.hrl (066368a) - Remove typer_info.erl file (03aa23f) - Remove typer_options.erl file (3683f8d) - Remove typer_preprocess.erl file (f4a8288) - Delete typer_map.erl file, really this time (3c1e906) . . . ------------------------------------------------------------ [Cooking] * bg/temp-hipe-fixes (compiler, hipe, kernel) (2010-03-15) 6 commits - Avoid crash by skipping compilation_SUITE:on_load/1 (8592a02) - Inline less aggressively for native-code compilation (e699ad4) - Crudely fix return type for the lists:key{search,find,member}/3 (2b72202) - seq_trace_SUITE: Don't native-compile (2712344) - Disable native code if on_load is used (e8d0ea4) - andor_SUITE: Don't native-compile (e25ef8c) This branch contains temporary workarounds to avoid failing test cases and is never intended to graduate. * bsmr/fix-makefile-in-for-xref-mod-app-escript (otp) (2010-12-10) 1 commit - Fix for Makefile.in invoking xref_mod_app.escript (10d4235) * bw/efile_exists (erts) (2010-10-07) 1 commit - prim_file:exists/{1,2} which is lightweight file existence check (7203932) * bw/tv-render-fix (tv) (2010-10-06) 1 commit - tv: Allow table viewer to display refs, ports and small binaries (5eff630) * cg/fix-prng (stdlib) (2010-10-06) 1 commit - Fix a bug in the implementation of the pseudo-random number generator (863ec4d) * cr/httpc-docs (inets, kernel) (2010-12-15) 1 commit - inets/httpc: Polish documentation (e6180a6) * dk/agent-capabilities (snmp) (2010-12-01) 1 commit - AGENT-CAPABILITIES handling added to SNMP mib compiler (17c3b19) * fd/httpc-man-page-fixes (inets) (2010-12-16) 1 commit - Grammar and typo fixes for the httpc module documentation (778a608) * fd/supervisor-delete-child-spec-on-child-termination (stdlib) (2011-01-19) 1 commit - Added supervisor:start_child/3 (bdf27ab) * fd/unix-efile-readdir-fix (erts) (2010-12-15) 1 commit - Fix call to strncat, 3rd arg should be of type size_t and not a pointer (78cfdaf) * fm/dict-man-page (stdlib) (2010-12-13) 2 commits - Fixes to the orddict module documentation (18777e8) - Fixes to the dict module documentation (c537777) * fm/httpc-upload-body-streaming (inets) (2010-12-01) 1 commit - httpc: added support for streaming the body of an upload request (PUT or POST). Examples: (6ec259d) * fm/posix-fallocate (erts, kernel) (2011-01-10) 2 commits - Fix build on Solaris (38a922d) - Added file:allocate/2 (9870d9b) * gc/gen-format-status-improvements (stdlib) (2010-06-12) 1 commit - Fix format_status bug for unregistered gen_event processes (95ed86f) * gl/erts-doterlang-docs (erts) (2010-12-19) 1 commit - Add back documentation on .erlang processing. (a80ace9) * gl/gen_server-doc (erts, otp, xmerl) (2011-01-29) 6 commits - Update Handling Other Messages section in gen_server, gen_fsm, gen_events overviews (c1a9537) - Support more top-level primary expressions (0f19985) - Set `vsn` field in `#xmlDecl` record (29017b4) - Track parents in `#xmlPI` nodes (b265acb) - Fix namespace-conformance constraints (7452055) - Add back documentation on .erlang processing. (0db8fad) * hw/call-chmod-without-f (asn1, common_test, compiler, cosFileTransfer, crypto, debugger, docbuilder, edoc, erl_interface, erts, et, inets, inviso, kernel, megaco, mnesia, orber, parsetools, percept, public_key, reltool, runtime_tools, snmp, ssl, stdlib, syntax_tools, test_server, tools) (2010-11-15) 1 commit - Call chmod without the "-f" flag (7ed11a8) * hw/epmd-bind-to-address (erts) (2010-11-10) 1 commit - Allow user to specify the IP address epmd binds to (bcf3b3d) * hw/erl-clarify-detached-doc (erts) (2011-01-24) 1 commit - Mention that "-detached" implies "-noinput" (98e954d) * hw/fix-epmd-perror (erts) (2010-11-13) 1 commit - Fix epmd's dbg_perror() output (b363d7d) * ih/calendar-iso-8601-erl (stdlib) (2010-12-14) 1 commit - Add ISO week number calculation functions to the calendar module in stdlib (d82b0eb) * ja/cocci-useless-cast (erts) (2011-02-01) 1 commit - Remove useless casts from the emulator (4163493) * jf/run_erl-disable-flow-control (erts) (2010-03-05) 1 commit - Teach run_erl RUN_ERL_DISABLE_FLOWCNTRL for disabling flow control (d0775cd) * jn/gen_stream (stdlib) (2011-01-31) 1 commit - Add gen_stream behaviour (a2423e4) - Add new gen_stream behaviour for efficiently consuming serial streams (65f3db8) * km/pool_connect-to-running-nodes (stdlib) (2010-09-02) 1 commit - Change pool module to attempt to attach to nodes that are already running (a9f4cbc) * ks/code-spec-fixes (hipe, kernel) (2011-01-30) 1 commit - Sanitize the specs of the code module (2697ce8) * ks/dialyzer-fullpath (dialyzer) (2011-01-20) 1 commit - Add a --fullpath option to Dialyzer (b4c3711) * ks/hipe-icode-range-fix (hipe) (2011-02-02) 3 commits - Cleanup specs (cc526d2) - Fix bug in the simplification of inexact comparisons (6c9a53e) - Various cleanups and cosmetic changes (b397a5b) * ks/reltool-spec-fixes (reltool) (2011-01-12) 1 commit - Fix two erroneous specs of reltool.erl (96c81d6) * mk/net-kernel-epmd-return-list (kernel) (2010-12-10) 1 commit - Fix list returned by net_kernel:epmd_module (169d7e4) * ms/ei-buffer-overflow-when-decoding-atoms (erl_interface) (2011-01-23) 1 commit - ei: buffer overflow when decoding atoms (caba1ef) * ms/ei-fix-buffer-overflows (erl_interface) (2011-01-23) 1 commit - erl_interface: fix buffer overflows (ce7fa36) * ms/epmd-local-access-check (erts) (2010-11-24) 1 commit - epmd: include host address in local access check (5b68030) * ms/file-fix-hang-reading-compressed-files (erts, kernel) (2011-01-30) 1 commit - file: fix hang reading compressed files (292ecd0) * nox/xmerl-namespace-axis (xmerl) (2010-12-07) 12 commits - Implement namespace axis (27d791f) - Add `#xmlPI` support to xmerl_xpath:write_node/1 (75e67f5) - Fix processing-instruction(name?) (f05e78b) - Fix path filters (610df56) - Support more top-level primary expressions (770d6d9) - Accumulate comments in element nodes (e5b6b3a) - Add `default_attrs` option (18584c5) - Allow whole documents to be returned (aef3dea) - Track parents and namespace in `#xmlAttribute` nodes (dc9b220) - Track parents in `#xmlPI` nodes (5095331) - Set `vsn` field in `#xmlDecl` record (d712331) - Fix namespace-conformance constraints (e062270) * pg/des-cfb-functions (crypto) (2010-10-16) 1 commit - Add DES and Triple DES cipher feedback (CFB) mode functions (2c79ae7) * pg/fix-hibernate-with-hipe (erts, otp) (2010-09-27) 1 commit - Fix several bugs related to hibernate/3 and HiPE (ce00ecb) . Fix several bugs related to hibernate/3 and HiPE (babd761) * pg/hipe-remove-constants-pool (erts) (2011-01-29) 1 commit - Remove hipe constants pool (0c16b09) * pg/honor-start-type-in-rel-files (sasl) (2010-06-06) 1 commit - Honor start type in .rel files when building relup files (7599900) * sa/callback-attr (compiler, inets, kernel, otp, stdlib) (2010-06-08) 7 commits - Add callback specs into 'application' module in kernel (85ae9d7) - Add callback specs to tftp module following internet documentation (019e6d1) - Add callback specs to inets_service module following possibly deprecated comments (575c7af) - Add '-callback' attributes in stdlib's behaviours (a9da5cc) - Update primary bootstrap (d5d255b) - Automatically generate 'behaviour_info' function from '-callback' attributes (1155c86) - Add '-callback' attribute to language syntax (1a1cc4b) * sa/dialyzer-fix-guards (dialyzer) (2011-01-14) 3 commits - Fix warnings about guards containing not (271ee93) - Fix errors in the handling of 'and'/'or' guards (02e0f98) - Cosmetic changes (326ec4e) * sa/float_to_list_2 (erts, stdlib) (2011-01-20) 3 commits - Added float_to_list/2 that allows to specify formatting options (343bf6b) - Added float_to_list/2 that allows to specify formatting options (ee5a309) - Added float_to_list/2 that allows to specify formatting options. (aa206ba) * sb/make-files-like-erlc (tools) (2010-05-18) 1 commit - Change make:files to behave more like erlc (5e9d051) * sg/fix-diskless-booted-relup (sasl) (2010-09-19) 1 commit - Remove traces of release_handler reading from filesystem when it has Masters list (54cb5df) * ta/binary-part-typo (stdlib) (2011-01-22) 1 commit - Fix typo in binary:part/2 example (98f51f2) * ta/driver-entry-typos (erts) (2010-12-26) 1 commit - Fix a couple typos in driver_entry(3) (68aed1c) * ta/efficiencyguide-typos (otp) (2011-01-27) 1 commit - Fix typos in efficiency guide (5d62504) * ta/epmd-typo (erts) (2011-01-09) 1 commit - Fix typo in epmd help (ce956a8) * ta/erlsrv-typos (erts) (2010-12-14) 1 commit - Fix two typos in erlsrv log messages (31b82e8) * ta/erts-doc (erts) (2011-02-01) 1 commit - erts: Fix doc typos, duplication and readability (04e81b8) * ta/httpc-typo (inets) (2011-01-09) 1 commit - Fix typo in httpc documentation (e331e0d) * ta/sendfile (erts, kernel) (2011-01-13) 1 commit - Implement file:sendfile (c0663cf) * ts/cover-with-export_all (tools) (2010-09-23) 1 commit - add user specified compiler options on form reloading (eb02beb) * tv/edoc-loop-fix (edoc) (2011-02-01) 1 commit - Fix infinite loop for malformed edoc input (6ac05e5) * uw/mnesia-majority (mnesia) (2011-01-30) 8 commits - Add documentation text about majority checking (f5b8427) - add mnesia_majority_test suite (9c2f765) - where_to_wlock optimization + change_table_majority/2 (a535b6c) - bug in mnesia_tm:needs_majority/2 (eb81e20) - optimize sticky_lock maj. check (5b304d4) - check majority for sticky locks (ae9e1fa) - Write locks now check majority when needed. (6f02d2e) - Add {majority, boolean()} per-table option. (c3241c0) * vb/shell (erts, kernel, stdlib) (2011-01-21) 6 commits - Add expandfmt_fun option for io:setopts (f139eab) - Correct JCL's help indentation (95672fa) - Handle JCL's "r" command error when no pool started (ba4b196) - Fix tab expansion in remote shell (e2077cb) - edlin_expand: fix matches formatting (838b84a) - Take into account arity len when calculating field's width (ff28c52) From tuncer.ayaz@REDACTED Sun Feb 20 10:57:08 2011 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Sun, 20 Feb 2011 10:57:08 +0100 Subject: [erlang-patches] sendfile() In-Reply-To: <4D2F27EB.6080109@erlang.org> References: <4CFD112B.704@erlang.org> <4D2F27EB.6080109@erlang.org> Message-ID: On Thu, Jan 13, 2011 at 5:27 PM, Niclas Axelsson wrote: > > Thanks Tuncer. Refetched your branch. Please refetch. Resolved an issue in the test suite thanks to Steve Vinoski. From imi.horvath@REDACTED Sun Feb 20 12:07:28 2011 From: imi.horvath@REDACTED (Imre Horvath) Date: Sun, 20 Feb 2011 12:07:28 +0100 Subject: [erlang-patches] week number support In-Reply-To: <4D10C53E.3090601@erlang.org> References: <430CE66B-5C3C-42F6-9620-ADDC84427CA5@gmail.com> <4CFCAF83.9080600@erlang.org> <4D0882B0.8040202@erlang.org> <4D57AA04-ED16-4E6D-AD6A-FB66B31A9B06@gmail.com> <4D10C53E.3090601@erlang.org> Message-ID: <879E8C8A-AB43-46F8-B81F-E9E0AEA731FF@gmail.com> Hi Niclas! I have renamed my local function to reflect it's purpose more. With this change it's not ambiguous any more. Please refetch! git fetch git://github.com/imrehorvath/otp.git iso_8601_erl Best regards, Imre >> On Dec 15, 2010, at 9:56 AM, Niclas Axelsson wrote: >> >>> On 12/14/2010 11:26 PM, Imre Horvath wrote: >>>> >>>> Hi Niclas! Hi OTP Team! >>>> >>>> I have added the missing support for calculating the week number to the calendar module in the stdlib application. >>>> >>>> This implementation conforms to the ISO 8601 hence the name iso week number. >>>> >>>> Implementation is added, test suit for calendar extended with test case and also the documentation of calendar has been updated. >>>> >>>> Testing was successful. >>>> >>>> Please fetch! >>>> >>>> git fetch git://github.com/imrehorvath/otp.git iso_8601_erl >>>> >>>> Best regards, >>>> ImreHi >>> Thanks Imre, >>> Your patch looks good so I will include it into 'pu'. >>> >>> Regards, >>> Niclas Axelsson, Erlang/OTP >> > From tuncer.ayaz@REDACTED Sun Feb 20 19:27:15 2011 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Sun, 20 Feb 2011 19:27:15 +0100 Subject: Fix inet:port/1 doc to match implementation/spec Message-ID: git fetch git://github.com/tuncer/otp.git inet_port-doc From lukas@REDACTED Mon Feb 21 09:56:05 2011 From: lukas@REDACTED (Lukas Larsson) Date: Mon, 21 Feb 2011 09:56:05 +0100 Subject: Migration of Erlang/OTP test suites to Common Test Message-ID: <1298278565.2421.42.camel@bilbo> Hi everyone, As some of you have noticed, all of the test suites for Erlang/OTP have been converted from the Test Server format to the Common Test format. The tests can still be run using our test wrapper ts (see ts:help() for details about it) and now also using the ct_run command line utility (see https://github.com/erlang/otp/wiki/Running-tests for details about that). The migration is dependant on the latest dev version of Erlang/OTP so when running test suites with the new Common Test test suites, make sure that you are using the latest dev version of Erlang/OTP as well. If you have any questions about anything regarding Common Test, the new test suites and test runner, and cannot find the correct section in the Common Test documentation, just send me an email and I will point you in the right direction. Also as you explore the wonders that are the Erlang/OTP test suites, feel free to add more information to the github wiki ( https://github.com/erlang/otp/wiki/Running-tests ). Happy testing, Lukas Larsson, Erlang/OTP team From burbas@REDACTED Mon Feb 21 11:11:06 2011 From: burbas@REDACTED (Niclas Axelsson) Date: Mon, 21 Feb 2011 11:11:06 +0100 Subject: [erlang-patches] week number support In-Reply-To: <879E8C8A-AB43-46F8-B81F-E9E0AEA731FF@gmail.com> References: <430CE66B-5C3C-42F6-9620-ADDC84427CA5@gmail.com> <4CFCAF83.9080600@erlang.org> <4D0882B0.8040202@erlang.org> <4D57AA04-ED16-4E6D-AD6A-FB66B31A9B06@gmail.com> <4D10C53E.3090601@erlang.org> <879E8C8A-AB43-46F8-B81F-E9E0AEA731FF@gmail.com> Message-ID: <4D623A3A.6070503@erlang.org> On 02/20/2011 12:07 PM, Imre Horvath wrote: > Hi Niclas! > > I have renamed my local function to reflect it's purpose more. With this change it's not ambiguous any more. > > Please refetch! > > git fetch git://github.com/imrehorvath/otp.git iso_8601_erl > > Best regards, > Imre > Thanks Imre, I've refetched your branch. Regards, Niclas Axelsson, Erlang/OTP From burbas@REDACTED Mon Feb 21 11:11:50 2011 From: burbas@REDACTED (Niclas Axelsson) Date: Mon, 21 Feb 2011 11:11:50 +0100 Subject: [erlang-patches] Fix inet:port/1 doc to match implementation/spec In-Reply-To: References: Message-ID: <4D623A66.3030105@erlang.org> On 02/20/2011 07:27 PM, Tuncer Ayaz wrote: > git fetch git://github.com/tuncer/otp.git inet_port-doc > > ________________________________________________________________ > erlang-patches (at) erlang.org mailing list. > See http://www.erlang.org/faq.html > To unsubscribe; mailto:erlang-patches-unsubscribe@REDACTED > Thanks Tuncer, Merged your branch into 'pu'. Regards, Niclas Axelsson, Erlang/OTP From burbas@REDACTED Mon Feb 21 11:13:59 2011 From: burbas@REDACTED (Niclas Axelsson) Date: Mon, 21 Feb 2011 11:13:59 +0100 Subject: [erlang-patches] sendfile() In-Reply-To: References: <4CFD112B.704@erlang.org> <4D2F27EB.6080109@erlang.org> Message-ID: <4D623AE7.7050501@erlang.org> On 02/20/2011 10:57 AM, Tuncer Ayaz wrote: > On Thu, Jan 13, 2011 at 5:27 PM, Niclas Axelsson wrote: > >> Thanks Tuncer. Refetched your branch. >> > Please refetch. Resolved an issue in the test suite thanks to Steve Vinoski. > > ________________________________________________________________ > erlang-patches (at) erlang.org mailing list. > See http://www.erlang.org/faq.html > To unsubscribe; mailto:erlang-patches-unsubscribe@REDACTED > Thanks Tuncer. Refetched your branch. Regards, Niclas Axelsson, Erlang/OTP From simohayha.bobo@REDACTED Mon Feb 21 13:03:01 2011 From: simohayha.bobo@REDACTED (Simon Liu) Date: Mon, 21 Feb 2011 20:03:01 +0800 Subject: [erlang-patches] sendfile() In-Reply-To: References: Message-ID: hi , why not use TCP_CORK(in linux) or TCP_PUSH(in bsd)? On Sun, Sep 12, 2010 at 8:00 AM, Tuncer Ayaz wrote: > Originally suggested by Miguel Barreiro in the following thread > http://www.erlang.org/pipermail/erlang-patches/2003-November/000068.html > > The code found in this patch is based on that and > http://github.com/tuncer/sendfile which itself is based on the driver > found in Yaws. > > Windows support could be emulated with TransmitFile() but is not > implemented yet. > > Only Linux and Darwin support has been tested. FreeBSD and Solaris > should also work. > > This is a draft patch and I've added inline code comments (prefixed as > TODO items) where I saw potential for discussion. > > git fetch git://github.com/tuncer/otp.git sendfile > > ________________________________________________________________ > erlang-patches (at) erlang.org mailing list. > See http://www.erlang.org/faq.html > To unsubscribe; mailto:erlang-patches-unsubscribe@REDACTED > > -- ???? ??:www.douban.com/people/mustang/ blog: www.pagefault.info twitter: www.twitter.com/minibobo From tuncer.ayaz@REDACTED Mon Feb 21 19:07:48 2011 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Mon, 21 Feb 2011 19:07:48 +0100 Subject: [erlang-patches] sendfile() In-Reply-To: References: Message-ID: On Mon, Feb 21, 2011 at 1:03 PM, Simon Liu wrote: > > hi , why not use TCP_CORK(in linux) or TCP_PUSH(in bsd)? I'd like to get the current patch working and integrated first. Once that is done we can still approach this and see whether we'd like to expose TCP_CORK/TCP_NOPUSH/TransmitFile's TransmitBuffers param or hide it all and extend file:sendfile with Header/Tail parameters. From vinoski@REDACTED Mon Feb 21 19:39:06 2011 From: vinoski@REDACTED (Steve Vinoski) Date: Mon, 21 Feb 2011 13:39:06 -0500 Subject: [erlang-patches] sendfile() In-Reply-To: References: Message-ID: On Mon, Feb 21, 2011 at 1:07 PM, Tuncer Ayaz wrote: > On Mon, Feb 21, 2011 at 1:03 PM, Simon Liu wrote: >> >> hi , why not use TCP_CORK(in linux) or TCP_PUSH(in bsd)? > > I'd like to get the current patch working and integrated first. > > Once that is done we can still approach this and see whether we'd like > to expose TCP_CORK/TCP_NOPUSH/TransmitFile's TransmitBuffers param or > hide it all and extend file:sendfile with Header/Tail parameters. I agree with Tuncer: first make it work, then make it fast. There's still general integration and testing work to be done to get sendfile into an actual release, after which platform-specific features like those Tuncer mentions above will be easier to experiment with and evaluate. --steve From michael.santos@REDACTED Mon Feb 21 19:53:56 2011 From: michael.santos@REDACTED (Michael Santos) Date: Mon, 21 Feb 2011 13:53:56 -0500 Subject: [PATCH] inets: prevent XSS in error pages Message-ID: <20110221185356.GA24316@ecn.lan> Prevent user controlled input from being interpreted as HTML in error pages by encoding the reserved HTML characters. The reserved character set should be safe for displaying data within the body of HTML pages as outlined here: http://www.owasp.org/index.php/XSS_(Cross_Site_Scripting)_Prevention_Cheat_Sheet Previously, weird URLs were URI encoded in the error page. This worked quite well but the URL would be displayed in the HTML in percent encoded format. There was also a check for URIs that were already escaped (by the browser) that would fail if the browser sent an URI containing a "%", e.g.: w3m "http://localhost:8080/foo?%" Also encode the HTTP method and version, since it's possible they may be manipulated: FOO /index.html HTTP/1.0 GET /index.html foo/1.0 Encode the static messages to prevent characters from being interpreted as HTML such as "heavy load (>~w processes)". --- lib/inets/src/http_lib/http_util.erl | 18 +++++++++++++- lib/inets/src/http_server/httpd_util.erl | 38 +++++++++++++++--------------- lib/inets/test/httpd_basic_SUITE.erl | 11 ++++---- 3 files changed, 42 insertions(+), 25 deletions(-) diff --git a/lib/inets/src/http_lib/http_util.erl b/lib/inets/src/http_lib/http_util.erl index 4f11471..5e6b69a 100644 --- a/lib/inets/src/http_lib/http_util.erl +++ b/lib/inets/src/http_lib/http_util.erl @@ -25,7 +25,8 @@ hexlist_to_integer/1, integer_to_hexlist/1, convert_month/1, is_hostname/1, - timestamp/0, timeout/2 + timestamp/0, timeout/2, + html_encode/1 ]). @@ -187,6 +188,13 @@ timeout(Timeout, Started) -> end. +html_encode(Chars) -> + Reserved = sets:from_list([$&, $<, $>, $\", $', $/]), + lists:append(lists:map(fun(Char) -> + char_to_html_entity(Char, Reserved) + end, Chars)). + + %%%======================================================================== %%% Internal functions %%%======================================================================== @@ -235,3 +243,11 @@ convert_to_ascii([Num | Reversed], Number) convert_to_ascii([Num | Reversed], Number) when (Num > 9) andalso (Num < 16) -> convert_to_ascii(Reversed, [Num + 55 | Number]). + +char_to_html_entity(Char, Reserved) -> + case sets:is_element(Char, Reserved) of + true -> + "&#" ++ integer_to_list(Char) ++ ";"; + false -> + [Char] + end. diff --git a/lib/inets/src/http_server/httpd_util.erl b/lib/inets/src/http_server/httpd_util.erl index 789f126..c1aff65 100644 --- a/lib/inets/src/http_server/httpd_util.erl +++ b/lib/inets/src/http_server/httpd_util.erl @@ -181,7 +181,7 @@ message(304, _URL,_) -> message(400,none,_) -> "Your browser sent a query that this server could not understand."; message(400,Msg,_) -> - "Your browser sent a query that this server could not understand. "++ maybe_encode(Msg); + "Your browser sent a query that this server could not understand. "++ http_util:html_encode(Msg); message(401,none,_) -> "This server could not verify that you are authorized to access the document you @@ -190,48 +190,48 @@ credentials (e.g., bad password), or your browser doesn't understand how to supply the credentials required."; message(403,RequestURI,_) -> - "You don't have permission to access "++ maybe_encode(RequestURI) ++" on this server."; + "You don't have permission to access "++ http_util:html_encode(RequestURI) ++" on this server."; message(404,RequestURI,_) -> - "The requested URL " ++ maybe_encode(RequestURI) ++ " was not found on this server."; + "The requested URL " ++ http_util:html_encode(RequestURI) ++ " was not found on this server."; message(408, Timeout, _) -> Timeout; message(412,none,_) -> - "The requested preconditions where false"; + "The requested preconditions were false"; message(413, Reason,_) -> - "Entity: " ++ Reason; + "Entity: " ++ http_util:html_encode(Reason); message(414,ReasonPhrase,_) -> - "Message "++ ReasonPhrase ++"."; + "Message "++ http_util:html_encode(ReasonPhrase) ++"."; message(416,ReasonPhrase,_) -> - ReasonPhrase; + http_util:html_encode(ReasonPhrase); message(500,_,ConfigDB) -> ServerAdmin=lookup(ConfigDB,server_admin,"unknown@REDACTED"), "The server encountered an internal error or " "misconfiguration and was unable to complete " "your request.

Please contact the server administrator " - ++ ServerAdmin ++ ", and inform them of the time the error occurred " + ++ http_util:html_encode(ServerAdmin) ++ ", and inform them of the time the error occurred " "and anything you might have done that may have caused the error."; message(501,{Method, RequestURI, HTTPVersion}, _ConfigDB) -> if is_atom(Method) -> - atom_to_list(Method)++ - " to "++ maybe_encode(RequestURI)++" ("++HTTPVersion++") not supported."; + http_util:html_encode(atom_to_list(Method))++ + " to "++ http_util:html_encode(RequestURI)++" ("++ http_util:html_encode(HTTPVersion)++") not supported."; is_list(Method) -> - Method++ - " to "++ maybe_encode(RequestURI)++" ("++HTTPVersion++") not supported." + http_util:html_encode(Method)++ + " to "++ http_util:html_encode(RequestURI)++" ("++ http_util:html_encode(HTTPVersion)++") not supported." end; message(503, String, _ConfigDB) -> - "This service in unavailable due to: "++String. + "This service in unavailable due to: "++ http_util:html_encode(String). maybe_encode(URI) -> - case lists:member($%, URI) of - true -> - URI; - false -> - http_uri:encode(URI) - end. + Decoded = try http_uri:decode(URI) of + N -> N + catch + error:_ -> URI + end, + http_uri:encode(Decoded). %%convert_rfc_date(Date)->{{YYYY,MM,DD},{HH,MIN,SEC}} diff --git a/lib/inets/test/httpd_basic_SUITE.erl b/lib/inets/test/httpd_basic_SUITE.erl index 9ba2e73..cdd3350 100644 --- a/lib/inets/test/httpd_basic_SUITE.erl +++ b/lib/inets/test/httpd_basic_SUITE.erl @@ -148,12 +148,13 @@ escaped_url_in_error_body(Config) when is_list(Config) -> URL = ?URL_START ++ integer_to_list(Port) ++ Path, EscapedPath = http_uri:encode(Path), {ok, {404, Body}} = httpc:request(get, {URL, []}, - [{url_encode, true}], - [{version, "HTTP/1.0"}, {full_result, false}]), + [{url_encode, true}, {version, "HTTP/1.0"}], + [{full_result, false}]), EscapedPath = find_URL_path(string:tokens(Body, " ")), - {ok, {404, Body1}} = httpc:request(get, {URL, []}, [], - [{version, "HTTP/1.0"}, {full_result, false}]), - EscapedPath = find_URL_path(string:tokens(Body1, " ")), + {ok, {404, Body1}} = httpc:request(get, {URL, []}, + [{version, "HTTP/1.0"}], [{full_result, false}]), + HTMLEncodedPath = http_util:html_encode(Path), + HTMLEncodedPath = find_URL_path(string:tokens(Body1, " ")), inets:stop(httpd, Pid). find_URL_path([]) -> -- 1.7.0.4 From burbas@REDACTED Tue Feb 22 16:37:23 2011 From: burbas@REDACTED (Niclas Axelsson) Date: Tue, 22 Feb 2011 16:37:23 +0100 Subject: [erlang-patches] [PATCH] inets: prevent XSS in error pages In-Reply-To: <20110221185356.GA24316@ecn.lan> References: <20110221185356.GA24316@ecn.lan> Message-ID: <4D63D833.9070803@erlang.org> On 02/21/2011 07:53 PM, Michael Santos wrote: > Prevent user controlled input from being interpreted as HTML in error > pages by encoding the reserved HTML characters. The reserved character > set should be safe for displaying data within the body of HTML pages > as outlined here: > > http://www.owasp.org/index.php/XSS_(Cross_Site_Scripting)_Prevention_Cheat_Sheet > > Previously, weird URLs were URI encoded in the error page. This worked > quite well but the URL would be displayed in the HTML in percent encoded > format. There was also a check for URIs that were already escaped (by > the browser) that would fail if the browser sent an URI containing a > "%", e.g.: > > w3m "http://localhost:8080/foo?%" > > Also encode the HTTP method and version, since it's possible they may be > manipulated: > > FOO /index.html HTTP/1.0 > GET /index.htmlfoo/1.0 > > Encode the static messages to prevent characters from being interpreted > as HTML such as "heavy load (>~w processes)". > --- > lib/inets/src/http_lib/http_util.erl | 18 +++++++++++++- > lib/inets/src/http_server/httpd_util.erl | 38 +++++++++++++++--------------- > lib/inets/test/httpd_basic_SUITE.erl | 11 ++++---- > 3 files changed, 42 insertions(+), 25 deletions(-) > > diff --git a/lib/inets/src/http_lib/http_util.erl b/lib/inets/src/http_lib/http_util.erl > index 4f11471..5e6b69a 100644 > --- a/lib/inets/src/http_lib/http_util.erl > +++ b/lib/inets/src/http_lib/http_util.erl > @@ -25,7 +25,8 @@ > hexlist_to_integer/1, integer_to_hexlist/1, > convert_month/1, > is_hostname/1, > - timestamp/0, timeout/2 > + timestamp/0, timeout/2, > + html_encode/1 > ]). > > > @@ -187,6 +188,13 @@ timeout(Timeout, Started) -> > end. > > > +html_encode(Chars) -> > + Reserved = sets:from_list([$&, $<, $>, $\", $', $/]), > + lists:append(lists:map(fun(Char) -> > + char_to_html_entity(Char, Reserved) > + end, Chars)). > + > + > %%%======================================================================== > %%% Internal functions > %%%======================================================================== > @@ -235,3 +243,11 @@ convert_to_ascii([Num | Reversed], Number) > convert_to_ascii([Num | Reversed], Number) > when (Num> 9) andalso (Num< 16) -> > convert_to_ascii(Reversed, [Num + 55 | Number]). > + > +char_to_html_entity(Char, Reserved) -> > + case sets:is_element(Char, Reserved) of > + true -> > + "&#" ++ integer_to_list(Char) ++ ";"; > + false -> > + [Char] > + end. > diff --git a/lib/inets/src/http_server/httpd_util.erl b/lib/inets/src/http_server/httpd_util.erl > index 789f126..c1aff65 100644 > --- a/lib/inets/src/http_server/httpd_util.erl > +++ b/lib/inets/src/http_server/httpd_util.erl > @@ -181,7 +181,7 @@ message(304, _URL,_) -> > message(400,none,_) -> > "Your browser sent a query that this server could not understand."; > message(400,Msg,_) -> > - "Your browser sent a query that this server could not understand. "++ maybe_encode(Msg); > + "Your browser sent a query that this server could not understand. "++ http_util:html_encode(Msg); > message(401,none,_) -> > "This server could not verify that you > are authorized to access the document you > @@ -190,48 +190,48 @@ credentials (e.g., bad password), or your > browser doesn't understand how to supply > the credentials required."; > message(403,RequestURI,_) -> > - "You don't have permission to access "++ maybe_encode(RequestURI) ++" on this server."; > + "You don't have permission to access "++ http_util:html_encode(RequestURI) ++" on this server."; > message(404,RequestURI,_) -> > - "The requested URL " ++ maybe_encode(RequestURI) ++ " was not found on this server."; > + "The requested URL " ++ http_util:html_encode(RequestURI) ++ " was not found on this server."; > message(408, Timeout, _) -> > Timeout; > message(412,none,_) -> > - "The requested preconditions where false"; > + "The requested preconditions were false"; > message(413, Reason,_) -> > - "Entity: " ++ Reason; > + "Entity: " ++ http_util:html_encode(Reason); > message(414,ReasonPhrase,_) -> > - "Message "++ ReasonPhrase ++"."; > + "Message "++ http_util:html_encode(ReasonPhrase) ++"."; > message(416,ReasonPhrase,_) -> > - ReasonPhrase; > + http_util:html_encode(ReasonPhrase); > > message(500,_,ConfigDB) -> > ServerAdmin=lookup(ConfigDB,server_admin,"unknown@REDACTED"), > "The server encountered an internal error or " > "misconfiguration and was unable to complete " > "your request.

Please contact the server administrator " > - ++ ServerAdmin ++ ", and inform them of the time the error occurred " > + ++ http_util:html_encode(ServerAdmin) ++ ", and inform them of the time the error occurred " > "and anything you might have done that may have caused the error."; > > message(501,{Method, RequestURI, HTTPVersion}, _ConfigDB) -> > if > is_atom(Method) -> > - atom_to_list(Method)++ > - " to "++ maybe_encode(RequestURI)++" ("++HTTPVersion++") not supported."; > + http_util:html_encode(atom_to_list(Method))++ > + " to "++ http_util:html_encode(RequestURI)++" ("++ http_util:html_encode(HTTPVersion)++") not supported."; > is_list(Method) -> > - Method++ > - " to "++ maybe_encode(RequestURI)++" ("++HTTPVersion++") not supported." > + http_util:html_encode(Method)++ > + " to "++ http_util:html_encode(RequestURI)++" ("++ http_util:html_encode(HTTPVersion)++") not supported." > end; > > message(503, String, _ConfigDB) -> > - "This service in unavailable due to: "++String. > + "This service in unavailable due to: "++ http_util:html_encode(String). > > maybe_encode(URI) -> > - case lists:member($%, URI) of > - true -> > - URI; > - false -> > - http_uri:encode(URI) > - end. > + Decoded = try http_uri:decode(URI) of > + N -> N > + catch > + error:_ -> URI > + end, > + http_uri:encode(Decoded). > > %%convert_rfc_date(Date)->{{YYYY,MM,DD},{HH,MIN,SEC}} > > diff --git a/lib/inets/test/httpd_basic_SUITE.erl b/lib/inets/test/httpd_basic_SUITE.erl > index 9ba2e73..cdd3350 100644 > --- a/lib/inets/test/httpd_basic_SUITE.erl > +++ b/lib/inets/test/httpd_basic_SUITE.erl > @@ -148,12 +148,13 @@ escaped_url_in_error_body(Config) when is_list(Config) -> > URL = ?URL_START ++ integer_to_list(Port) ++ Path, > EscapedPath = http_uri:encode(Path), > {ok, {404, Body}} = httpc:request(get, {URL, []}, > - [{url_encode, true}], > - [{version, "HTTP/1.0"}, {full_result, false}]), > + [{url_encode, true}, {version, "HTTP/1.0"}], > + [{full_result, false}]), > EscapedPath = find_URL_path(string:tokens(Body, " ")), > - {ok, {404, Body1}} = httpc:request(get, {URL, []}, [], > - [{version, "HTTP/1.0"}, {full_result, false}]), > - EscapedPath = find_URL_path(string:tokens(Body1, " ")), > + {ok, {404, Body1}} = httpc:request(get, {URL, []}, > + [{version, "HTTP/1.0"}], [{full_result, false}]), > + HTMLEncodedPath = http_util:html_encode(Path), > + HTMLEncodedPath = find_URL_path(string:tokens(Body1, " ")), > inets:stop(httpd, Pid). > > find_URL_path([]) -> > Thanks Michael, Your patch is now included in 'pu'. Regards, Niclas Axelsson, Erlang/OTP From jimenezrick@REDACTED Tue Feb 22 23:36:49 2011 From: jimenezrick@REDACTED (Ricardo Catalinas =?iso-8859-1?Q?Jim=E9nez?=) Date: Tue, 22 Feb 2011 23:36:49 +0100 Subject: Fix typo in doc of rpc:pmap/3 Message-ID: <20110222223649.GG5250@viper.server01.org> git fetch git://github.com/jimenezrick/otp.git doc_typo-rpc_pmap -- Ricardo From cristian@REDACTED Wed Feb 23 01:47:10 2011 From: cristian@REDACTED (Cristian Greco) Date: Wed, 23 Feb 2011 01:47:10 +0100 Subject: Fix some wrong pointer dereferences Message-ID: <20110223014710.2846edf0@regolo> Hi, this commit should fix some wrong (bad) pointer dereferences. git fetch git@REDACTED:cristiangreco/otp.git cg/fix-pointer-dereference Thanks, -- Cristian Greco GPG key ID: 0xCF4D32E4 -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: not available URL: From bernie@REDACTED Wed Feb 23 05:59:17 2011 From: bernie@REDACTED (Bernard Duggan) Date: Wed, 23 Feb 2011 15:59:17 +1100 Subject: Allow mod_esi:deliver/2 to handle binary data Message-ID: <4D649425.2050804@m5net.com> Hi all, We've been using mod_esi to deliver binary files over HTTP. In testing, some particularly large files were thrown at it and we ended up exhausting the VM's memory and crashing it. The ultimate problem is that mod_esi:deliver/2 is asynchronous, so there's no way to know how fast or slowly to feed it data to avoid the target process' queue getting too big. That's a bit of a trickier problem than I could quickly deal with (not least because it would require an interface change/addition). Instead, to mitigate the problem I've made a small change which allows mod_esi:deliver/2 to take binary data, rather than forcing the caller to convert it to a list first (and thus avoiding both the conversion cost and the copy cost as the list is passed between processes). You can grab it with git fetch git://github.com/bernardd/otp.git mod_esi_binary Cheers, Bernard From tuncer.ayaz@REDACTED Wed Feb 23 06:01:10 2011 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Wed, 23 Feb 2011 06:01:10 +0100 Subject: [erlang-patches] sendfile() In-Reply-To: <4D623AE7.7050501@erlang.org> References: <4CFD112B.704@erlang.org> <4D2F27EB.6080109@erlang.org> <4D623AE7.7050501@erlang.org> Message-ID: On Mon, Feb 21, 2011 at 11:13 AM, Niclas Axelsson wrote: > > Refetched your branch. Please refetch. Fixed error propagation, extended tests accordingly, and slightly changed documentation. From jay@REDACTED Wed Feb 23 06:50:28 2011 From: jay@REDACTED (jay@REDACTED) Date: Tue, 22 Feb 2011 21:50:28 -0800 Subject: Removed spurious reference in gen_stream Message-ID: <386ad152c3e3d02640020654b07e380c.squirrel@duomark.com> The lib/stdlib/test/Makefile in gen_stream referenced a non-existent module (gen_stream_shell_SUITE). This reference is now removed and it should compile and run cleanly. git fetch git://github.com/jaynel/otp.git gen_stream jay From mikpe@REDACTED Wed Feb 23 10:02:32 2011 From: mikpe@REDACTED (Mikael Pettersson) Date: Wed, 23 Feb 2011 10:02:32 +0100 Subject: [erlang-patches] Fix some wrong pointer dereferences In-Reply-To: <20110223014710.2846edf0@regolo> References: <20110223014710.2846edf0@regolo> Message-ID: <19812.52520.96473.209316@pilspetsen.it.uu.se> Cristian Greco writes: > Hi, > > this commit should fix some wrong (bad) pointer dereferences. > > git fetch git@REDACTED:cristiangreco/otp.git cg/fix-pointer-dereference Looks correct to me. The current code there is obviously broken. From tuncer.ayaz@REDACTED Wed Feb 23 19:06:23 2011 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Wed, 23 Feb 2011 19:06:23 +0100 Subject: Fix typos in zip manpage Message-ID: git fetch git://github.com/tuncer/otp.git zip-doc From kostis@REDACTED Wed Feb 23 23:22:10 2011 From: kostis@REDACTED (Kostis Sagonas) Date: Thu, 24 Feb 2011 00:22:10 +0200 Subject: Fix buglet in erl_recomment Message-ID: <4D658892.6040802@cs.ntua.gr> Please include in 'dev' -- fixes a bug reported by Hans Bolinder git fetch git://github.com/kostis/otp.git erl_recomment Kostis From burbas@REDACTED Thu Feb 24 16:41:08 2011 From: burbas@REDACTED (Niclas Axelsson) Date: Thu, 24 Feb 2011 16:41:08 +0100 Subject: [erlang-patches] Fix typo in doc of rpc:pmap/3 In-Reply-To: <20110222223649.GG5250@viper.server01.org> References: <20110222223649.GG5250@viper.server01.org> Message-ID: <4D667C14.3060400@erlang.org> On 02/22/2011 11:36 PM, Ricardo Catalinas Jim?nez wrote: > git fetch git://github.com/jimenezrick/otp.git doc_typo-rpc_pmap > > Thanks Ricardo, I've merged your branch into 'pu'. Regards, Niclas Axelsson, Erlang/OTP From burbas@REDACTED Thu Feb 24 16:44:34 2011 From: burbas@REDACTED (Niclas Axelsson) Date: Thu, 24 Feb 2011 16:44:34 +0100 Subject: [erlang-patches] sendfile() In-Reply-To: References: <4CFD112B.704@erlang.org> <4D2F27EB.6080109@erlang.org> <4D623AE7.7050501@erlang.org> Message-ID: <4D667CE2.5050805@erlang.org> On 02/23/2011 06:01 AM, Tuncer Ayaz wrote: > On Mon, Feb 21, 2011 at 11:13 AM, Niclas Axelsson wrote: > >> Refetched your branch. >> > Please refetch. Fixed error propagation, extended tests accordingly, > and slightly changed documentation. > > ________________________________________________________________ > erlang-patches (at) erlang.org mailing list. > See http://www.erlang.org/faq.html > To unsubscribe; mailto:erlang-patches-unsubscribe@REDACTED > Thanks Tuncer. Refetched your branch. Regards, Niclas Axelsson, Erlang/OTP From burbas@REDACTED Thu Feb 24 16:46:49 2011 From: burbas@REDACTED (Niclas Axelsson) Date: Thu, 24 Feb 2011 16:46:49 +0100 Subject: [erlang-patches] Removed spurious reference in gen_stream In-Reply-To: <386ad152c3e3d02640020654b07e380c.squirrel@duomark.com> References: <386ad152c3e3d02640020654b07e380c.squirrel@duomark.com> Message-ID: <4D667D69.7010602@erlang.org> On 02/23/2011 06:50 AM, jay@REDACTED wrote: > The lib/stdlib/test/Makefile in gen_stream referenced a non-existent > module (gen_stream_shell_SUITE). This reference is now removed and it > should compile and run cleanly. > > git fetch git://github.com/jaynel/otp.git gen_stream > > > jay > > > > ________________________________________________________________ > erlang-patches (at) erlang.org mailing list. > See http://www.erlang.org/faq.html > To unsubscribe; mailto:erlang-patches-unsubscribe@REDACTED > Thanks Jay. Your branch is refetched. Regards, Niclas Axelsson, Erlang/OTP From burbas@REDACTED Thu Feb 24 16:48:36 2011 From: burbas@REDACTED (Niclas Axelsson) Date: Thu, 24 Feb 2011 16:48:36 +0100 Subject: [erlang-patches] Fix some wrong pointer dereferences In-Reply-To: <20110223014710.2846edf0@regolo> References: <20110223014710.2846edf0@regolo> Message-ID: <4D667DD4.9050904@erlang.org> On 02/23/2011 01:47 AM, Cristian Greco wrote: > Hi, > > this commit should fix some wrong (bad) pointer dereferences. > > git fetch git@REDACTED:cristiangreco/otp.git cg/fix-pointer-dereference > > Thanks, > -- > Cristian Greco > GPG key ID: 0xCF4D32E4 > Thanks Cristian, Your patch is included in 'pu'. Regards, Niclas Axelsson, Erlang/OTP From burbas@REDACTED Thu Feb 24 16:51:29 2011 From: burbas@REDACTED (Niclas Axelsson) Date: Thu, 24 Feb 2011 16:51:29 +0100 Subject: [erlang-patches] Fix typos in zip manpage In-Reply-To: References: Message-ID: <4D667E81.2070601@erlang.org> On 02/23/2011 07:06 PM, Tuncer Ayaz wrote: > git fetch git://github.com/tuncer/otp.git zip-doc > > ________________________________________________________________ > erlang-patches (at) erlang.org mailing list. > See http://www.erlang.org/faq.html > To unsubscribe; mailto:erlang-patches-unsubscribe@REDACTED > Thanks Tuncer, Your patch is merged into 'pu'. Regards, Niclas Axelsson, Erlang/OTP From burbas@REDACTED Thu Feb 24 16:55:06 2011 From: burbas@REDACTED (Niclas Axelsson) Date: Thu, 24 Feb 2011 16:55:06 +0100 Subject: [erlang-patches] Fix buglet in erl_recomment In-Reply-To: <4D658892.6040802@cs.ntua.gr> References: <4D658892.6040802@cs.ntua.gr> Message-ID: <4D667F5A.3040005@erlang.org> On 02/23/2011 11:22 PM, Kostis Sagonas wrote: > Please include in 'dev' -- fixes a bug reported by Hans Bolinder > > git fetch git://github.com/kostis/otp.git erl_recomment > > Kostis > > ________________________________________________________________ > erlang-patches (at) erlang.org mailing list. > See http://www.erlang.org/faq.html > To unsubscribe; mailto:erlang-patches-unsubscribe@REDACTED Thanks Kostis, I've merged your branch into 'opu' and will move it over to 'dev' tomorrow. Regards, Niclas Axelsson, Erlang/OTP From burbas@REDACTED Thu Feb 24 16:56:10 2011 From: burbas@REDACTED (Niclas Axelsson) Date: Thu, 24 Feb 2011 16:56:10 +0100 Subject: [erlang-patches] Allow mod_esi:deliver/2 to handle binary data In-Reply-To: <4D649425.2050804@m5net.com> References: <4D649425.2050804@m5net.com> Message-ID: <4D667F9A.2050405@erlang.org> On 02/23/2011 05:59 AM, Bernard Duggan wrote: > Hi all, > We've been using mod_esi to deliver binary files over HTTP. In > testing, some particularly large files were thrown at it and we ended > up exhausting the VM's memory and crashing it. The ultimate problem > is that mod_esi:deliver/2 is asynchronous, so there's no way to know > how fast or slowly to feed it data to avoid the target process' queue > getting too big. That's a bit of a trickier problem than I could > quickly deal with (not least because it would require an interface > change/addition). > Instead, to mitigate the problem I've made a small change which > allows mod_esi:deliver/2 to take binary data, rather than forcing the > caller to convert it to a list first (and thus avoiding both the > conversion cost and the copy cost as the list is passed between > processes). > > You can grab it with > > git fetch git://github.com/bernardd/otp.git mod_esi_binary > > Cheers, > > Bernard > > > ________________________________________________________________ > erlang-patches (at) erlang.org mailing list. > See http://www.erlang.org/faq.html > To unsubscribe; mailto:erlang-patches-unsubscribe@REDACTED Thanks Bernard, Your patch have been merged to 'pu'. Regards, Niclas Axelsson, Erlang/OTP From fdmanana@REDACTED Thu Feb 24 18:00:30 2011 From: fdmanana@REDACTED (Filipe David Manana) Date: Thu, 24 Feb 2011 17:00:30 +0000 Subject: Suggestion for a minor improvement in the man pages Message-ID: Hi, I find it useful to have in the man pages information about in which release a particular function was introduced. For example, file:advise/4 was added in R14A, but such information is only found (afaik) in the release notes for R14A . For example, Java's API documentation normally adds this type of information in a "Since" field, for example: http://download.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html Does anyone else would value this addition? What does the OTP team thinks? regards, -- Filipe David Manana, fdmanana@REDACTED, fdmanana@REDACTED "Reasonable men adapt themselves to the world. ?Unreasonable men adapt the world to themselves. ?That's why all progress depends on unreasonable men." From vinoski@REDACTED Fri Feb 25 06:56:40 2011 From: vinoski@REDACTED (Steve Vinoski) Date: Fri, 25 Feb 2011 00:56:40 -0500 Subject: add enif_is_exception Message-ID: This patch adds a new NIF API function enif_is_exception to allow applications to check whether an ERL_NIF_TERM is an exception or not. It adds a new test for the new function and also documents the new function. It also clarifies what applications are permitted to do with the ERL_NIF_TERM returned from enif_make_badarg. git fetch git://github.com/vinoski/otp.git enif_is_exception Thanks to Sverker Eriksson for guidance in putting this patch together. --steve From fdmanana@REDACTED Fri Feb 25 08:37:49 2011 From: fdmanana@REDACTED (Filipe David Manana) Date: Fri, 25 Feb 2011 07:37:49 +0000 Subject: [erlang-questions] Suggestion for a minor improvement in the man pages In-Reply-To: References: <1304022D-309A-4D9A-A2AB-4BA56F9A84BB@gmail.com> Message-ID: I'm aware of erl docs, but besides not covering releases older than R13B03, it's not official, plus it's web based. I really like checking man pages in the console :) cheers On Fri, Feb 25, 2011 at 7:32 AM, Fredrik Andersson wrote: > While erldocs is a great site I second the inclusion of introduced at > information in the docs. It would be really helpfull. > > On Fri, Feb 25, 2011 at 2:19 AM, James Churchman > wrote: > >> http://erldocs.com/ has separate sections for each otp release from 13B03 >> if of help :-) >> >> >> On 24 Feb 2011, at 17:00, Filipe David Manana wrote: >> >> > Hi, >> > >> > I find it useful to have in the man pages information about in which >> > release a particular function was introduced. >> > For example, file:advise/4 was added in R14A, but such information is >> > only found (afaik) in the release notes for R14A . >> > >> > For example, Java's API documentation normally adds this type of >> > information in a "Since" field, for example: >> > >> http://download.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html >> > >> > Does anyone else would value this addition? >> > What does the OTP team thinks? >> > >> > regards, >> > -- >> > Filipe David Manana, >> > fdmanana@REDACTED, fdmanana@REDACTED >> > >> > "Reasonable men adapt themselves to the world. >> > ?Unreasonable men adapt the world to themselves. >> > ?That's why all progress depends on unreasonable men." >> > >> > ________________________________________________________________ >> > erlang-questions (at) erlang.org mailing list. >> > See http://www.erlang.org/faq.html >> > To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED >> > >> >> > -- Filipe David Manana, fdmanana@REDACTED, fdmanana@REDACTED "Reasonable men adapt themselves to the world. ?Unreasonable men adapt the world to themselves. ?That's why all progress depends on unreasonable men." From tuncer.ayaz@REDACTED Fri Feb 25 11:28:38 2011 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Fri, 25 Feb 2011 11:28:38 +0100 Subject: [erlang-patches] sendfile() In-Reply-To: <4D667CE2.5050805@erlang.org> References: <4CFD112B.704@erlang.org> <4D2F27EB.6080109@erlang.org> <4D623AE7.7050501@erlang.org> <4D667CE2.5050805@erlang.org> Message-ID: On Thu, Feb 24, 2011 at 4:44 PM, Niclas Axelsson wrote: > Thanks Tuncer. > > Refetched your branch. Please refetch. Fixed a test case and reduced the changes to efile_drv by 47 lines. From burbas@REDACTED Fri Feb 25 11:53:52 2011 From: burbas@REDACTED (Niclas Axelsson) Date: Fri, 25 Feb 2011 11:53:52 +0100 Subject: [erlang-patches] sendfile() In-Reply-To: References: <4CFD112B.704@erlang.org> <4D2F27EB.6080109@erlang.org> <4D623AE7.7050501@erlang.org> <4D667CE2.5050805@erlang.org> Message-ID: <4D678A40.9090503@erlang.org> On 02/25/2011 11:28 AM, Tuncer Ayaz wrote: > On Thu, Feb 24, 2011 at 4:44 PM, Niclas Axelsson wrote: > >> Thanks Tuncer. >> >> Refetched your branch. >> > Please refetch. > Fixed a test case and reduced the changes to efile_drv by 47 lines. > Thank you Tuncer, Your branch is refetched. Regards, Niclas Axelsson, Erlang/OTP From magnus.henoch@REDACTED Fri Feb 25 12:03:34 2011 From: magnus.henoch@REDACTED (Magnus Henoch) Date: Fri, 25 Feb 2011 11:03:34 +0000 (GMT) Subject: [PATCH] Don't shorten error messages in Eunit Surefire reports Message-ID: <1451277797.36891298631814306.JavaMail.root@zimbra> Currently, error messages in Eunit Surefire reports are shortened just like when written to a terminal. However, the space limitations that constrain terminal output do not apply here, so it's more useful to include the unshortened error message. Getting the full error message can be particularly helpful when an assertMatch fails because of a long and deep error term. --- lib/eunit/src/eunit_surefire.erl | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/eunit/src/eunit_surefire.erl b/lib/eunit/src/eunit_surefire.erl index eb994a9..e184df1 100644 --- a/lib/eunit/src/eunit_surefire.erl +++ b/lib/eunit/src/eunit_surefire.erl @@ -323,7 +323,7 @@ write_testcase( format_testcase_result(ok) -> [<<>>]; format_testcase_result({failed, {error, {Type, _}, _} = Exception}) when is_atom(Type) -> [?INDENT, ?INDENT, <<">, escape_attr(atom_to_list(Type)), <<"\">">>, ?NEWLINE, - <<"::">>, escape_text(eunit_lib:format_exception(Exception)), + <<"::">>, escape_text(io_lib:format("~p", [Exception])), ?INDENT, ?INDENT, <<"">>, ?NEWLINE]; format_testcase_result({failed, Term}) -> [?INDENT, ?INDENT, <<"">>, ?NEWLINE, @@ -331,7 +331,7 @@ format_testcase_result({failed, Term}) -> ?INDENT, ?INDENT, <<"">>, ?NEWLINE]; format_testcase_result({aborted, {Class, _Term, _Trace} = Exception}) when is_atom(Class) -> [?INDENT, ?INDENT, <<">, escape_attr(atom_to_list(Class)), <<"\">">>, ?NEWLINE, - <<"::">>, escape_text(eunit_lib:format_exception(Exception)), + <<"::">>, escape_text(io_lib:format("~p", [Exception])), ?INDENT, ?INDENT, <<"">>, ?NEWLINE]; format_testcase_result({aborted, Term}) -> [?INDENT, ?INDENT, <<"">>, ?NEWLINE, -- 1.7.0.4 From burbas@REDACTED Fri Feb 25 17:27:57 2011 From: burbas@REDACTED (Niclas Axelsson) Date: Fri, 25 Feb 2011 17:27:57 +0100 Subject: [erlang-patches] add enif_is_exception In-Reply-To: References: Message-ID: <4D67D88D.6090405@erlang.org> On 02/25/2011 06:56 AM, Steve Vinoski wrote: > This patch adds a new NIF API function enif_is_exception to allow > applications to check whether an ERL_NIF_TERM is an exception or not. > It adds a new test for the new function and also documents the new > function. It also clarifies what applications are permitted to do with > the ERL_NIF_TERM returned from enif_make_badarg. > > git fetch git://github.com/vinoski/otp.git enif_is_exception > > Thanks to Sverker Eriksson for guidance in putting this patch together. > > --steve > > ________________________________________________________________ > erlang-patches (at) erlang.org mailing list. > See http://www.erlang.org/faq.html > To unsubscribe; mailto:erlang-patches-unsubscribe@REDACTED > Thanks Steve, Included in 'pu'. Regards, Niclas Axelsson, Erlang/OTP From burbas@REDACTED Fri Feb 25 17:32:02 2011 From: burbas@REDACTED (Niclas Axelsson) Date: Fri, 25 Feb 2011 17:32:02 +0100 Subject: [erlang-patches] [PATCH] Don't shorten error messages in Eunit Surefire reports In-Reply-To: <1451277797.36891298631814306.JavaMail.root@zimbra> References: <1451277797.36891298631814306.JavaMail.root@zimbra> Message-ID: <4D67D982.5060608@erlang.org> On 02/25/2011 12:03 PM, Magnus Henoch wrote: > Currently, error messages in Eunit Surefire reports are shortened just > like when written to a terminal. However, the space limitations that > constrain terminal output do not apply here, so it's more useful to > include the unshortened error message. Getting the full error > message can be particularly helpful when an assertMatch fails because > of a long and deep error term. > --- > lib/eunit/src/eunit_surefire.erl | 4 ++-- > 1 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/lib/eunit/src/eunit_surefire.erl b/lib/eunit/src/eunit_surefire.erl > index eb994a9..e184df1 100644 > --- a/lib/eunit/src/eunit_surefire.erl > +++ b/lib/eunit/src/eunit_surefire.erl > @@ -323,7 +323,7 @@ write_testcase( > format_testcase_result(ok) -> [<<>>]; > format_testcase_result({failed, {error, {Type, _}, _} = Exception}) when is_atom(Type) -> > [?INDENT, ?INDENT,<<">, escape_attr(atom_to_list(Type)),<<"\">">>, ?NEWLINE, > -<<"::">>, escape_text(eunit_lib:format_exception(Exception)), > +<<"::">>, escape_text(io_lib:format("~p", [Exception])), > ?INDENT, ?INDENT,<<"">>, ?NEWLINE]; > format_testcase_result({failed, Term}) -> > [?INDENT, ?INDENT,<<"">>, ?NEWLINE, > @@ -331,7 +331,7 @@ format_testcase_result({failed, Term}) -> > ?INDENT, ?INDENT,<<"">>, ?NEWLINE]; > format_testcase_result({aborted, {Class, _Term, _Trace} = Exception}) when is_atom(Class) -> > [?INDENT, ?INDENT,<<">, escape_attr(atom_to_list(Class)),<<"\">">>, ?NEWLINE, > -<<"::">>, escape_text(eunit_lib:format_exception(Exception)), > +<<"::">>, escape_text(io_lib:format("~p", [Exception])), > ?INDENT, ?INDENT,<<"">>, ?NEWLINE]; > format_testcase_result({aborted, Term}) -> > [?INDENT, ?INDENT,<<"">>, ?NEWLINE, > Thanks Magnus, Included in 'pu'. Regards, Niclas Axelsson, Erlang/OTP From burbas@REDACTED Fri Feb 25 18:08:56 2011 From: burbas@REDACTED (Niclas Axelsson) Date: Fri, 25 Feb 2011 18:08:56 +0100 Subject: What's cooking in erlang/otp (2011-02-25) Message-ID: <201102251708.p1PH8sfn000404@smaug.otp.ericsson.se> ------------------------------------------------------------ [Graduated] * ms/ei-buffer-overflow-when-decoding-atoms (erl_interface) (2011-01-23) 1 commit + ei: buffer overflow when decoding atoms (0b9795f) * ms/ei-fix-buffer-overflows (erl_interface) (2011-01-23) 1 commit + erl_interface: fix buffer overflows (eed4341) ------------------------------------------------------------ [New topics] * bd/mod_esi_binary (inets) (2011-02-23) 1 commit - Modify mod_esi:deliver/2 to accept binary data (73f261d) * cg/fix-pointer-dereference (erts) (2011-02-23) 1 commit - Fix some wrong pointer dereferences (47f9ef2) * ks/erl_recomment (syntax_tools) (2011-02-23) 1 commit - Fix bug with some comments disappearing (64eb70d) * mh/eunit-surefire-reports (eunit) (2011-02-25) 1 commit - Don't shorten error messages in Eunit Surefire reports (d0cc2ae) * ms/inets-prevent_xss_in_error_pages (inets) (2011-02-21) 1 commit - inets: prevent XSS in error pages (4827d5d) * rc/rpc_pmap-typo (kernel) (2011-02-22) 1 commit - Fix typo in doc of rpc:pmap/3 (ee1ea4c) * sv/enif_is_exception (erts) (2011-02-22) 1 commit - add support for checking if an ERL_NIF_TERM is an exception (f8cc2b0) * ta/inet_port-doc (kernel) (2011-02-20) 1 commit - Fix inet:port/1 doc to match implementation/spec (b351d8f) * ta/zip-doc (stdlib) (2011-02-23) 1 commit - Fix typos in zip manpage (f911632) ------------------------------------------------------------ [Cooking] * bg/temp-hipe-fixes (compiler, hipe, kernel) (2010-03-15) 6 commits - Avoid crash by skipping compilation_SUITE:on_load/1 (8592a02) - Inline less aggressively for native-code compilation (e699ad4) - Crudely fix return type for the lists:key{search,find,member}/3 (2b72202) - seq_trace_SUITE: Don't native-compile (2712344) - Disable native code if on_load is used (e8d0ea4) - andor_SUITE: Don't native-compile (e25ef8c) This branch contains temporary workarounds to avoid failing test cases and is never intended to graduate. * bsmr/fix-makefile-in-for-xref-mod-app-escript (otp) (2010-12-10) 1 commit - Fix for Makefile.in invoking xref_mod_app.escript (10d4235) * bw/efile_exists (erts) (2010-10-07) 1 commit - prim_file:exists/{1,2} which is lightweight file existence check (7203932) * bw/tv-render-fix (tv) (2010-10-06) 1 commit - tv: Allow table viewer to display refs, ports and small binaries (5eff630) * cg/fix-prng (stdlib) (2010-10-06) 1 commit - Fix a bug in the implementation of the pseudo-random number generator (863ec4d) * cr/httpc-docs (inets, kernel) (2010-12-15) 1 commit - inets/httpc: Polish documentation (e6180a6) * dk/agent-capabilities (snmp) (2010-12-01) 1 commit - AGENT-CAPABILITIES handling added to SNMP mib compiler (17c3b19) * fd/httpc-man-page-fixes (inets) (2010-12-16) 1 commit - Grammar and typo fixes for the httpc module documentation (778a608) * fd/supervisor-delete-child-spec-on-child-termination (stdlib) (2011-01-19) 1 commit - Added supervisor:start_child/3 (bdf27ab) * fd/unix-efile-readdir-fix (erts) (2010-12-15) 1 commit - Fix call to strncat, 3rd arg should be of type size_t and not a pointer (78cfdaf) * fm/dict-man-page (stdlib) (2010-12-13) 2 commits - Fixes to the orddict module documentation (18777e8) - Fixes to the dict module documentation (c537777) * fm/httpc-upload-body-streaming (inets, stdlib) (2010-12-01) 2 commits - httpc: added support for streaming the body of an upload request (PUT or POST) (e9e4044) - Remove superfluous supervisor error report (ed790ba) * fm/posix-fallocate (erts, kernel) (2011-01-10) 2 commits - Fix build on Solaris (38a922d) - Added file:allocate/2 (9870d9b) * gc/gen-format-status-improvements (stdlib) (2010-06-12) 1 commit - Fix format_status bug for unregistered gen_event processes (95ed86f) * gl/erts-doterlang-docs (erts) (2010-12-19) 1 commit - Add back documentation on .erlang processing (6f9d175) * gl/gen_server-doc (otp) (2011-01-29) 1 commit - Update Handling Other Messages section in gen_server, gen_fsm, gen_events overviews (1fb616d) * hw/call-chmod-without-f (asn1, common_test, compiler, cosFileTransfer, crypto, debugger, docbuilder, edoc, erl_interface, erts, et, inets, inviso, kernel, megaco, mnesia, orber, parsetools, percept, public_key, reltool, runtime_tools, snmp, ssl, stdlib, syntax_tools, test_server, tools) (2010-11-15) 1 commit - Call chmod without the "-f" flag (7ed11a8) * hw/epmd-bind-to-address (erts) (2010-11-10) 1 commit - Allow user to specify the IP address epmd binds to (bcf3b3d) * hw/erl-clarify-detached-doc (erts) (2011-01-24) 1 commit - Mention that "-detached" implies "-noinput" (98e954d) * hw/fix-epmd-perror (erts) (2010-11-13) 1 commit - Fix epmd's dbg_perror() output (b363d7d) * ih/calendar-iso-8601-erl (stdlib) (2010-12-14) 1 commit - Add ISO week number calculation functions to the calendar module in stdlib (61c70eb) * ja/cocci-useless-cast (erts) (2011-02-01) 1 commit - Remove useless casts from the emulator (4163493) * jf/run_erl-disable-flow-control (erts) (2010-03-05) 1 commit - Teach run_erl RUN_ERL_DISABLE_FLOWCNTRL for disabling flow control (d0775cd) * jn/gen_stream (stdlib) (2011-01-31) 1 commit - Add gen_stream behaviour (730c7fd) * km/pool_connect-to-running-nodes (stdlib) (2010-09-02) 1 commit - Change pool module to attempt to attach to nodes that are already running (a9f4cbc) * ks/code-spec-fixes (hipe, kernel) (2011-01-30) 1 commit - Sanitize the specs of the code module (2697ce8) * ks/dialyzer-fullpath (dialyzer) (2011-01-20) 1 commit - Add a --fullpath option to Dialyzer (b4c3711) * ks/hipe-icode-range-fix (hipe) (2011-02-02) 3 commits - Cleanup specs (cc526d2) - Fix bug in the simplification of inexact comparisons (6c9a53e) - Various cleanups and cosmetic changes (b397a5b) * ks/hipe-ppc64 (erts, hipe, kernel) (2011-02-10) 8 commits - Enable HiPE by default when compiling for PPC64 (577a628) - Translate RTL to PPC code on PPC64 too (6f40a86) - Changes in ppc files for PPC64 (ea5edef) - Additions for the PPC64 backend (861cfc9) - Changes for the PPC64 backend (dbba32b) - Added loader for ppc64 (60826a5) - New files for the 64-bit backends (7c53e28) - Cleanup tags (e34f3a0) * ks/prim_file-fixes (erts) (2011-02-05) 3 commits - New version of the file (ca86ed3) - Driver names should be strings, not atoms (b8ea40c) - Cleanup and cosmetic changes (6adc116) * ks/reltool-spec-fixes (reltool) (2011-01-12) 1 commit - Fix two erroneous specs of reltool.erl (96c81d6) * ks/typer (typer) (2011-02-10) 21 commits - Strengthen some specs (e70b5f1) - Allow for --show_success_typings spelling also (bb66841) - Add '--show_success_typings' option (8376b29) - Fix crash in oveloaded contracts with overlapping domains (752b058) - Fix a type error and do some further cleanup (0ef74b6) - Type cleanups and simplifications (39bf5ad) - Cleanup the analysis record (0b1d045) - Remove typer_annotator.erl and typer.hrl (066368a) - Remove typer_info.erl file (03aa23f) - Remove typer_options.erl file (3683f8d) - Remove typer_preprocess.erl file (f4a8288) - Delete typer_map.erl file, really this time (3c1e906) . . . . . . * mk/net-kernel-epmd-return-list (kernel) (2010-12-10) 1 commit - Fix list returned by net_kernel:epmd_module (169d7e4) * ms/epmd-local-access-check (erts) (2010-11-24) 1 commit - epmd: include host address in local access check (5b68030) * ms/file-fix-hang-reading-compressed-files (erts, kernel) (2011-01-30) 1 commit - file: fix hang reading compressed files (292ecd0) * nox/xmerl-namespace-axis (xmerl) (2010-12-07) 12 commits - Implement namespace axis (27d791f) - Add `#xmlPI` support to xmerl_xpath:write_node/1 (75e67f5) - Fix processing-instruction(name?) (f05e78b) - Fix path filters (610df56) - Support more top-level primary expressions (770d6d9) - Accumulate comments in element nodes (e5b6b3a) - Add `default_attrs` option (18584c5) - Allow whole documents to be returned (aef3dea) - Track parents and namespace in `#xmlAttribute` nodes (dc9b220) - Track parents in `#xmlPI` nodes (5095331) - Set `vsn` field in `#xmlDecl` record (d712331) - Fix namespace-conformance constraints (e062270) * pg/des-cfb-functions (crypto) (2010-10-16) 1 commit - Add DES and Triple DES cipher feedback (CFB) mode functions (2c79ae7) * pg/fix-hibernate-with-hipe (erts, otp) (2010-09-27) 1 commit - Fix several bugs related to hibernate/3 and HiPE (ce00ecb) . Fix several bugs related to hibernate/3 and HiPE (babd761) * pg/hipe-remove-constants-pool (erts) (2011-01-29) 1 commit - Remove hipe constants pool (0c16b09) * pg/honor-start-type-in-rel-files (sasl) (2010-06-06) 1 commit - Honor start type in .rel files when building relup files (7599900) * sa/callback-attr (compiler, inets, kernel, otp, stdlib) (2010-06-08) 7 commits - Add callback specs into 'application' module in kernel (85ae9d7) - Add callback specs to tftp module following internet documentation (019e6d1) - Add callback specs to inets_service module following possibly deprecated comments (575c7af) - Add '-callback' attributes in stdlib's behaviours (a9da5cc) - Update primary bootstrap (d5d255b) - Automatically generate 'behaviour_info' function from '-callback' attributes (1155c86) - Add '-callback' attribute to language syntax (1a1cc4b) * sa/dialyzer-fix-guards (dialyzer) (2011-01-14) 3 commits - Fix warnings about guards containing not (271ee93) - Fix errors in the handling of 'and'/'or' guards (02e0f98) - Cosmetic changes (326ec4e) * sa/float_to_list_2 (erts, stdlib) (2011-01-16) 1 commit - Added float_to_list/2 that allows to specify formatting options (ee5a309) * sb/make-files-like-erlc (tools) (2010-05-18) 1 commit - Change make:files to behave more like erlc (5e9d051) * sg/fix-diskless-booted-relup (sasl) (2010-09-19) 1 commit - Remove traces of release_handler reading from filesystem when it has Masters list (54cb5df) * ta/binary-part-typo (stdlib) (2011-01-22) 1 commit - Fix typo in binary:part/2 example (98f51f2) * ta/driver-entry-typos (erts) (2010-12-26) 1 commit - Fix a couple typos in driver_entry(3) (68aed1c) * ta/efficiencyguide-typos (otp) (2011-01-27) 1 commit - Fix typos in efficiency guide (5d62504) * ta/epmd-typo (erts) (2011-01-09) 1 commit - Fix typo in epmd help (ce956a8) * ta/erlsrv-typos (erts) (2010-12-14) 1 commit - Fix two typos in erlsrv log messages (31b82e8) * ta/erts-doc (erts) (2011-02-01) 1 commit - erts: Fix doc typos, duplication and readability (04e81b8) * ta/httpc-typo (inets) (2011-01-09) 1 commit - Fix typo in httpc documentation (e331e0d) * ta/sendfile (erts, kernel) (2011-01-13) 1 commit - Implement file:sendfile (3c6205c) * ts/cover-with-export_all (tools) (2010-09-23) 1 commit - add user specified compiler options on form reloading (eb02beb) * tv/edoc-loop-fix (edoc) (2011-02-01) 1 commit - Fix infinite loop for malformed edoc input (6ac05e5) * uw/mnesia-majority (mnesia) (2011-01-30) 8 commits - Add documentation text about majority checking (f5b8427) - add mnesia_majority_test suite (9c2f765) - where_to_wlock optimization + change_table_majority/2 (a535b6c) - bug in mnesia_tm:needs_majority/2 (eb81e20) - optimize sticky_lock maj. check (5b304d4) - check majority for sticky locks (ae9e1fa) - Write locks now check majority when needed. (6f02d2e) - Add {majority, boolean()} per-table option. (c3241c0) * vb/shell (erts, kernel, stdlib) (2011-01-21) 6 commits - Add expandfmt_fun option for io:setopts (f139eab) - Correct JCL's help indentation (95672fa) - Handle JCL's "r" command error when no pool started (ba4b196) - Fix tab expansion in remote shell (e2077cb) - edlin_expand: fix matches formatting (838b84a) - Take into account arity len when calculating field's width (ff28c52) From michael.santos@REDACTED Sat Feb 26 00:00:06 2011 From: michael.santos@REDACTED (Michael Santos) Date: Fri, 25 Feb 2011 18:00:06 -0500 Subject: [PATCH] Fix format specifiers in erl_exit messages Message-ID: <20110225230006.GA1155@ecn.lan> Fix an error message caused by using signed integer specifiers as seen in a tweet by @metabrew: #erlang VM crashed with "no next heap size found: -2090496108, offset 0", suddenly allocated all available RAM Also correct mis-typed string formats in bif.c. --- erts/emulator/beam/bif.c | 4 ++-- erts/emulator/beam/erl_gc.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/erts/emulator/beam/bif.c b/erts/emulator/beam/bif.c index bb237e3..9e88ac9 100644 --- a/erts/emulator/beam/bif.c +++ b/erts/emulator/beam/bif.c @@ -3352,7 +3352,7 @@ BIF_RETTYPE erts_debug_display_1(BIF_ALIST_1) erts_dsprintf_buf_t *dsbufp = erts_create_tmp_dsbuf(64); pres = erts_dsprintf(dsbufp, "%.*T\n", INT_MAX, BIF_ARG_1); if (pres < 0) - erl_exit(1, "Failed to convert term to string: %d (s)\n", + erl_exit(1, "Failed to convert term to string: %d (%s)\n", -pres, erl_errno_id(-pres)); hp = HAlloc(BIF_P, 2*dsbufp->str_len); /* we need length * 2 heap words */ res = buf_to_intlist(&hp, dsbufp->str, dsbufp->str_len, NIL); @@ -3470,7 +3470,7 @@ term2list_dsprintf(Process *p, Eterm term) erts_dsprintf_buf_t *dsbufp = erts_create_tmp_dsbuf(64); pres = erts_dsprintf(dsbufp, "%T", term); if (pres < 0) - erl_exit(1, "Failed to convert term to list: %d (s)\n", + erl_exit(1, "Failed to convert term to list: %d (%s)\n", -pres, erl_errno_id(-pres)); hp = HAlloc(p, 2*dsbufp->str_len); /* we need length * 2 heap words */ res = buf_to_intlist(&hp, dsbufp->str, dsbufp->str_len, NIL); diff --git a/erts/emulator/beam/erl_gc.c b/erts/emulator/beam/erl_gc.c index 2aa932e..91eb420 100644 --- a/erts/emulator/beam/erl_gc.c +++ b/erts/emulator/beam/erl_gc.c @@ -214,7 +214,7 @@ erts_next_heap_size(Uint size, Uint offset) low = mid + 1; } } - erl_exit(1, "no next heap size found: %d, offset %d\n", size, offset); + erl_exit(1, "no next heap size found: %u, offset %u\n", size, offset); } return 0; } -- 1.7.0.4 From cristian@REDACTED Sat Feb 26 00:23:00 2011 From: cristian@REDACTED (Cristian Greco) Date: Sat, 26 Feb 2011 00:23:00 +0100 Subject: Fix using sizeof for array given as function argument Message-ID: <20110226002300.20280131@regolo> Hi, when using the sizeof() operator for an array given as function argument it returns the size of the pointer instead of the size of the array. In this case, the affected function hex(char digest[16], char buff[33]) will just print 4 or 8 byte instead of the full length of 16 bytes, on 32bit and 64bit systems respectively. git fetch git@REDACTED:cristiangreco/otp.git cg/fix-sizeof-array-arg The problem can be easily tested with the following pieces of code (this is a 64bit system): >>> cristian@REDACTED:~$ cat test.c #include #include "erl_interface.h" #include "ei.h" int main(int argc, char **argv) { erl_init(NULL, 0); if (erl_connect_init(1, "secretcookie", 0) == -1) erl_err_quit("error erl_connect_init"); if (erl_connect("test@REDACTED") < 0) erl_err_quit("error erl_connect"); fprintf(stderr, "Connected to test@REDACTED\n"); } >>> cristian@REDACTED:~$ gcc test.c -o test -lerl_interface -lei -lpthread >>> cristian@REDACTED:~$ erl -sname test -setcookie secretcookie -detached >>> cristian@REDACTED:~$ EI_TRACELEVEL=3 ./test ei_xconnect: Sat Feb 26 00:16:57 2011: -> CONNECT attempt to connect to test ei_epmd_r4_port: Sat Feb 26 00:16:57 2011: -> PORT2_REQ alive=test ip=127.0.1.1 ei_epmd_r4_port: Sat Feb 26 00:16:57 2011: <- PORT2_RESP result=0 (ok) ei_epmd_r4_port: Sat Feb 26 00:16:57 2011: port=50046 ntype=77 proto=0 dist-high=5 dist-low=5 ei_xconnect: Sat Feb 26 00:16:57 2011: -> CONNECT connected to remote recv_status: Sat Feb 26 00:16:57 2011: <- RECV_STATUS (ok) recv_challenge: Sat Feb 26 00:16:57 2011: <- RECV_CHALLENGE (ok) node = test@REDACTED, version = 5, flags = 32764, challenge = 1549668388 send_challenge_reply: Sat Feb 26 00:16:57 2011: -> SEND_CHALLENGE_REPLY (ok) challenge = -1021121626, digest = 1a80a4b784b18a0e recv_challenge_ack: Sat Feb 26 00:16:57 2011: <- RECV_CHALLENGE_ACK (ok) digest = 165837d811901950 ei_xconnect: Sat Feb 26 00:16:57 2011: -> CONNECT (ok) remote = test Connected to test@REDACTED Please compare the output provided by the JInterface (which has pretty similar code, but not the same bug). >>> cristian@REDACTED:~$ cat test.java import java.io.IOException; import java.net.UnknownHostException; import com.ericsson.otp.erlang.*; public class test { public static void main(String[] argv) throws UnknownHostException, IOException, OtpAuthException { OtpSelf self = new OtpSelf("client", "secretcookie"); OtpPeer other = new OtpPeer("test@REDACTED"); OtpConnection connection = self.connect(other); } } >>> cristian@REDACTED:~$ javac -classpath ".:/usr/lib/erlang/lib/jinterface-1.5.3/priv/OtpErlang.jar" test.java >>> cristian@REDACTED:~$ java -classpath ".:/usr/lib/erlang/lib/jinterface-1.5.3/priv/OtpErlang.jar" -DOtpConnection.trace=3 test -> MD5 CONNECT TO regolo:50046 -> HANDSHAKE sendName flags=3476 dist=5 local=client@REDACTED <- HANDSHAKE recvStatus (ok) local=client@REDACTED <- HANDSHAKE recvChallenge from=test@REDACTED challenge=199376417 local=client@REDACTED -> HANDSHAKE sendChallengeReply challenge=1255235538 digest=b5fde95e50a7cbbeeadf8b5d75cb8530 local=client@REDACTED <- HANDSHAKE recvChallengeAck from=test@REDACTED digest=a1010198b6e75ae75d9a21a5cefcca2d local=client@REDACTED Thanks, -- Cristian Greco GPG key ID: 0xCF4D32E4 -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: not available URL: From tuncer.ayaz@REDACTED Sat Feb 26 12:16:49 2011 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Sat, 26 Feb 2011 12:16:49 +0100 Subject: Fix resource leakage in efile_openfile Message-ID: git fetch git://github.com/tuncer/otp.git efile-fd-leak From michael.santos@REDACTED Sat Feb 26 14:51:00 2011 From: michael.santos@REDACTED (Michael Santos) Date: Sat, 26 Feb 2011 08:51:00 -0500 Subject: [erlang-patches] Fix resource leakage in efile_openfile In-Reply-To: References: Message-ID: <20110226135100.GA1403@ecn.lan> On Sat, Feb 26, 2011 at 12:16:49PM +0100, Tuncer Ayaz wrote: > git fetch git://github.com/tuncer/otp.git efile-fd-leak Hey Tuncer! diff --git a/erts/emulator/drivers/unix/unix_efile.c b/erts/emulator/drivers/unix/unix_efile.c index 4b39346..93568e3 100644 --- a/erts/emulator/drivers/unix/unix_efile.c +++ b/erts/emulator/drivers/unix/unix_efile.c @@ -741,14 +741,17 @@ efile_openfile(Efile_error* errInfo, /* Where to return error codes. */ * (see efile_mkdir) */ if ((fd < 0) && (strchr(name, '/') != NULL) && (errno == 0xd)) { + close(fd); /* Return the correct error code enoent */ errno = S_nfsLib_NFSERR_NOENT; return check_error(-1, errInfo); } #endif - if (!check_error(fd, errInfo)) + if (!check_error(fd, errInfo)) { + close(fd); return 0; + } *pfd = fd; if (pSize) { check_error() returns false if the fd is bad (-1), so the fd shouldn't need to be closed since no resources have been allocated. Maybe the file leak is happening somewhere else? From tuncer.ayaz@REDACTED Sat Feb 26 15:03:00 2011 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Sat, 26 Feb 2011 15:03:00 +0100 Subject: [erlang-patches] Fix resource leakage in efile_openfile In-Reply-To: <20110226135100.GA1403@ecn.lan> References: <20110226135100.GA1403@ecn.lan> Message-ID: On Sat, Feb 26, 2011 at 2:51 PM, Michael Santos wrote: > check_error() returns false if the fd is bad (-1), so the fd shouldn't > need to be closed since no resources have been allocated. Maybe the file > leak is happening somewhere else? Thanks Michael. You are right. There is no leak. From burbas@REDACTED Mon Feb 28 15:55:13 2011 From: burbas@REDACTED (Niclas Axelsson) Date: Mon, 28 Feb 2011 15:55:13 +0100 Subject: [erlang-patches] [PATCH] Fix format specifiers in erl_exit messages In-Reply-To: <20110225230006.GA1155@ecn.lan> References: <20110225230006.GA1155@ecn.lan> Message-ID: <4D6BB751.5050803@erlang.org> On 02/26/2011 12:00 AM, Michael Santos wrote: > Fix an error message caused by using signed integer specifiers as seen > in a tweet by @metabrew: > > #erlang VM crashed with "no next heap size found: -2090496108, > offset 0", suddenly allocated all available RAM > > Also correct mis-typed string formats in bif.c. > --- > erts/emulator/beam/bif.c | 4 ++-- > erts/emulator/beam/erl_gc.c | 2 +- > 2 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/erts/emulator/beam/bif.c b/erts/emulator/beam/bif.c > index bb237e3..9e88ac9 100644 > --- a/erts/emulator/beam/bif.c > +++ b/erts/emulator/beam/bif.c > @@ -3352,7 +3352,7 @@ BIF_RETTYPE erts_debug_display_1(BIF_ALIST_1) > erts_dsprintf_buf_t *dsbufp = erts_create_tmp_dsbuf(64); > pres = erts_dsprintf(dsbufp, "%.*T\n", INT_MAX, BIF_ARG_1); > if (pres< 0) > - erl_exit(1, "Failed to convert term to string: %d (s)\n", > + erl_exit(1, "Failed to convert term to string: %d (%s)\n", > -pres, erl_errno_id(-pres)); > hp = HAlloc(BIF_P, 2*dsbufp->str_len); /* we need length * 2 heap words */ > res = buf_to_intlist(&hp, dsbufp->str, dsbufp->str_len, NIL); > @@ -3470,7 +3470,7 @@ term2list_dsprintf(Process *p, Eterm term) > erts_dsprintf_buf_t *dsbufp = erts_create_tmp_dsbuf(64); > pres = erts_dsprintf(dsbufp, "%T", term); > if (pres< 0) > - erl_exit(1, "Failed to convert term to list: %d (s)\n", > + erl_exit(1, "Failed to convert term to list: %d (%s)\n", > -pres, erl_errno_id(-pres)); > hp = HAlloc(p, 2*dsbufp->str_len); /* we need length * 2 heap words */ > res = buf_to_intlist(&hp, dsbufp->str, dsbufp->str_len, NIL); > diff --git a/erts/emulator/beam/erl_gc.c b/erts/emulator/beam/erl_gc.c > index 2aa932e..91eb420 100644 > --- a/erts/emulator/beam/erl_gc.c > +++ b/erts/emulator/beam/erl_gc.c > @@ -214,7 +214,7 @@ erts_next_heap_size(Uint size, Uint offset) > low = mid + 1; > } > } > - erl_exit(1, "no next heap size found: %d, offset %d\n", size, offset); > + erl_exit(1, "no next heap size found: %u, offset %u\n", size, offset); > } > return 0; > } > Thanks Michael, Your branch have been merged to 'pu'. Regards, Niclas Axelsson, Erlang/OTP From burbas@REDACTED Mon Feb 28 15:58:01 2011 From: burbas@REDACTED (Niclas Axelsson) Date: Mon, 28 Feb 2011 15:58:01 +0100 Subject: [erlang-patches] Fix using sizeof for array given as function argument In-Reply-To: <20110226002300.20280131@regolo> References: <20110226002300.20280131@regolo> Message-ID: <4D6BB7F9.1080203@erlang.org> On 02/26/2011 12:23 AM, Cristian Greco wrote: > Hi, > > when using the sizeof() operator for an array given as function argument > it returns the size of the pointer instead of the size of the array. > In this case, the affected function hex(char digest[16], char buff[33]) > will just print 4 or 8 byte instead of the full length of 16 bytes, on > 32bit and 64bit systems respectively. > > git fetchgit@REDACTED:cristiangreco/otp.git cg/fix-sizeof-array-arg > Thanks Cristian, Your patch have been merged into 'pu'. Regards, Niclas Axelsson, Erlang/OTP