From rory@REDACTED Thu Apr 1 00:02:49 2010 From: rory@REDACTED (Rory Byrne) Date: Thu, 1 Apr 2010 00:02:49 +0200 Subject: [erlang-patches] Fix ssl:transport_accept/2 to handle socket close In-Reply-To: <20100329115145.GA19867@almeida.jinsky.com> References: <20100328223322.GA21674@almeida.jinsky.com> <6672d0161003282311o57039da4g77b3dab7073e1f25@mail.gmail.com> <20100329115145.GA19867@almeida.jinsky.com> Message-ID: <20100331220249.GA3484@almeida.jinsky.com> > On Mon, Mar 29, 2010 at 08:11:51AM +0200, Bj?rn Gustavsson wrote: > > > > I'll wait a few days with including this change because there is > > currently a build problem in the ssl application, and because I've > > had to revert a commit there is now a merge conflict with the > > revert commit. Since the revert commit in the 'pu' branch is > > a temporary thing, I will wait until it is gone before I'll resolve > > any merge conflicts. I've rebased this branch against the updated (fixed) dev branch: git fetch git://github.com/jinsky/otp.git ssl_transport_accept_fix Cheers, Rory From bgustavsson@REDACTED Thu Apr 1 07:35:25 2010 From: bgustavsson@REDACTED (=?UTF-8?Q?Bj=C3=B6rn_Gustavsson?=) Date: Thu, 1 Apr 2010 07:35:25 +0200 Subject: [erlang-patches] Fix ssl:transport_accept/2 to handle socket close In-Reply-To: <20100331220249.GA3484@almeida.jinsky.com> References: <20100328223322.GA21674@almeida.jinsky.com> <6672d0161003282311o57039da4g77b3dab7073e1f25@mail.gmail.com> <20100329115145.GA19867@almeida.jinsky.com> <20100331220249.GA3484@almeida.jinsky.com> Message-ID: On Thu, Apr 1, 2010 at 12:02 AM, Rory Byrne wrote: > I've rebased this branch against the updated (fixed) dev branch: > > ?git fetch git://github.com/jinsky/otp.git ssl_transport_accept_fix > Thanks! Will include in 'pu'. -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From bgustavsson@REDACTED Thu Apr 1 07:54:29 2010 From: bgustavsson@REDACTED (=?UTF-8?Q?Bj=C3=B6rn_Gustavsson?=) Date: Thu, 1 Apr 2010 07:54:29 +0200 Subject: [erlang-patches] Fix mishandling of valid ssl options In-Reply-To: <20100331214945.GB12190@almeida.jinsky.com> References: <20100331214945.GB12190@almeida.jinsky.com> Message-ID: On Wed, Mar 31, 2010 at 11:49 PM, Rory Byrne wrote: > ?git fetch git://github.com/jinsky/otp.git ssl_opts_fix > > Using the new ssl implementation, some valid options are causing badarg > exceptions. The most important of these is 'fail_if_no_peer_cert', > but it also effects two undocumented options, 'verify_client_once' and > 'cb_info'. Thanks! The standard comment style is to have one percent character ("%") only for comments at the end of a line. Comments on their own line inside a function should have two percent characters ("%%"). I have fixed that (in ssl_basic_SUITE) and will include in the fixed version in 'pu'. -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From bgustavsson@REDACTED Thu Apr 1 09:13:27 2010 From: bgustavsson@REDACTED (=?ISO-8859-1?Q?Bj=F6rn_Gustavsson?=) Date: Thu, 01 Apr 2010 09:13:27 +0200 Subject: What's cooking in erlang/otp (2010-04-01) Message-ID: <4BB44797.2030504@gmail.com> Good Friday (April 2) and Easter Monday (April 5) are not work days in Sweden, so don't be alarmed if we don't reply to your emails before April 6. ------------------------------------------------------------ [Graduated] * au/crypto (crypto) (2010-03-01) 2 commits + Add missing docs for crypto:md4/1 (b869aef) + Add des_ecb_encrypt/2 and des_ecb_decrypt/2 to crypto module (544ed56) * bd/mnesia-activity-subscription (mnesia) (2010-02-12) 1 commit + Add mnesia activity subscription message (999f1b9) * bg/compiler-inliner (compiler, otp) (2010-03-19) 8 commits + pmod_SUITE: Again test inlining parameterized modules (f958b8b) + compiler tests: Cope with missing args in function_clause for native code (7832064) + compiler tests: Compile a few more modules with 'inline' (f1e60ef) + Consistently rewrite an inlined function_clause exception to case_clause (0320836) + compiler tests: Test the 'inline' option better (e74235d) + compiler: Suppress bs_context_to_binary/1 for a literal operand (57cb16f) + compiler: Fix binary matching bug in the inliner (e2074da) + sys_core_inline: Don't generated multiple compiler_generated annos (a2c88ff) * bg/compiler-remove-r11-support (compiler, erts, otp, test_server) (2010-03-16) 7 commits + compiler: Don't support the no_binaries option (d179c15) + erts: Don't support the put_string/3 instruction (bba6073) + compiler: Don't support the no_constant_pool option (2dc5a17) + compiler: Don't support the r11 option (eeff53b) + test_server: Don't support communication with R11 nodes (2090739) + binary_SUITE: Don't test bit-level binary roundtrips with R11 nodes (4767bed) + erts: Test compatibility of funs with R12 instead of R11 (e188505) * dgud/wx-new-doxygen (wx) (2010-03-10) 4 commits + Added a non existing macro on windows. (3a4edf4) + Commit of the generated code with previous commit. (dec7bba) + Fixed code generation from newer doxygen versions. (556b7f0) + Whitespace fixes (e68047c) * hawk/wx-add-app-file (wx) (2010-03-15) 1 commit + Add app and appup files to the wx application (5e454b3) * mh/doc-inet-getopts (kernel) (2010-03-26) 1 commit + Doc fix: inet:getopts/2 returns {ok, OptionValues}, not just OptionValues (3d18193) * mh/doc-loose-lose (erts, mnesia, stdlib) (2010-03-26) 1 commit + Fix spelling: "loose" is not a verb (4f0be70) * se/decode_packet (erts) (2010-03-24) 1 commit + Fix erlang:decode_packet(httph_bin,..) to not return faulty header strings (80ce0ac) ------------------------------------------------------------ [New topics] * jb/inet6-dist (erts, kernel) (2010-03-23) 3 commits - Support IPv6 addresses in long host names (a1fb1dd) - Fix implementation of IPv6 TCP distribution protocol (3c1f843) - Fix compilation of epmd with IPv6 enabled (b39b8b7) * rb/ssl-opts-fix (ssl) (2010-03-31) 1 commit - Fix mishandling of valid ssl options (f035cfd) * rb/ssl-transport-accept-fix (ssl) (2010-03-28) 1 commit - Fix ssl:transport_accept/2 to return properly when socket is closed (6fbf32c) * sv/sasl-fix-get_status (sasl) (2010-03-26) 1 commit - fix sys:get_status backward compatibility for sasl release_handler_1 (3cc2ceb) * ta/asn1-verbose (asn1) (2010-03-28) 2 commits - Add test for verbose option to asn1_SUITE (b2696eb) - Teach asn1ct verbose option (c7454e6) * ta/doc-fakefop (erts, otp) (2010-03-29) 1 commit - Support building minimal one-page PDF file without FOP (0962c3d) * ta/nested-records (compiler, stdlib) (2010-03-25) 1 commit - Support nested record field access without parentheses (34053b5) ------------------------------------------------------------ [Stalled] * bg/safer-local_to_univ (erts) (2010-02-11) 1 commit - erl_time_sup.c: test for error return from mktime() (0f62f0b) We will not include this branch in R13B04 for two reasons: o We are not 100% sure that this change is harmless on all platforms in all timezones. o We have an idea how the underlying problem can be fixed in the calendar module (only) and I plan to try it out after the release. We will keep this branch in pu as a reminder. Action expected from: Bj??rn Gustavsson * db/tv_nthtail_fix (tv) (2009-12-01) 1 commit - Fix for tv which restarts while trying to open a table (abe0759) Since our long-term goal is to migrate from gs towards wx, maintaining the old gs applications has a low priority for the Erlang/OTP team. Therefore, we will accept patches that seem sound, but we are unlikely to spend much of our own time fixing bugs. The author of this topic branch has found the real reason for the problem, but uncovered additional issues. Action expected from: The topic author - to decide whether to include the topic branch (which is a workaround, but does eliminate the crash) or to wait for a better fix from himself or someone else with an interest to advance the topic. * jp/dependencies_makefile (compiler, erts) (2010-02-14) 3 commits - squash! eliminate dialyzer warning (434e2ca) - squash! fix snprintf for Windows (bf2708d) - Add dependencies Makefile generation to erlc(1) and compile(3) (7cbc437) Approved in principle by the OTP Technical Board; now awaits a closer review of the implementation. Action expected from: Bj??rn Gustavsson (the reviewer) * kr/gs-browser (gs) (2010-02-10) 1 commit - Change lib/gs/src/tool_utils.erl to select multiple browsers other than Netscape (802d159) This topic branch introduces a new call to the deprecated regexp module. Action expected from: Topic author or anyone else with an interest to advance the topic ------------------------------------------------------------ [Cooking] * am/kernel-stops (kernel) (2010-02-21) 1 commit - Change restart behavior of network apps from permanent to transient (397343b) * am/net_kernel_catchall (kernel) (2010-02-20) 1 commit - Add catch all handle_call to net_kernel (77ee109) * bg/compiler (compiler, stdlib) (2010-03-12) 5 commits - beam_peep: Remove optimization already done by beam_dead (f4e3b6e) - beam_dead: Combine is_eq_exact instructions into select_val instructions (c964f06) - Evaluate is_record/3 at compile-time using type information (e54f3a3) - Evaluate element/2 at compile-time using type information (01deb2c) - erl_expand_records: Replace is_record() with matching (e95dcd6) * bg/temp-hipe-fixes (compiler, hipe, kernel) (2010-03-15) 6 commits - Avoid crash by skipping compilation_SUITE:on_load/1 (234e13e) - Inline less aggressively for native-code compilation (9fcb48b) - Crudely fix return type for the lists:key{search,find,member}/3 (ef71597) - seq_trace_SUITE: Don't native-compile (2a81b1a) - Disable native code if on_load is used (3befa76) - andor_SUITE: Don't native-compile (97aa2da) This branch contains temporary workarounds to avoid failing test cases and is never intended to graduate. * dp/shell-line-editing (kernel, stdlib) (2010-03-05) 1 commit - Readline-style line edit history (91e912b) * er/ei-decode_msg (erl_interface) (2010-03-11) 1 commit - Add function to decode distribution header (864091a) * gl/jinterface-pom (jinterface, otp) (2010-02-15) 2 commits - Exclude jinterface build artifact from git (5acf5fa) - Add pom.xml for jinterface build (aa68190) * jf/run_erl-disable-flow-control (erts) (2010-03-05) 1 commit - Teach run_erl RUN_ERL_DISABLE_FLOWCNTRL for disabling flow control (d0775cd) * jl/windows-file-share-delete (erts) (2010-02-22) 1 commit - Windows: Open files with FILE_SHARE_DELETE to get closer to UNIX semantics (e5e5597) * jn/ic-docs-without-java (ic) (2010-03-07) 1 commit - Permit building and installing documentation without Java (2016a08) * ks/cleanups (debugger, docbuilder, gs, kernel, stdlib) (2010-03-21) 8 commits - stdlib: Add types and specs (6a60c05) - escript: Add more types to records (17655d0) - kernel: Clean up as suggested by tidier (23063a5) - debugger: Clean up as suggested by tidier (93e92a1) - docbuilder: Clean up as suggested by tidier (59d0c74) - gs: Clean up as suggested by tidier (02c9fa1) - stdlib: Use fun object instead of {M,F} tuple (12bc861) - ets: Cleanup as suggested by tidier (9a8bd8d) Was formerly called ks/cleanups-after-r13b04. * ks/export_type (compiler, dialyzer, hipe, kernel, stdlib, syntax_tools) (2010-03-22) 12 commits - Minor fix in a print message (358383d) - Add handling of unknown types (86431df) - Add declaration for exported types (3c33970) - Add types and specs; performed some cleanups also (b9246e3) - erl_scan: Add declarations for exported types (a5aecf9) - stdlib: Add declarations for exported types (c99bb08) - hipe: Add declarations for exported types (ccf4f09) - compiler: Add declarations for exported types (dbb1e73) - syntax_tools: Add declarations for exported types (bfbf202) - kernel: Add declaration for exported types (e56ebd6) - Support -export_type() in dialyzer and erl_types (704ae6f) - Add infrastructure for the -export_type() attribute (8a3faa7) * mh/ssh_channel-init-no-catch (ssh) (2010-01-25) 1 commit - Remove pointless catch from ssh_channel:init/1. (bb7eaa5) * ms/epmd-error-checking (erts) (2010-03-29) 2 commits - fixup! Exit if an error occurs with the listening socket (c103599) - Exit if an error occurs with the listening socket (a4882b4) * ms/pcre-compile-workspace-overrun (erts, stdlib) (2010-03-19) 2 commits - re_SUITE: Add pcre_compile_workspace_overflow/1 (3efa1b8) - Fix check for compile workspace overflow (272e106) * ra/include-public_key-in-ssh (ssh) (2010-01-20) 1 commit - Added public_key among ssh applications. (3a0c2c5) * rb/ssl-fix-http-packet-decoding (ssl) (2010-03-16) 1 commit - Fix ssl to decode http packets in the same way as gen_tcp (dbe6f63) * rd/erlang-eunit (tools) (2010-03-22) 1 commit - erlang-eunit.el: Require cl, as it is used (43ae537) * sv/format_status_error_info (stdlib) (2010-02-28) 2 commits - Add support for the format_status callback to gen_event (fd9abcb) - Extend format_status for gen_server/gen_fsm termination error logging (3d06952) ------------------------------------------------------------ [Dropped] * jv/update-rpccall-to-use-try (kernel) (2010-02-24) 1 commit . fix rpc handling of uncaught throws (3f21ed7) From tuncer.ayaz@REDACTED Sat Apr 3 14:26:04 2010 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Sat, 3 Apr 2010 14:26:04 +0200 Subject: Build erl_nif manpage Message-ID: git fetch git://github.com/tuncer/otp.git enifmissingman From rory@REDACTED Mon Apr 5 19:18:50 2010 From: rory@REDACTED (Rory Byrne) Date: Mon, 5 Apr 2010 19:18:50 +0200 Subject: Fix verification of ssl client when fail_if_no_peer_cert Message-ID: <20100405171850.GA25766@almeida.jinsky.com> Hello, This bug only comes to light after a previous bug involving the 'fail_if_no_peer_cert' ssl option is fixed. I've included this patch in the same branch as the other fix: git fetch git://github.com/jinsky/otp.git ssl_opts_fix The commit message is: Fix verification of ssl client when fail_if_no_peer_cert The SSL handshake fails when an ssl server is configured with the 'fail_if_no_peer_cert' option and a valid client sends its certificate as instructed. On the server-side ssl:ssl_accept/2 will return {error,esslerrssl}, and it will send an "Unexpected Message" SSL Alert (type 10) to the client. Thanks, Rory From mortior@REDACTED Mon Apr 5 22:59:14 2010 From: mortior@REDACTED (Johan Bengtsson) Date: Mon, 5 Apr 2010 22:59:14 +0200 Subject: [PATCH] Modify pp_arm to decode imm8m constants Message-ID: <1270501154-2851-1-git-send-email-mortior@yahoo.se> Improve readability by decoding imm8m constants before printing them. Signed-off-by: Johan Bengtsson --- lib/hipe/arm/hipe_arm_pp.erl | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/lib/hipe/arm/hipe_arm_pp.erl b/lib/hipe/arm/hipe_arm_pp.erl index 7ce8421..a98f8fc 100644 --- a/lib/hipe/arm/hipe_arm_pp.erl +++ b/lib/hipe/arm/hipe_arm_pp.erl @@ -246,6 +246,12 @@ stop_suffix(StOp) -> 'strb' -> "b" end. +imm8m_decode(Value, 0) -> + Value; +imm8m_decode(Value, Rot) -> + (Value bsr (2 * Rot)) bor (Value bsl (2 * (16 - Rot))). + + pp_temp(Dev, Temp=#arm_temp{reg=Reg, type=Type}) -> case hipe_arm:temp_is_precoloured(Temp) of true -> @@ -292,7 +298,7 @@ pp_am1(Dev, Am1) -> io:format(Dev, "#~w", [Imm5]) end; {Imm8,Imm4} -> - io:format(Dev, "#~w, 2*~w", [Imm8,Imm4]) + io:format(Dev, "#~s", [to_hex(imm8m_decode(Imm8, Imm4))]) end. pp_am2(Dev, #am2{src=Src,sign=Sign,offset=Am2Offset}) -> -- 1.6.3.3 From bgustavsson@REDACTED Tue Apr 6 08:03:33 2010 From: bgustavsson@REDACTED (=?UTF-8?Q?Bj=C3=B6rn_Gustavsson?=) Date: Tue, 6 Apr 2010 08:03:33 +0200 Subject: [erlang-patches] [PATCH] Modify pp_arm to decode imm8m constants In-Reply-To: <1270501154-2851-1-git-send-email-mortior@yahoo.se> References: <1270501154-2851-1-git-send-email-mortior@yahoo.se> Message-ID: On Mon, Apr 5, 2010 at 10:59 PM, Johan Bengtsson wrote: > Improve readability by decoding imm8m constants before printing them. Thanks! Included in 'pu'. -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From bgustavsson@REDACTED Tue Apr 6 08:04:36 2010 From: bgustavsson@REDACTED (=?UTF-8?Q?Bj=C3=B6rn_Gustavsson?=) Date: Tue, 6 Apr 2010 08:04:36 +0200 Subject: [erlang-patches] Fix verification of ssl client when fail_if_no_peer_cert In-Reply-To: <20100405171850.GA25766@almeida.jinsky.com> References: <20100405171850.GA25766@almeida.jinsky.com> Message-ID: On Mon, Apr 5, 2010 at 7:18 PM, Rory Byrne wrote: > This bug only comes to light after a previous bug involving the > 'fail_if_no_peer_cert' ssl option is fixed. I've included this patch > in the same branch as the other fix: > > ? git fetch git://github.com/jinsky/otp.git ssl_opts_fix Thanks! Included in 'pu'. -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From bgustavsson@REDACTED Tue Apr 6 08:07:14 2010 From: bgustavsson@REDACTED (=?UTF-8?Q?Bj=C3=B6rn_Gustavsson?=) Date: Tue, 6 Apr 2010 08:07:14 +0200 Subject: [erlang-patches] Build erl_nif manpage In-Reply-To: References: Message-ID: On Sat, Apr 3, 2010 at 2:26 PM, Tuncer Ayaz wrote: > git fetch git://github.com/tuncer/otp.git enifmissingman Thanks! I created one branch called ta/nif-documentation for your NIF documentation commits and merged it to 'pu'. -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From mikpe@REDACTED Tue Apr 6 08:14:31 2010 From: mikpe@REDACTED (Mikael Pettersson) Date: Tue, 6 Apr 2010 08:14:31 +0200 Subject: [erlang-patches] [PATCH] Modify pp_arm to decode imm8m constants In-Reply-To: <1270501154-2851-1-git-send-email-mortior@yahoo.se> References: <1270501154-2851-1-git-send-email-mortior@yahoo.se> Message-ID: <19386.53575.716086.254257@pilspetsen.it.uu.se> Johan Bengtsson writes: > Improve readability by decoding imm8m constants before printing them. > > Signed-off-by: Johan Bengtsson > --- > lib/hipe/arm/hipe_arm_pp.erl | 8 +++++++- > 1 files changed, 7 insertions(+), 1 deletions(-) > > diff --git a/lib/hipe/arm/hipe_arm_pp.erl b/lib/hipe/arm/hipe_arm_pp.erl > index 7ce8421..a98f8fc 100644 > --- a/lib/hipe/arm/hipe_arm_pp.erl > +++ b/lib/hipe/arm/hipe_arm_pp.erl > @@ -246,6 +246,12 @@ stop_suffix(StOp) -> > 'strb' -> "b" > end. > > +imm8m_decode(Value, 0) -> > + Value; > +imm8m_decode(Value, Rot) -> > + (Value bsr (2 * Rot)) bor (Value bsl (2 * (16 - Rot))). > + > + One newline too many here. > pp_temp(Dev, Temp=#arm_temp{reg=Reg, type=Type}) -> > case hipe_arm:temp_is_precoloured(Temp) of > true -> > @@ -292,7 +298,7 @@ pp_am1(Dev, Am1) -> > io:format(Dev, "#~w", [Imm5]) > end; > {Imm8,Imm4} -> > - io:format(Dev, "#~w, 2*~w", [Imm8,Imm4]) > + io:format(Dev, "#~s", [to_hex(imm8m_decode(Imm8, Imm4))]) > end. > > pp_am2(Dev, #am2{src=Src,sign=Sign,offset=Am2Offset}) -> Please show a before/after diff for the output of pp_arm on some small function, preferably one using an immediate with a non-zero rotate. From egil@REDACTED Tue Apr 6 13:56:31 2010 From: egil@REDACTED (=?UTF-8?B?QmrDtnJuLUVnaWwgRGFobGJlcmc=?=) Date: Tue, 06 Apr 2010 13:56:31 +0200 Subject: [erlang-patches] Function to decode distribution header In-Reply-To: References: <6672d0161003100831v5554fd63x8bfd5834b6563e58@mail.gmail.com> Message-ID: <4BBB216F.7010002@erix.ericsson.se> Hi Erik, In order to be included in erl_interface this feature needs test cases and documentation. Regards, Bj?rn-Egil Erlang/OTP Erik Rigtorp wrote: > Please pull updated commit 864091a37030eac122b4029377c05985338586fb > that handles trace tokens properly. > > 2010/3/10 Bj?rn Gustavsson : >> On Wed, Mar 10, 2010 at 4:57 PM, Erik Rigtorp wrote: >>> git fetch git://github.com/rigtorp/otp.git ei_decode_msg >> Thanks! Included in 'pu'. >> >> -- >> Bj?rn Gustavsson, Erlang/OTP, Ericsson AB >> >> ________________________________________________________________ >> erlang-patches (at) erlang.org mailing list. >> See http://www.erlang.org/faq.html >> To unsubscribe; mailto:erlang-patches-unsubscribe@REDACTED >> >> > > ________________________________________________________________ > erlang-patches (at) erlang.org mailing list. > See http://www.erlang.org/faq.html > To unsubscribe; mailto:erlang-patches-unsubscribe@REDACTED > > From johanb@REDACTED Tue Apr 6 21:41:17 2010 From: johanb@REDACTED (Johan Bengtsson) Date: Tue, 06 Apr 2010 21:41:17 +0200 Subject: [erlang-patches] [PATCH] Modify pp_arm to decode imm8m constants In-Reply-To: <19386.53575.716086.254257@pilspetsen.it.uu.se> References: <1270501154-2851-1-git-send-email-mortior@yahoo.se> <19386.53575.716086.254257@pilspetsen.it.uu.se> Message-ID: <1270582877.2365.5.camel@dumbo> On Tue, 2010-04-06 at 08:14 +0200, Mikael Pettersson wrote: > Johan Bengtsson writes: > > Improve readability by decoding imm8m constants before printing them. > > > > Signed-off-by: Johan Bengtsson > > --- > > lib/hipe/arm/hipe_arm_pp.erl | 8 +++++++- > > 1 files changed, 7 insertions(+), 1 deletions(-) > > > > diff --git a/lib/hipe/arm/hipe_arm_pp.erl b/lib/hipe/arm/hipe_arm_pp.erl > > index 7ce8421..a98f8fc 100644 > > --- a/lib/hipe/arm/hipe_arm_pp.erl > > +++ b/lib/hipe/arm/hipe_arm_pp.erl > > @@ -246,6 +246,12 @@ stop_suffix(StOp) -> > > 'strb' -> "b" > > end. > > > > +imm8m_decode(Value, 0) -> > > + Value; > > +imm8m_decode(Value, Rot) -> > > + (Value bsr (2 * Rot)) bor (Value bsl (2 * (16 - Rot))). > > + > > + > > One newline too many here. > > > pp_temp(Dev, Temp=#arm_temp{reg=Reg, type=Type}) -> > > case hipe_arm:temp_is_precoloured(Temp) of > > true -> > > @@ -292,7 +298,7 @@ pp_am1(Dev, Am1) -> > > io:format(Dev, "#~w", [Imm5]) > > end; > > {Imm8,Imm4} -> > > - io:format(Dev, "#~w, 2*~w", [Imm8,Imm4]) > > + io:format(Dev, "#~s", [to_hex(imm8m_decode(Imm8, Imm4))]) > > end. > > > > pp_am2(Dev, #am2{src=Src,sign=Sign,offset=Am2Offset}) -> > > Please show a before/after diff for the output of pp_arm on some small > function, preferably one using an immediate with a non-zero rotate. For the attached file the difference is --- test2-before.txt 2010-04-06 08:27:06.000000000 +0200 +++ test2-after.txt 2010-04-06 08:27:35.000000000 +0200 @@ -30,28 +30,28 @@ .global test2_knas_1 test2_knas_1: .test2_knas_1_12: - sub r10, r10, #4, 2*0 + sub r10, r10, #0x4 str r14, [r10,#0] .test2_knas_1_11: mov r1, r1 .test2_knas_1_6: - and r0, r1, #15, 2*0 - cmp r0, #15, 2*0 + and r0, r1, #0xf + cmp r0, #0xf bne .test2_knas_1_3 .test2_knas_1_5: mov r4, r1, asr #4 - mov r0, #255, 2*12 + mov r0, #0xff00 smull r3, r2, r4, r0 mov r0, r3, asr #31 cmp r0, r2 bne .test2_knas_1_3 .test2_knas_1_4: - add r0, r3, #15, 2*0 + add r0, r3, #0xf mov r0, r0 .test2_knas_1_2: mov r0, r0 ldr r14, [r10,#0] - add r10, r10, #4, 2*0 + add r10, r10, #0x4 mov r15, r14 .test2_knas_1_3: mov r1, r1 -------------- next part -------------- A non-text attachment was scrubbed... Name: test2.erl Type: text/x-erlang Size: 65 bytes Desc: not available URL: From mikpe@REDACTED Tue Apr 6 22:44:03 2010 From: mikpe@REDACTED (Mikael Pettersson) Date: Tue, 6 Apr 2010 22:44:03 +0200 Subject: [erlang-patches] [PATCH] Modify pp_arm to decode imm8m constants In-Reply-To: <1270582877.2365.5.camel@dumbo> References: <1270501154-2851-1-git-send-email-mortior@yahoo.se> <19386.53575.716086.254257@pilspetsen.it.uu.se> <1270582877.2365.5.camel@dumbo> Message-ID: <19387.40211.201491.17227@pilspetsen.it.uu.se> Johan Bengtsson writes: > On Tue, 2010-04-06 at 08:14 +0200, Mikael Pettersson wrote: > > Johan Bengtsson writes: > > > Improve readability by decoding imm8m constants before printing them. > > > > > > Signed-off-by: Johan Bengtsson > > > --- > > > lib/hipe/arm/hipe_arm_pp.erl | 8 +++++++- > > > 1 files changed, 7 insertions(+), 1 deletions(-) > > > > > > diff --git a/lib/hipe/arm/hipe_arm_pp.erl b/lib/hipe/arm/hipe_arm_pp.erl > > > index 7ce8421..a98f8fc 100644 > > > --- a/lib/hipe/arm/hipe_arm_pp.erl > > > +++ b/lib/hipe/arm/hipe_arm_pp.erl > > > @@ -246,6 +246,12 @@ stop_suffix(StOp) -> > > > 'strb' -> "b" > > > end. > > > > > > +imm8m_decode(Value, 0) -> > > > + Value; > > > +imm8m_decode(Value, Rot) -> > > > + (Value bsr (2 * Rot)) bor (Value bsl (2 * (16 - Rot))). > > > + > > > + > > > > One newline too many here. > > > > > pp_temp(Dev, Temp=#arm_temp{reg=Reg, type=Type}) -> > > > case hipe_arm:temp_is_precoloured(Temp) of > > > true -> > > > @@ -292,7 +298,7 @@ pp_am1(Dev, Am1) -> > > > io:format(Dev, "#~w", [Imm5]) > > > end; > > > {Imm8,Imm4} -> > > > - io:format(Dev, "#~w, 2*~w", [Imm8,Imm4]) > > > + io:format(Dev, "#~s", [to_hex(imm8m_decode(Imm8, Imm4))]) > > > end. > > > > > > pp_am2(Dev, #am2{src=Src,sign=Sign,offset=Am2Offset}) -> > > > > Please show a before/after diff for the output of pp_arm on some small > > function, preferably one using an immediate with a non-zero rotate. > > For the attached file the difference is > > --- test2-before.txt 2010-04-06 08:27:06.000000000 +0200 > +++ test2-after.txt 2010-04-06 08:27:35.000000000 +0200 > @@ -30,28 +30,28 @@ > .global test2_knas_1 > test2_knas_1: > .test2_knas_1_12: > - sub r10, r10, #4, 2*0 > + sub r10, r10, #0x4 > str r14, [r10,#0] > .test2_knas_1_11: > mov r1, r1 > .test2_knas_1_6: > - and r0, r1, #15, 2*0 > - cmp r0, #15, 2*0 > + and r0, r1, #0xf > + cmp r0, #0xf > bne .test2_knas_1_3 > .test2_knas_1_5: > mov r4, r1, asr #4 > - mov r0, #255, 2*12 > + mov r0, #0xff00 > smull r3, r2, r4, r0 > mov r0, r3, asr #31 > cmp r0, r2 > bne .test2_knas_1_3 > .test2_knas_1_4: > - add r0, r3, #15, 2*0 > + add r0, r3, #0xf > mov r0, r0 > .test2_knas_1_2: > mov r0, r0 > ldr r14, [r10,#0] > - add r10, r10, #4, 2*0 > + add r10, r10, #0x4 > mov r15, r14 > .test2_knas_1_3: > mov r1, r1 Ok. Approved if you fix the too many newlines style issue. From bgustavsson@REDACTED Wed Apr 7 11:50:10 2010 From: bgustavsson@REDACTED (=?UTF-8?Q?Bj=C3=B6rn_Gustavsson?=) Date: Wed, 7 Apr 2010 11:50:10 +0200 Subject: [erlang-patches] [PATCH] Modify pp_arm to decode imm8m constants In-Reply-To: <19387.40211.201491.17227@pilspetsen.it.uu.se> References: <1270501154-2851-1-git-send-email-mortior@yahoo.se> <19386.53575.716086.254257@pilspetsen.it.uu.se> <1270582877.2365.5.camel@dumbo> <19387.40211.201491.17227@pilspetsen.it.uu.se> Message-ID: On Tue, Apr 6, 2010 at 10:44 PM, Mikael Pettersson wrote: > > Ok. Approved if you fix the too many newlines style issue. There is no need to re-submit the patch. I have fixed the newline issue. -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From kino@REDACTED Thu Apr 8 05:48:17 2010 From: kino@REDACTED (satoshi kinoshita) Date: Thu, 08 Apr 2010 12:48:17 +0900 Subject: a patch for "OldHeap unsed" Message-ID: Hi, system_info(procs) is currently reporting a same value for both "OldHeap" and "OldHeap unsed". This is a patch for erts/emulator/beam/break.c to report "OLD_HEND(p) - OLD_HTOP(p)" instead of "OLD_HEND(p) - OLD_HEAP(p)" for "OldHeap unsed". git fetch git://github.com/kinogmt/otp.git old_heap_unused kino From bgustavsson@REDACTED Thu Apr 8 09:54:17 2010 From: bgustavsson@REDACTED (=?UTF-8?Q?Bj=C3=B6rn_Gustavsson?=) Date: Thu, 8 Apr 2010 09:54:17 +0200 Subject: [erlang-patches] a patch for "OldHeap unsed" In-Reply-To: References: Message-ID: On Thu, Apr 8, 2010 at 5:48 AM, satoshi kinoshita wrote: > system_info(procs) is currently reporting a same value for both > "OldHeap" and "OldHeap unsed". > This is a patch for erts/emulator/beam/break.c to report > "OLD_HEND(p) - OLD_HTOP(p)" > instead of > "OLD_HEND(p) - OLD_HEAP(p)" > for "OldHeap unsed". > > git fetch git://github.com/kinogmt/otp.git old_heap_unused > Thanks! The patch itself looks good, but we would prefer to have a complete author name. Is OK to change the author identification to "Satoshi Kinoshito "? Also, I would like more information in the commit message, for instance like this: system_info(procs): Fix the value for "OldHeap unused" The value for "OldHeap unused" in the output of erlang:system_info(procs) and in crash dumps, was incorrectly calculated as the size of the entire old heap. If you approve the changes above, I can do the changes for you. You don't have to re-submit the patch. -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From kino@REDACTED Thu Apr 8 10:02:00 2010 From: kino@REDACTED (satoshi kinoshita) Date: Thu, 08 Apr 2010 17:02:00 +0900 Subject: [erlang-patches] a patch for "OldHeap unsed" In-Reply-To: References: Message-ID: At Thu, 8 Apr 2010 09:54:17 +0200, Bj?rn Gustavsson wrote: > > On Thu, Apr 8, 2010 at 5:48 AM, satoshi kinoshita wrote: > > > system_info(procs) is currently reporting a same value for both > > "OldHeap" and "OldHeap unsed". > > This is a patch for erts/emulator/beam/break.c to report > > "OLD_HEND(p) - OLD_HTOP(p)" > > instead of > > "OLD_HEND(p) - OLD_HEAP(p)" > > for "OldHeap unsed". > > > > git fetch git://github.com/kinogmt/otp.git old_heap_unused > > > > Thanks! The patch itself looks good, but we would prefer > to have a complete author name. Is OK to change the > author identification to "Satoshi Kinoshito "? Sure. Please go ahead fix it. (uh, my famylyname is "Kinoshita" though:) thanks, kino From bgustavsson@REDACTED Thu Apr 8 10:13:24 2010 From: bgustavsson@REDACTED (=?UTF-8?Q?Bj=C3=B6rn_Gustavsson?=) Date: Thu, 8 Apr 2010 10:13:24 +0200 Subject: [erlang-patches] a patch for "OldHeap unsed" In-Reply-To: References: Message-ID: 2010/4/8 satoshi kinoshita : > Please go ahead fix it. > (uh, my famylyname is "Kinoshita" though:) Sorry for getting it wrong. I'll fix that and include your branch in 'pu'. -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From bgustavsson@REDACTED Thu Apr 8 14:02:56 2010 From: bgustavsson@REDACTED (=?UTF-8?Q?Bj=C3=B6rn_Gustavsson?=) Date: Thu, 8 Apr 2010 14:02:56 +0200 Subject: [erlang-patches] Re: asn1ct verbose In-Reply-To: <6EA9A64B-8122-4B9F-8419-8380CE5CB0BB@babayev.com> References: <4ac8254d1003281413t2c7fe6b5w6b7f1bfdac437c33@mail.gmail.com> <315b1481003291837k1ee97239lc5c65131742c3b6@mail.gmail.com> <4ac8254d1003291902u452bc16ficeef25581ad59b37@mail.gmail.com> <6EA9A64B-8122-4B9F-8419-8380CE5CB0BB@babayev.com> Message-ID: On Wed, Mar 31, 2010 at 10:55 PM, Ruslan Babayev wrote: > What would verbose flag be used for, then? > The verbose flag should be used for turning on any extra output that can be useful for debugging (of either the compiler itself or the source code that is being compiled). -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From christopher.faulet@REDACTED Thu Apr 8 22:48:41 2010 From: christopher.faulet@REDACTED (christopher faulet) Date: Thu, 08 Apr 2010 22:48:41 +0200 Subject: Add function timer:tc/2 Message-ID: <4BBE4129.6010809@capflam.org> Hi, Here is a patch that adds the function timer:tc/2. It works like timer:tc/3 but for anonymous functions. git fetch git://github.com/capflam/otp.git timer_tc Thanks, -- Christopher Faulet -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 261 bytes Desc: OpenPGP digital signature URL: From bgustavsson@REDACTED Fri Apr 9 15:00:00 2010 From: bgustavsson@REDACTED (=?UTF-8?Q?Bj=C3=B6rn_Gustavsson?=) Date: Fri, 9 Apr 2010 15:00:00 +0200 Subject: [erlang-patches] Add function timer:tc/2 In-Reply-To: <4BBE4129.6010809@capflam.org> References: <4BBE4129.6010809@capflam.org> Message-ID: On Thu, Apr 8, 2010 at 10:48 PM, christopher faulet wrote: > > git fetch git://github.com/capflam/otp.git timer_tc Thanks! Will include in 'pu'. -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From michael.santos@REDACTED Mon Apr 12 03:24:20 2010 From: michael.santos@REDACTED (Michael Santos) Date: Sun, 11 Apr 2010 21:24:20 -0400 Subject: [PATCH] Truncate debug messages Message-ID: <20100412012420.GA12408@ecn.lan> When the undocumented ERL_INET_GETHOST_DEBUG environment variable is set to 5, very long hostnames can overflow the buffer used to construct the debug message. Truncate the domain name to 255 bytes (DOMAINNAME_MAX-3). export ERL_INET_GETHOST_DEBUG=5 inet:gethostbyname(lists:duplicate(5000,"x")). --- erts/etc/common/inet_gethost.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/erts/etc/common/inet_gethost.c b/erts/etc/common/inet_gethost.c index ff16ee0..17f83e2 100644 --- a/erts/etc/common/inet_gethost.c +++ b/erts/etc/common/inet_gethost.c @@ -1746,7 +1746,7 @@ static int worker_loop(void) } proto = get_proto(req); data = get_data(req); - DEBUGF(4,("Worker got request, op = %d, proto = %d, data = %s.", + DEBUGF(4,("Worker got request, op = %d, proto = %d, data = %.255s.", op,proto,data)); /* Got a request, lets go... */ switch (op) { @@ -1762,14 +1762,14 @@ static int worker_loop(void) hints.ai_flags = (AI_CANONNAME|AI_V4MAPPED|AI_ADDRCONFIG); hints.ai_socktype = SOCK_STREAM; hints.ai_family = AF_INET6; - DEBUGF(5, ("Starting getaddrinfo(%s, ...)", data)); + DEBUGF(5, ("Starting getaddrinfo(%.255s, ...)", data)); error_num = getaddrinfo((char *)data, NULL, &hints, &ai); DEBUGF(5,("getaddrinfo returned %d", error_num)); if (error_num) { error_num = map_netdb_error_ai(error_num); } #elif defined(HAVE_GETIPNODEBYNAME) /*#ifdef HAVE_GETADDRINFO */ - DEBUGF(5,("Starting getipnodebyname(%s)",data)); + DEBUGF(5,("Starting getipnodebyname(%.255s)",data)); he = getipnodebyname(data, AF_INET6, AI_DEFAULT, &error_num); if (he) { free_he = 1; @@ -1780,7 +1780,7 @@ static int worker_loop(void) error_num = map_netdb_error(error_num); } #elif defined(HAVE_GETHOSTBYNAME2) /*#ifdef HAVE_GETADDRINFO */ - DEBUGF(5,("Starting gethostbyname2(%s, AF_INET6)",data)); + DEBUGF(5,("Starting gethostbyname2(%.255s, AF_INET6)",data)); he = gethostbyname2((char*)data, AF_INET6); if (he) { error_num = 0; @@ -1796,7 +1796,7 @@ static int worker_loop(void) #endif /*ifdef HAVE_IN6 */ case PROTO_IPV4: { /* switch (proto) { */ - DEBUGF(5,("Starting gethostbyname(%s)",data)); + DEBUGF(5,("Starting gethostbyname(%.255s)",data)); he = gethostbyname((char*)data); if (he) { error_num = 0; -- 1.5.6.4 From mikpe@REDACTED Mon Apr 12 11:47:40 2010 From: mikpe@REDACTED (Mikael Pettersson) Date: Mon, 12 Apr 2010 11:47:40 +0200 Subject: [erlang-patches] [PATCH] Truncate debug messages In-Reply-To: <20100412012420.GA12408@ecn.lan> References: <20100412012420.GA12408@ecn.lan> Message-ID: <19394.60476.51124.337773@pilspetsen.it.uu.se> Michael Santos writes: > When the undocumented ERL_INET_GETHOST_DEBUG environment variable > is set to 5, very long hostnames can overflow the buffer used to > construct the debug message. Truncate the domain name to 255 bytes > (DOMAINNAME_MAX-3). > > export ERL_INET_GETHOST_DEBUG=5 > inet:gethostbyname(lists:duplicate(5000,"x")). > --- > erts/etc/common/inet_gethost.c | 10 +++++----- > 1 files changed, 5 insertions(+), 5 deletions(-) > > diff --git a/erts/etc/common/inet_gethost.c b/erts/etc/common/inet_gethost.c > index ff16ee0..17f83e2 100644 > --- a/erts/etc/common/inet_gethost.c > +++ b/erts/etc/common/inet_gethost.c > @@ -1746,7 +1746,7 @@ static int worker_loop(void) > } > proto = get_proto(req); > data = get_data(req); > - DEBUGF(4,("Worker got request, op = %d, proto = %d, data = %s.", > + DEBUGF(4,("Worker got request, op = %d, proto = %d, data = %.255s.", etc. I believe the better solution is to replace the unsafe vsprintf() calls in inet_gethost.c with erts_vsnprintf() calls. From michael.santos@REDACTED Tue Apr 13 02:22:03 2010 From: michael.santos@REDACTED (Michael Santos) Date: Mon, 12 Apr 2010 20:22:03 -0400 Subject: [PATCH] Truncate debug messages Message-ID: <20100413002203.GA14741@ecn.lan> When the undocumented ERL_INET_GETHOST_DEBUG environment variable is set to 5, very long hostnames can overflow the buffer used to construct the debug message. Truncate debug messages if they exceed the size of the buffer. export ERL_INET_GETHOST_DEBUG=5 inet:gethostbyname(lists:duplicate(5000,"x")). --- erts/etc/common/Makefile.in | 10 +++++----- erts/etc/common/inet_gethost.c | 8 +++++--- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/erts/etc/common/Makefile.in b/erts/etc/common/Makefile.in index 3db4fcb..d2a5080 100644 --- a/erts/etc/common/Makefile.in +++ b/erts/etc/common/Makefile.in @@ -96,9 +96,9 @@ endif # On windows we always need reentrant libraries. ifeq ($(TARGET),win32) -ERLEXEC_XLIBS=-L../../lib/internal/$(TARGET) -lerts_internal_r$(ERTS_LIB_TYPEMARKER) @ERTS_INTERNAL_X_LIBS@ +ERTS_INTERNAL_LIBS=-L../../lib/internal/$(TARGET) -lerts_internal_r$(ERTS_LIB_TYPEMARKER) @ERTS_INTERNAL_X_LIBS@ else -ERLEXEC_XLIBS=-L../../lib/internal/$(TARGET) -lerts_internal$(ERTS_LIB_TYPEMARKER) @ERTS_INTERNAL_X_LIBS@ +ERTS_INTERNAL_LIBS=-L../../lib/internal/$(TARGET) -lerts_internal$(ERTS_LIB_TYPEMARKER) @ERTS_INTERNAL_X_LIBS@ endif # ---------------------------------------------------- @@ -295,7 +295,7 @@ $(OBJDIR)/inet_gethost.o: inet_gethost.c $(CC) $(CFLAGS) -o $@ -c inet_gethost.c $(BINDIR)/inet_gethost@REDACTED@: $(OBJDIR)/inet_gethost.o $(ENTRY_OBJ) - $(PURIFY) $(LD) $(LDFLAGS) $(ENTRY_LDFLAGS) -o $@ $(OBJDIR)/inet_gethost.o $(ENTRY_OBJ) $(LIBS) + $(PURIFY) $(LD) $(LDFLAGS) $(ENTRY_LDFLAGS) -o $@ $(OBJDIR)/inet_gethost.o $(ENTRY_OBJ) $(LIBS) $(ERTS_INTERNAL_LIBS) $(BINDIR)/run_erl: $(OBJDIR)/safe_string.o $(OBJDIR)/run_erl.o $(LD) $(LDFLAGS) -o $@ $(OBJDIR)/safe_string.o $(OBJDIR)/run_erl.o $(LIBS) @@ -320,7 +320,7 @@ $(OBJDIR)/safe_string.o: ../unix/safe_string.c ifneq ($(TARGET),win32) $(BINDIR)/$(ERLEXEC): $(OBJDIR)/$(ERLEXEC).o - $(PURIFY) $(LD) $(LDFLAGS) -o $@ $(OBJDIR)/$(ERLEXEC).o $(ERLEXEC_XLIBS) + $(PURIFY) $(LD) $(LDFLAGS) -o $@ $(OBJDIR)/$(ERLEXEC).o $(ERTS_INTERNAL_LIBS) $(OBJDIR)/$(ERLEXEC).o: $(ERLEXECDIR)/$(ERLEXEC).c $(CC) -I$(EMUDIR) $(CFLAGS) -o $@ -c $(ERLEXECDIR)/$(ERLEXEC).c @@ -360,7 +360,7 @@ $(OBJDIR)/escript.o: escript.c ifeq ($(TARGET),win32) $(BINDIR)/$(ERLEXEC): $(OBJDIR)/erlexec.o $(OBJDIR)/win_erlexec.o $(OBJDIR)/init_file.o $(OBJDIR)/$(ERLRES_OBJ) - $(LD) -dll $(LDFLAGS) -o $@ $(OBJDIR)/erlexec.o $(OBJDIR)/win_erlexec.o $(OBJDIR)/init_file.o $(OBJDIR)/$(ERLRES_OBJ) $(ERLEXEC_XLIBS) + $(LD) -dll $(LDFLAGS) -o $@ $(OBJDIR)/erlexec.o $(OBJDIR)/win_erlexec.o $(OBJDIR)/init_file.o $(OBJDIR)/$(ERLRES_OBJ) $(ERTS_INTERNAL_LIBS) $(BINDIR)/erl@REDACTED@: $(OBJDIR)/erl.o $(OBJDIR)/init_file.o $(OBJDIR)/$(ERLRES_OBJ) $(LD) $(LDFLAGS) -o $@ $(OBJDIR)/erl.o $(OBJDIR)/init_file.o $(OBJDIR)/$(ERLRES_OBJ) diff --git a/erts/etc/common/inet_gethost.c b/erts/etc/common/inet_gethost.c index ff16ee0..bd2be47 100644 --- a/erts/etc/common/inet_gethost.c +++ b/erts/etc/common/inet_gethost.c @@ -52,6 +52,8 @@ # include "config.h" #endif +#include "erl_printf.h" + #ifdef WIN32 #define WIN32_LEAN_AND_MEAN @@ -2552,7 +2554,7 @@ static void debugf(char *format, ...) sprintf(buff,"%s[%d] (DEBUG):",program_name,(int) getpid()); #endif ptr = buff + strlen(buff); - vsprintf(ptr,format,ap); + erts_vsnprintf(ptr,sizeof(buff)-strlen(buff)-2,format,ap); strcat(ptr,"\r\n"); #ifdef WIN32 if (debug_console_allocated != INVALID_HANDLE_VALUE) { @@ -2574,7 +2576,7 @@ static void warning(char *format, ...) va_start(ap,format); sprintf(buff,"%s[%d]: WARNING:",program_name, (int) getpid()); ptr = buff + strlen(buff); - vsprintf(ptr,format,ap); + erts_vsnprintf(ptr,sizeof(buff)-strlen(buff)-2,format,ap); strcat(ptr,"\r\n"); #ifdef WIN32 { @@ -2596,7 +2598,7 @@ static void fatal(char *format, ...) va_start(ap,format); sprintf(buff,"%s[%d]: FATAL ERROR:",program_name, (int) getpid()); ptr = buff + strlen(buff); - vsprintf(ptr,format,ap); + erts_vsnprintf(ptr,sizeof(buff)-strlen(buff)-2,format,ap); strcat(ptr,"\r\n"); #ifdef WIN32 { -- 1.5.6.4 From bgustavsson@REDACTED Tue Apr 13 07:39:57 2010 From: bgustavsson@REDACTED (=?UTF-8?Q?Bj=C3=B6rn_Gustavsson?=) Date: Tue, 13 Apr 2010 07:39:57 +0200 Subject: [erlang-patches] [PATCH] Truncate debug messages In-Reply-To: <20100413002203.GA14741@ecn.lan> References: <20100413002203.GA14741@ecn.lan> Message-ID: On Tue, Apr 13, 2010 at 2:22 AM, Michael Santos wrote: > When the undocumented ERL_INET_GETHOST_DEBUG environment variable > is set to 5, very long hostnames can overflow the buffer used to > construct the debug message. Truncate debug messages if they exceed > the size of the buffer. Thanks! Will include in 'pu'. -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From bgustavsson@REDACTED Tue Apr 13 09:15:41 2010 From: bgustavsson@REDACTED (=?ISO-8859-1?Q?Bj=F6rn_Gustavsson?=) Date: Tue, 13 Apr 2010 09:15:41 +0200 Subject: What's cooking in erlang/otp (2010-04-13) Message-ID: <4BC41A1D.3060202@gmail.com> ------------------------------------------------------------ [Graduated] * bg/ts_run (test_server) (2010-04-02) 1 commit + ts_run: Don't run make:all/1 without a good reason (b42442e) * jb/pp_arm-imm-fix (hipe) (2010-04-05) 1 commit + Modify pp_arm to decode imm8m constants (807ebc9) * rb/ssl-fix-http-packet-decoding (ssl) (2010-03-16) 1 commit + Fix ssl to decode http packets in the same way as gen_tcp (b1d9fec) * rb/ssl-opts-fix (ssl) (2010-04-05) 2 commits + Fix verification of ssl client when fail_if_no_peer_cert (16dafd1) + Fix mishandling of valid ssl options (c754439) * rb/ssl-transport-accept-fix (ssl) (2010-03-28) 1 commit + Fix ssl:transport_accept/2 to return properly when socket is closed (0e502e4) * sk/old_heap-unused (erts) (2010-04-08) 1 commit + system_info(procs): Fix the value for "OldHeap unused" (ac8f094) * ta/asn1-verbose (asn1) (2010-04-08) 2 commits + Add test for verbose option to asn1_SUITE (2afc5c0) + Teach asn1ct verbose option (900ee73) * ta/doc-fakefop (erts, otp) (2010-03-29) 1 commit + Build placeholder PDF files if FOP is not found (bdb41b9) * ta/nif-documentation (erts) (2010-04-03) 2 commits + Fix typos in erl_nif.xml (f265f7d) + Build erl_nif manpage (cba83b3) ------------------------------------------------------------ [New topics] * bg/deprecations (compiler, crypto, stdlib) (2010-04-08) 3 commits - test suites: Remove incidental use of deprecated concat_binary/1 (1403571) - Postpone removal of concat_binary/1 (ca2b31a) - Remove deprecated lists:flat_length/1 (0c2be22) * bg/fconv (erts) (2010-04-07) 1 commit - erts: Fix loading of modules with invalid floating point arithmetic (fd9bb9f) * bg/remove-stray-ose-support (erl_interface, erts, kernel, otp, test_server) (2010-04-13) 11 commits - configure: Remove stray OSE/Delta support (734e7f7) - Makefiles: Remove stray OSE/Delta support (8c55c15) - kernel tests: Remove stray OSE/Delta support (954bddc) - system tests: Remove stray OSE/Delta support (102566a) - erl_interface tests: Remove stray OSE/Delta support (3f844ee) - epmd: Remove stray OSE/Delta support (a1a3259) - epmd: #ifdef out start_epmd() for other platforms than VxWorks (20d4049) - emulator tests: Remove stray OSE/Delta support (62a5970) - emulator: Remove stray OSE/Delta support (7e6b3b2) - emulator: Eliminate #ifdef for sys_tty_reset() (5281c61) - test_server: Remove stray support for OSE/Delta (7f85f02) * cf/timer_tc (stdlib) (2010-04-06) 1 commit - Add timer:tc/2 to measure the elapsed time of anonymous functions (2cca650) * hb/edoc (edoc) (2010-04-01) 1 commit - EDoc and Dialyzer specs and types (516e16c) * ks/stdlib (stdlib) (2010-04-10) 4 commits - erl_parse.yrl: Add missing operator in type declaration (d1e8737) - stdlib: Add types and specs (0ca1793) - stdlib: Use fun object instead of {M,F} tuple (19babf5) - ets: Cleanup as suggested by tidier (95c2c8f) * ms/inet_gethost-safe-debug-output (erts) (2010-04-12) 1 commit - Truncate debug messages (c4c2067) * ta/asn1-gratuitous-output (asn1) (2010-04-10) 1 commit - Remove gratuitous ok report in asn1ct (1eb1f13) ------------------------------------------------------------ [Stalled] * bg/safer-local_to_univ (erts) (2010-02-11) 1 commit - erl_time_sup.c: test for error return from mktime() (0f62f0b) We will not include this branch in R13B04 for two reasons: o We are not 100% sure that this change is harmless on all platforms in all timezones. o We have an idea how the underlying problem can be fixed in the calendar module (only) and I plan to try it out after the release. We will keep this branch in pu as a reminder. Action expected from: Bj??rn Gustavsson * db/tv_nthtail_fix (tv) (2009-12-01) 1 commit - Fix for tv which restarts while trying to open a table (abe0759) Since our long-term goal is to migrate from gs towards wx, maintaining the old gs applications has a low priority for the Erlang/OTP team. Therefore, we will accept patches that seem sound, but we are unlikely to spend much of our own time fixing bugs. The author of this topic branch has found the real reason for the problem, but uncovered additional issues. Action expected from: The topic author - to decide whether to include the topic branch (which is a workaround, but does eliminate the crash) or to wait for a better fix from himself or someone else with an interest to advance the topic. * er/ei-decode_msg (erl_interface) (2010-03-11) 1 commit - Add function to decode distribution header (864091a) Needs documentation and test cases. Action expected from: Topic author * jp/dependencies_makefile (compiler, erts) (2010-02-14) 3 commits - squash! eliminate dialyzer warning (434e2ca) - squash! fix snprintf for Windows (bf2708d) - Add dependencies Makefile generation to erlc(1) and compile(3) (7cbc437) Approved in principle by the OTP Technical Board; now awaits a closer review of the implementation. Action expected from: Bj??rn Gustavsson (the reviewer) * kr/gs-browser (gs) (2010-02-10) 1 commit - Change lib/gs/src/tool_utils.erl to select multiple browsers other than Netscape (802d159) This topic branch introduces a new call to the deprecated regexp module. Action expected from: Topic author or anyone else with an interest to advance the topic ------------------------------------------------------------ [Cooking] * am/kernel-stops (kernel) (2010-02-21) 1 commit - Change restart behavior of network apps from permanent to transient (397343b) * am/net_kernel_catchall (kernel) (2010-02-20) 1 commit - Add catch all handle_call to net_kernel (77ee109) * bg/compiler (compiler, stdlib) (2010-03-12) 5 commits - beam_peep: Remove optimization already done by beam_dead (f4e3b6e) - beam_dead: Combine is_eq_exact instructions into select_val instructions (c964f06) - Evaluate is_record/3 at compile-time using type information (e54f3a3) - Evaluate element/2 at compile-time using type information (01deb2c) - erl_expand_records: Replace is_record() with matching (e95dcd6) * bg/temp-hipe-fixes (compiler, hipe, kernel) (2010-03-15) 6 commits - Avoid crash by skipping compilation_SUITE:on_load/1 (234e13e) - Inline less aggressively for native-code compilation (9fcb48b) - Crudely fix return type for the lists:key{search,find,member}/3 (ef71597) - seq_trace_SUITE: Don't native-compile (2a81b1a) - Disable native code if on_load is used (3befa76) - andor_SUITE: Don't native-compile (97aa2da) This branch contains temporary workarounds to avoid failing test cases and is never intended to graduate. * dp/shell-line-editing (kernel, stdlib) (2010-03-05) 1 commit - Readline-style line edit history (91e912b) * gl/jinterface-pom (jinterface, otp) (2010-02-15) 2 commits - Exclude jinterface build artifact from git (5acf5fa) - Add pom.xml for jinterface build (aa68190) * jb/inet6-dist (erts, kernel) (2010-03-23) 3 commits - Support IPv6 addresses in long host names (a1fb1dd) - Fix implementation of IPv6 TCP distribution protocol (3c1f843) - Fix compilation of epmd with IPv6 enabled (b39b8b7) * jf/run_erl-disable-flow-control (erts) (2010-03-05) 1 commit - Teach run_erl RUN_ERL_DISABLE_FLOWCNTRL for disabling flow control (d0775cd) * jl/windows-file-share-delete (erts) (2010-02-22) 1 commit - Windows: Open files with FILE_SHARE_DELETE to get closer to UNIX semantics (e5e5597) * jn/ic-docs-without-java (ic) (2010-03-07) 1 commit - Permit building and installing documentation without Java (2016a08) * ks/cleanups (compiler, debugger, docbuilder, gs, kernel, stdlib) (2010-04-10) 6 commits - compiler: Fix incorrect types and specs (fe8e26c) - escript: Add more types to records (9510645) - kernel: Clean up as suggested by tidier (1aa54a1) - debugger: Clean up as suggested by tidier (bd4b8be) - docbuilder: Clean up as suggested by tidier (8e534c7) - gs: Clean up as suggested by tidier (7944862) Was formerly called ks/cleanups-after-r13b04. * ks/export_type (compiler, dialyzer, hipe, kernel, stdlib, syntax_tools) (2010-03-22) 12 commits - Minor fix in a print message (358383d) - Add handling of unknown types (86431df) - Add declaration for exported types (3c33970) - Add types and specs; performed some cleanups also (b9246e3) - erl_scan: Add declarations for exported types (a5aecf9) - stdlib: Add declarations for exported types (c99bb08) - hipe: Add declarations for exported types (ccf4f09) - compiler: Add declarations for exported types (dbb1e73) - syntax_tools: Add declarations for exported types (bfbf202) - kernel: Add declaration for exported types (e56ebd6) - Support -export_type() in dialyzer and erl_types (704ae6f) - Add infrastructure for the -export_type() attribute (8a3faa7) * mh/ssh_channel-init-no-catch (ssh) (2010-01-25) 1 commit - Remove pointless catch from ssh_channel:init/1. (bb7eaa5) * ms/epmd-error-checking (erts) (2010-03-29) 2 commits - fixup! Exit if an error occurs with the listening socket (c103599) - Exit if an error occurs with the listening socket (a4882b4) * ms/pcre-compile-workspace-overrun (erts, stdlib) (2010-03-19) 2 commits - re_SUITE: Add pcre_compile_workspace_overflow/1 (3efa1b8) - Fix check for compile workspace overflow (272e106) * ra/include-public_key-in-ssh (ssh) (2010-01-20) 1 commit - Added public_key among ssh applications. (3a0c2c5) * rd/erlang-eunit (tools) (2010-03-22) 1 commit - erlang-eunit.el: Require cl, as it is used (43ae537) * sv/format_status_error_info (stdlib) (2010-02-28) 2 commits - Add support for the format_status callback to gen_event (fd9abcb) - Extend format_status for gen_server/gen_fsm termination error logging (3d06952) * sv/sasl-fix-get_status (sasl) (2010-03-26) 1 commit - fix sys:get_status backward compatibility for sasl release_handler_1 (3cc2ceb) * ta/nested-records (compiler, stdlib) (2010-03-25) 1 commit - Support nested record field access without parentheses (34053b5) From lemenkov@REDACTED Thu Apr 15 11:54:38 2010 From: lemenkov@REDACTED (Peter Lemenkov) Date: Thu, 15 Apr 2010 13:54:38 +0400 Subject: [PATCH] Fix shared libraries installation Message-ID: <1271325278-14045-1-git-send-email-lemenkov@gmail.com> Several shared libraries (asn1_erl_drv.so, megaco_flex_scanner_drv_mt.so, megaco_flex_scanner_drv.so, wxe_driver.so) were installed as data files previously. Signed-off-by: Peter Lemenkov --- lib/asn1/c_src/Makefile | 2 +- lib/megaco/src/flex/Makefile.in | 2 +- lib/wx/c_src/Makefile.in | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/asn1/c_src/Makefile b/lib/asn1/c_src/Makefile index 906c513..9e9cb18 100644 --- a/lib/asn1/c_src/Makefile +++ b/lib/asn1/c_src/Makefile @@ -124,7 +124,7 @@ include $(ERL_TOP)/make/otp_release_targets.mk release_spec: opt $(INSTALL_DIR) $(RELSYSDIR)/priv/lib - $(INSTALL_DATA) $(SHARED_OBJ_FILES) $(RELSYSDIR)/priv/lib + $(INSTALL_PROGRAM) $(SHARED_OBJ_FILES) $(RELSYSDIR)/priv/lib $(INSTALL_DIR) $(RELSYSDIR)/c_src $(INSTALL_DATA) $(C_FILES) $(RELSYSDIR)/c_src diff --git a/lib/megaco/src/flex/Makefile.in b/lib/megaco/src/flex/Makefile.in index 6ce9b34..5af651d 100644 --- a/lib/megaco/src/flex/Makefile.in +++ b/lib/megaco/src/flex/Makefile.in @@ -280,7 +280,7 @@ release_spec: opt $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin ifeq ($(ENABLE_MEGACO_FLEX_SCANNER),true) $(INSTALL_DATA) $(FLEX_FILES) $(C_TARGETS) $(RELSYSDIR)/src/flex - $(INSTALL_DATA) $(SOLIBS) $(RELSYSDIR)/priv/lib + $(INSTALL_PROGRAM) $(SOLIBS) $(RELSYSDIR)/priv/lib endif diff --git a/lib/wx/c_src/Makefile.in b/lib/wx/c_src/Makefile.in index 5a0b4ce..8710641 100644 --- a/lib/wx/c_src/Makefile.in +++ b/lib/wx/c_src/Makefile.in @@ -167,7 +167,7 @@ release_spec: opt $(INSTALL_DIR) $(RELSYSDIR)/priv/$(SYS_TYPE) $(INSTALL_DATA) ../priv/erlang-logo32.png $(RELSYSDIR)/priv/ $(INSTALL_DATA) ../priv/erlang-logo64.png $(RELSYSDIR)/priv/ - $(INSTALL_DATA) $(TARGET_DIR)/$(TARGET_API)$(SO_EXT) $(RELSYSDIR)/priv/$(SYS_TYPE) + $(INSTALL_PROGRAM) $(TARGET_DIR)/$(TARGET_API)$(SO_EXT) $(RELSYSDIR)/priv/$(SYS_TYPE) release_docs_spec: -- 1.6.6.1 From bgustavsson@REDACTED Thu Apr 15 17:05:27 2010 From: bgustavsson@REDACTED (=?UTF-8?Q?Bj=C3=B6rn_Gustavsson?=) Date: Thu, 15 Apr 2010 17:05:27 +0200 Subject: [erlang-patches] [PATCH] Fix shared libraries installation In-Reply-To: <1271325278-14045-1-git-send-email-lemenkov@gmail.com> References: <1271325278-14045-1-git-send-email-lemenkov@gmail.com> Message-ID: On Thu, Apr 15, 2010 at 11:54 AM, Peter Lemenkov wrote: > Several shared libraries (asn1_erl_drv.so, megaco_flex_scanner_drv_mt.so, > megaco_flex_scanner_drv.so, wxe_driver.so) were installed as data files > previously. > Thanks! Included in pu. -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From tuncer.ayaz@REDACTED Fri Apr 16 19:17:23 2010 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Fri, 16 Apr 2010 19:17:23 +0200 Subject: code:clash/0: match correct return value from erl_prim_loader:list_dir/1 Message-ID: Fix the error introduced in 49da83 while correcting another code:clash/0 issue. Also update and extend the tests in kernel/code_SUITE:clash/1. git fetch git://github.com/tuncer/otp.git code_clash_filter_error From tuncer.ayaz@REDACTED Sat Apr 17 19:24:42 2010 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Sat, 17 Apr 2010 19:24:42 +0200 Subject: Extend NIF API: get_atom_length,get_list_length,get_iolist_length,is_tuple Message-ID: Add the following NIF API functions: enif_get_atom_length enif_get_list_length enif_get_iolist_length enif_is_tuple git fetch git://github.com/tuncer/otp.git nifapi From bgustavsson@REDACTED Mon Apr 19 08:00:38 2010 From: bgustavsson@REDACTED (=?UTF-8?Q?Bj=C3=B6rn_Gustavsson?=) Date: Mon, 19 Apr 2010 08:00:38 +0200 Subject: [erlang-patches] code:clash/0: match correct return value from erl_prim_loader:list_dir/1 In-Reply-To: References: Message-ID: On Fri, Apr 16, 2010 at 7:17 PM, Tuncer Ayaz wrote: > Fix the error introduced in 49da83 while correcting another > code:clash/0 issue. Please include this information in the commit message (especially the SHA1, so facilitate for anyone browsing the history to quickly find the commit where the bug was introduced). -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From bgustavsson@REDACTED Mon Apr 19 08:03:20 2010 From: bgustavsson@REDACTED (=?UTF-8?Q?Bj=C3=B6rn_Gustavsson?=) Date: Mon, 19 Apr 2010 08:03:20 +0200 Subject: [erlang-patches] Extend NIF API: get_atom_length,get_list_length,get_iolist_length,is_tuple In-Reply-To: References: Message-ID: On Sat, Apr 17, 2010 at 7:24 PM, Tuncer Ayaz wrote: > Add the following NIF API functions: > enif_get_atom_length > enif_get_list_length > enif_get_iolist_length > enif_is_tuple > > git fetch git://github.com/tuncer/otp.git nifapi Thanks! Will include in 'pu'. -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From tuncer.ayaz@REDACTED Mon Apr 19 12:48:46 2010 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Mon, 19 Apr 2010 12:48:46 +0200 Subject: [erlang-patches] code:clash/0: match correct return value from erl_prim_loader:list_dir/1 In-Reply-To: References: Message-ID: 2010/4/19 Bj?rn Gustavsson : > On Fri, Apr 16, 2010 at 7:17 PM, Tuncer Ayaz wrote: >> Fix the error introduced in 49da83 while correcting another >> code:clash/0 issue. > > Please include this information in the commit message (especially the > SHA1, so facilitate for anyone browsing the history to quickly find the > commit where the bug was introduced). Done. From per@REDACTED Mon Apr 19 16:12:04 2010 From: per@REDACTED (Per Hedeland) Date: Mon, 19 Apr 2010 16:12:04 +0200 (CEST) Subject: snmpc fails to compile BITS with "holes" Message-ID: <201004191412.o3JEC4H5010139@pluto.hedeland.org> E.g. DOCS-CABLE-DEVICE-MIB: docsDevEvReporting OBJECT-TYPE SYNTAX BITS { local(0), traps(1), syslog(2), -- The following are extensions to the original set of -- labels. The extensions start at an octet boundary. -- So for bits 3 - 7, one MUST set them to zero on send -- and one MUST ignore them on receipt. localVolatile(8), stdInterface(9) } results in DOCS-CABLE-DEVICE-MIB.mib: 1192: Error: Expected kibble no 3 but got 8. Trivial fix below (sorry, still no git). --Per Hedeland --- otp_src_R13B04/lib/snmp/src/compile/snmpc_lib.erl.orig 2009-11-20 09:48:28.000000000 +0100 +++ otp_src_R13B04/lib/snmp/src/compile/snmpc_lib.erl 2010-04-19 16:07:07.000000000 +0200 @@ -125,7 +125,8 @@ test_kibbles2([],_,_) -> ok; -test_kibbles2([{_KibbleName,BitNo}|Ks],BitNo,Line) -> +test_kibbles2([{_KibbleName,BitNo}|Ks],ExpectBitNo,Line) + when BitNo >= ExpectBitNo -> test_kibbles2(Ks,BitNo+1,Line); test_kibbles2([{_KibbleName,BitNo}|_Ks],ExpectBitNo,Line) -> print_error("Expected kibble no ~p but got ~p.",[ExpectBitNo,BitNo],Line). From bgustavsson@REDACTED Mon Apr 19 16:45:05 2010 From: bgustavsson@REDACTED (=?UTF-8?Q?Bj=C3=B6rn_Gustavsson?=) Date: Mon, 19 Apr 2010 16:45:05 +0200 Subject: [erlang-patches] code:clash/0: match correct return value from erl_prim_loader:list_dir/1 In-Reply-To: References: Message-ID: 2010/4/19 Tuncer Ayaz : >> Please include this information in the commit message (especially the >> SHA1, so facilitate for anyone browsing the history to quickly find the >> commit where the bug was introduced). > > Done. Thanks! Will include in pu. -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From CLJ016@REDACTED Wed Apr 21 17:21:59 2010 From: CLJ016@REDACTED (Jensen Lars-CLJ016) Date: Wed, 21 Apr 2010 16:21:59 +0100 Subject: Fix for wrong parameter size for IP_MULTICAST_TTL and IP_MULTICAST_LOOP in setsockopt() Message-ID: The size of parameter setsockopt() is unsigned char for IP_MULTICAST_TTL and IP_MULTICAST_LOOP. This is needed to work on Solaris10 but linux also accept int that is why the current version works on linux. Patch: -------------------------------------------------------- otp_src_R13B04/erts/emulator/drivers/common/inet_drv.c: @@ -4542,6 +4542,7 @@ static int inet_set_opts(inet_descriptor* desc, char* ptr, ???? struct ip_mreq mreq_val; ?#endif ???? int ival; +??? unsigned char cval; // needed for MULTICAST_TTL and MULTICAST_LOOP ???? char* arg_ptr; ???? int arg_sz; ???? enum PacketParseType old_htype = desc->htype; @@ -4795,6 +4796,11 @@ static int inet_set_opts(inet_descriptor* desc, char* ptr ?#ifdef HAVE_MULTICAST_SUPPORT ? ??????? case UDP_OPT_MULTICAST_TTL: +???????? /* The datatype is unsigned char*/ +?????????? cval = (unsigned char) ival; +?????????? arg_sz = sizeof(cval); +?????????? arg_ptr = (char*) &cval; + ??????????? proto = IPPROTO_IP; ??????????? type = IP_MULTICAST_TTL; ??????????? DEBUGF(("inet_set_opts(%ld): s=%d, IP_MULTICAST_TTL=%d\r\n", @@ -4802,6 +4808,11 @@ static int inet_set_opts(inet_descriptor* desc, char* ptr ??????????? break; ? ??????? case UDP_OPT_MULTICAST_LOOP: +???????? /* The datatype is unsigned char*/ +?????????? cval = (unsigned char) ival; +?????????? arg_sz = sizeof(cval); +?????????? arg_ptr = (char*) &cval; + ??????????? proto = IPPROTO_IP; ??????????? type = IP_MULTICAST_LOOP; ??????????? DEBUGF(("inet_set_opts(%ld): s=%d, IP_MULTICAST_LOOP=%d\r\n", -------------------------------------------------------- Lars S. Jensen ----------------------------------------------------------------------------The information contained in this communication has been classified as: [ X ] Public ----------------------------------------------------------------------------Motorola A/S, Sydvestvej 15, DK-2600 Glostrup, Denmark, CVR No. 10 29 08 13-Denmark ,VAT No: DK10290813, Limited Liability Company, Details of Motorola's subsidiaries in the EU/EEA can be found at: www.motorola.com/legal/euregistrationinfo From CLJ016@REDACTED Wed Apr 21 16:41:01 2010 From: CLJ016@REDACTED (Jensen Lars-CLJ016) Date: Wed, 21 Apr 2010 15:41:01 +0100 Subject: Fix for wrong parameter size for IP_MULTICAST_TTL and IP_MULTICAST_LOOP in setsockopt() Message-ID: The size of parameter setsockopt() is unsigned char for IP_MULTICAST_TTL and IP_MULTICAST_LOOP. This is needed to work on Solaris10 but linux also accept int that is why this works on linux. Patch: -------------------------------------------------------- otp_src_R13B04/erts/emulator/drivers/common/inet_drv.c: @@ -4542,6 +4542,7 @@ static int inet_set_opts(inet_descriptor* desc, char* ptr, ???? struct ip_mreq mreq_val; ?#endif ???? int ival; +??? unsigned char cval; // needed for MULTICAST_TTL and MULTICAST_LOOP ???? char* arg_ptr; ???? int arg_sz; ???? enum PacketParseType old_htype = desc->htype; @@ -4795,6 +4796,11 @@ static int inet_set_opts(inet_descriptor* desc, char* ptr ?#ifdef HAVE_MULTICAST_SUPPORT ? ??????? case UDP_OPT_MULTICAST_TTL: +???????? /* The datatype is unsigned char*/ +?????????? cval = (unsigned char) ival; +?????????? arg_sz = sizeof(cval); +?????????? arg_ptr = (char*) &cval; + ??????????? proto = IPPROTO_IP; ??????????? type = IP_MULTICAST_TTL; ??????????? DEBUGF(("inet_set_opts(%ld): s=%d, IP_MULTICAST_TTL=%d\r\n", @@ -4802,6 +4808,11 @@ static int inet_set_opts(inet_descriptor* desc, char* ptr ??????????? break; ? ??????? case UDP_OPT_MULTICAST_LOOP: +???????? /* The datatype is unsigned char*/ +?????????? cval = (unsigned char) ival; +?????????? arg_sz = sizeof(cval); +?????????? arg_ptr = (char*) &cval; + ??????????? proto = IPPROTO_IP; ??????????? type = IP_MULTICAST_LOOP; ??????????? DEBUGF(("inet_set_opts(%ld): s=%d, IP_MULTICAST_LOOP=%d\r\n", -------------------------------------------------------- Lars S. Jensen ----------------------------------------------------------------------------The information contained in this communication has been classified as: [ X ] Public ----------------------------------------------------------------------------Motorola A/S, Sydvestvej 15, DK-2600 Glostrup, Denmark, CVR No. 10 29 08 13-Denmark ,VAT No: DK10290813, Limited Liability Company, Details of Motorola's subsidiaries in the EU/EEA can be found at: www.motorola.com/legal/euregistrationinfo From fdmanana@REDACTED Wed Apr 21 18:18:12 2010 From: fdmanana@REDACTED (Filipe David Manana) Date: Wed, 21 Apr 2010 17:18:12 +0100 Subject: exporting a new function in prim_file.erl Message-ID: Hello, I'm trying to add a new function to prim_file.erl that will be called by file_io_server.erl. Therefore I export it in the first export macro. This new function happens to have exactly the same interface (arity and arg type, return values) as prim_file:sync/1, so I copied the sync function clause, renamed it, and added the corresponding export. After building and installing OTP, I get an error when calling file:my_func/1: =ERROR REPORT==== 21-Apr-2010::16:30:53 === Error in process <0.35.0> with exit value: {undef,[{prim_file,my_func[{file_descriptor,prim_file,{#Port<0.500>,7}}]},{file_io_server,file_request,2},{file_io_server,server_loop,1}]} file:my_func/1 just calls file_io_server:my_func/1 wich in turn calls prim_file:my_func/1. It seems that prim_file is not exporting my_func. Yet I have an explicit "-define([... sync/1 my_func/1 ...])." The Erlang shell is not recognizing prim_file:my_func/1 (through tab auto completion). My code path also seems to be correct. What am I missing here? thanks, -- Filipe David Manana, 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 rvirding@REDACTED Wed Apr 21 18:26:57 2010 From: rvirding@REDACTED (Robert Virding) Date: Wed, 21 Apr 2010 18:26:57 +0200 Subject: [erlang-patches] exporting a new function in prim_file.erl In-Reply-To: References: Message-ID: Hi Filipe, On 21 April 2010 18:18, Filipe David Manana wrote: > Hello, > > I'm trying to add a new function to prim_file.erl that will be called by > file_io_server.erl. Therefore I export it in the first export macro. > > This new function happens to have exactly the same interface (arity and arg > type, return values) as prim_file:sync/1, so I copied the sync function > clause, renamed it, and added the corresponding export. > > After building and installing OTP, I get an error when calling > file:my_func/1: > > =ERROR REPORT==== 21-Apr-2010::16:30:53 === > Error in process <0.35.0> with exit value: > {undef,[{prim_file,my_func[{file_descriptor,prim_file,{#Port<0.500>,7}}]},{file_io_server,file_request,2},{file_io_server,server_loop,1}]} > > file:my_func/1 just calls file_io_server:my_func/1 wich in turn calls > prim_file:my_func/1. > > It seems that prim_file is not exporting ?my_func. Yet I have an explicit > "-define([... sync/1 my_func/1 ...])." This, -define, is used to define macros, not for exporting functions from a module. It should be: -export(([... sync/1 my_func/1 ...]). There is an export declaration already which exports the old functions. It is perfectly ok to have many export declaration, I use that to cluster various "classes" of exported functions. Robert From fdmanana@REDACTED Wed Apr 21 18:43:41 2010 From: fdmanana@REDACTED (Filipe David Manana) Date: Wed, 21 Apr 2010 17:43:41 +0100 Subject: [erlang-patches] exporting a new function in prim_file.erl In-Reply-To: References: Message-ID: Ups, misspelled it. I do have it in an exports declaration (copy paste from my prim_file.erl) : %%% Interface towards a single file's contents. Uses ?FD_DRV. %% Generic file contents operations -export([open/2, close/1, my_func/1, sync/1, position/2, truncate/1, write/2, pwrite/2, pwrite/3, read/2, read_line/1, pread/2, pread/3, copy/3]). This is why I am finding it very weird. In the shell: 5> lists:member("/opt/dev-otp/lib/erlang/lib/kernel-2.13.5/ebin", code:get_path()). true 6> code:which(prim_file). preloaded 7> prim_file: altname/1 altname/2 close/1 copy/3 del_dir/1 del_dir/2 delete/1 delete/2 get_cwd/0 get_cwd/1 get_cwd/2 ipread_s32bu_p32bu/3 list_dir/1 list_dir/2 make_dir/1 make_dir/2 make_link/2 make_link/3 make_symlink/2 make_symlink/3 module_info/0 module_info/1 open/1 open/2 open/3 open_int/4 open_mode/1 open_mode/4 position/2 pread/2 pread/3 pwrite/2 pwrite/3 read/2 read_file/1 read_file/2 read_file_info/1 read_file_info/2 read_line/1 read_link/1 read_link/2 read_link_info/1 read_link_info/2 rename/2 rename/3 set_cwd/1 set_cwd/2 start/0 stop/1 sync/1 truncate/1 write/2 write_file/2 write_file_info/2 write_file_info/3 7> Are preloaded modules different from regular modules? On Wed, Apr 21, 2010 at 5:26 PM, Robert Virding wrote: > Hi Filipe, > > On 21 April 2010 18:18, Filipe David Manana wrote: > > Hello, > > > > I'm trying to add a new function to prim_file.erl that will be called by > > file_io_server.erl. Therefore I export it in the first export macro. > > > > This new function happens to have exactly the same interface (arity and > arg > > type, return values) as prim_file:sync/1, so I copied the sync function > > clause, renamed it, and added the corresponding export. > > > > After building and installing OTP, I get an error when calling > > file:my_func/1: > > > > =ERROR REPORT==== 21-Apr-2010::16:30:53 === > > Error in process <0.35.0> with exit value: > > > {undef,[{prim_file,my_func[{file_descriptor,prim_file,{#Port<0.500>,7}}]},{file_io_server,file_request,2},{file_io_server,server_loop,1}]} > > > > file:my_func/1 just calls file_io_server:my_func/1 wich in turn calls > > prim_file:my_func/1. > > > > It seems that prim_file is not exporting my_func. Yet I have an explicit > > "-define([... sync/1 my_func/1 ...])." > > This, -define, is used to define macros, not for exporting functions > from a module. It should be: > > -export(([... sync/1 my_func/1 ...]). > > There is an export declaration already which exports the old > functions. It is perfectly ok to have many export declaration, I use > that to cluster various "classes" of exported functions. > > Robert > -- Filipe David Manana, 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 fdmanana@REDACTED Wed Apr 21 19:27:55 2010 From: fdmanana@REDACTED (Filipe David Manana) Date: Wed, 21 Apr 2010 18:27:55 +0100 Subject: [erlang-patches] exporting a new function in prim_file.erl In-Reply-To: References: Message-ID: Found the solution. Just need to execute: ./otp_build update_preloaded after doing make, and before make install cheers On Wed, Apr 21, 2010 at 5:43 PM, Filipe David Manana wrote: > > Ups, misspelled it. > I do have it in an exports declaration (copy paste from my prim_file.erl) : > > %%% Interface towards a single file's contents. Uses ?FD_DRV. > > %% Generic file contents operations > -export([open/2, close/1, my_func/1, sync/1, position/2, truncate/1, > write/2, pwrite/2, pwrite/3, read/2, read_line/1, pread/2, pread/3, > copy/3]). > > This is why I am finding it very weird. > > In the shell: > > 5> lists:member("/opt/dev-otp/lib/erlang/lib/kernel-2.13.5/ebin", > code:get_path()). > true > 6> code:which(prim_file). > preloaded > 7> prim_file: > altname/1 altname/2 close/1 > copy/3 del_dir/1 del_dir/2 > delete/1 delete/2 get_cwd/0 > get_cwd/1 get_cwd/2 ipread_s32bu_p32bu/3 > list_dir/1 list_dir/2 make_dir/1 > make_dir/2 make_link/2 make_link/3 > make_symlink/2 make_symlink/3 module_info/0 > module_info/1 open/1 open/2 > open/3 open_int/4 open_mode/1 > open_mode/4 position/2 pread/2 > pread/3 pwrite/2 pwrite/3 > read/2 read_file/1 read_file/2 > read_file_info/1 read_file_info/2 read_line/1 > read_link/1 read_link/2 read_link_info/1 > read_link_info/2 rename/2 rename/3 > set_cwd/1 set_cwd/2 start/0 > stop/1 sync/1 truncate/1 > write/2 write_file/2 write_file_info/2 > write_file_info/3 > 7> > > Are preloaded modules different from regular modules? > > > On Wed, Apr 21, 2010 at 5:26 PM, Robert Virding wrote: > >> Hi Filipe, >> >> On 21 April 2010 18:18, Filipe David Manana wrote: >> > Hello, >> > >> > I'm trying to add a new function to prim_file.erl that will be called by >> > file_io_server.erl. Therefore I export it in the first export macro. >> > >> > This new function happens to have exactly the same interface (arity and >> arg >> > type, return values) as prim_file:sync/1, so I copied the sync function >> > clause, renamed it, and added the corresponding export. >> > >> > After building and installing OTP, I get an error when calling >> > file:my_func/1: >> > >> > =ERROR REPORT==== 21-Apr-2010::16:30:53 === >> > Error in process <0.35.0> with exit value: >> > >> {undef,[{prim_file,my_func[{file_descriptor,prim_file,{#Port<0.500>,7}}]},{file_io_server,file_request,2},{file_io_server,server_loop,1}]} >> > >> > file:my_func/1 just calls file_io_server:my_func/1 wich in turn calls >> > prim_file:my_func/1. >> > >> > It seems that prim_file is not exporting my_func. Yet I have an >> explicit >> > "-define([... sync/1 my_func/1 ...])." >> >> This, -define, is used to define macros, not for exporting functions >> from a module. It should be: >> >> -export(([... sync/1 my_func/1 ...]). >> >> There is an export declaration already which exports the old >> functions. It is perfectly ok to have many export declaration, I use >> that to cluster various "classes" of exported functions. >> >> Robert >> > > > > -- > Filipe David Manana, > 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." > > -- Filipe David Manana, 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 Wed Apr 21 20:26:18 2010 From: vinoski@REDACTED (Steve Vinoski) Date: Wed, 21 Apr 2010 14:26:18 -0400 Subject: fix for open_port env vars with trailing '=' characters Message-ID: Passing {env, Env} to open_port with an environment variable value containing a trailing '=' character results in the variable not being set into the environment of the new process. Affects only UNIX as far as I can see. Here's a fix: git fetch git://github.com/vinoski/otp.git env_with_equal_sign For more details, here's the full commit message: http://github.com/vinoski/otp/commit/0a6db8663b5558c152a351075bff296733bd3a0d --steve From bgustavsson@REDACTED Thu Apr 22 21:45:42 2010 From: bgustavsson@REDACTED (=?UTF-8?Q?Bj=C3=B6rn_Gustavsson?=) Date: Thu, 22 Apr 2010 21:45:42 +0200 Subject: [erlang-patches] fix for open_port env vars with trailing '=' characters In-Reply-To: References: Message-ID: On Wed, Apr 21, 2010 at 8:26 PM, Steve Vinoski wrote: > Passing {env, Env} to open_port with an environment variable value > containing a trailing '=' character results in the variable not being > set into the environment of the new process. Affects only UNIX as far > as I can see. Here's a fix: > > git fetch git://github.com/vinoski/otp.git env_with_equal_sign > > For more details, here's the full commit message: > > http://github.com/vinoski/otp/commit/0a6db8663b5558c152a351075bff296733bd3a0d Thanks! Included in 'pu'. -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From fdmanana@REDACTED Fri Apr 23 00:58:32 2010 From: fdmanana@REDACTED (Filipe David Manana) Date: Thu, 22 Apr 2010 23:58:32 +0100 Subject: how to properly submit a patch Message-ID: Hello, I have just made some modifs to prim_file.erl. In order to rebuild the preloaded modules (for testing my changes), I ran "./otp_build update_preloaded" which not only rebuilds the preloaded modules but also commits plenty of things into my git repo. Now, I want to submit a patch with my modifs, should I send a patch that includes the changes committed by "./otp_build update_preloaded", or only the really important diff? thanks -- Filipe David Manana, 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 fdmanana@REDACTED Fri Apr 23 01:14:45 2010 From: fdmanana@REDACTED (Filipe David Manana) Date: Fri, 23 Apr 2010 00:14:45 +0100 Subject: Patch to add a wrapper around the POSIX syscall "fdatasync" Message-ID: Hello, I created a patch which allows one to call the POSIX system call "fdatasync". It adds a new function to the file module: file:datasync/1. This syscall is similar to fsync except that it doesn't flush the file's metadata (like access time for e.g.) but only its data. Therefore it avoids extra disk seek and disk write operations. It's used by several DBMSs, such as MySQL and SQLite, where it makes a significant difference compared to fsync under heavy write conditions. Some links: http://linux.die.net/man/2/fdatasync http://bazaar.launchpad.net/~mysql/mysql-server/mysql-5.1-telco-6.1/annotate/head%3A/mysys/my_sync.c#L61 (MySQL source) The new exposed function simply calls fsync if the host OS doesn't implement fdatasync. The patch can be found at: http://github.com/fdmanana/otp/commit/1006fb7efafe634165214f065dd8cff05a5d10c0 If something doesn't comply with your guidelines/conventions for accepting a patch, please let me know it and I'll do the necessary adaptations. cheers -- Filipe David Manana, 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 bgustavsson@REDACTED Fri Apr 23 07:33:26 2010 From: bgustavsson@REDACTED (=?UTF-8?Q?Bj=C3=B6rn_Gustavsson?=) Date: Fri, 23 Apr 2010 07:33:26 +0200 Subject: [erlang-patches] Patch to add a wrapper around the POSIX syscall "fdatasync" In-Reply-To: References: Message-ID: On Fri, Apr 23, 2010 at 1:14 AM, Filipe David Manana wrote: > The patch can be found at: > > http://github.com/fdmanana/otp/commit/1006fb7efafe634165214f065dd8cff05a5d10c0 > > If something doesn't comply with your guidelines/conventions for accepting a > patch, please let me know it and I'll do the necessary adaptations. Thanks! Included in 'pu', with a slight adjustment to the commit message to conform to our guidelines. For future submissions, please include in your email a line similar to: git fetch git://github.com/fdmanana/otp.git fdatasync to help me quickly fetch your branch. -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From jeraymond@REDACTED Fri Apr 23 22:56:23 2010 From: jeraymond@REDACTED (Jeremy Raymond) Date: Fri, 23 Apr 2010 16:56:23 -0400 Subject: Fix searching for source files in cover:analyse_to_file/* Message-ID: Hi, I've patched cover to search for source files in the location referenced in the .beam file instead of just in the .beam directory and in the ../src relative dir. This is based upon a patch by Thomas Arts posted to erlang-questions several years ago that never made it into otp ( http://www.erlang.org/cgi-bin/ezmlm-cgi/4/29048). git fetch git://github.com/jeraymond/otp.git cover_src_path_fix -- Jeremy Raymond From bgustavsson@REDACTED Sat Apr 24 09:26:50 2010 From: bgustavsson@REDACTED (=?UTF-8?Q?Bj=C3=B6rn_Gustavsson?=) Date: Sat, 24 Apr 2010 09:26:50 +0200 Subject: [erlang-patches] Fix searching for source files in cover:analyse_to_file/* In-Reply-To: References: Message-ID: On Fri, Apr 23, 2010 at 10:56 PM, Jeremy Raymond wrote: > I've patched cover to search for source files in the location referenced in > the .beam file instead of just in the .beam directory and in the ../src > relative dir. This is based upon a patch by Thomas Arts posted to > erlang-questions several years ago that never made it into otp ( > http://www.erlang.org/cgi-bin/ezmlm-cgi/4/29048). > > git fetch git://github.com/jeraymond/otp.git cover_src_path_fix Thanks! Your patch removes the export of three documented functions. Why? The code itself is easy to follow and looks reasonable (and the test suite has been updated!), but the spacing is inconsistent both in the code itself and compared to the rest of the module. There should a space after commas in function calls, and spaces around list comprehension generators (" <- "), but list matching should be written without spaces like "[Main|_]". Also, "_" variables in the last clause of a case should be avoided if the value is known. So it should be: case filelib:is_file(Main) of true -> ...; false -> ... end. and so on for all the other "_" variables. I would also recommend that path_in_beam simply returns 'error' instead of an error tuple whose value is never used. -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From jeraymond@REDACTED Sat Apr 24 15:24:11 2010 From: jeraymond@REDACTED (Jeremy Raymond) Date: Sat, 24 Apr 2010 09:24:11 -0400 Subject: [erlang-patches] Fix searching for source files in cover:analyse_to_file/* In-Reply-To: References: Message-ID: Hello, My mistake with the exports, I'd seen it as the functions being exported twice but really it was different spellings of the functions: analyse with an S vs analyze with a Z. It looks like analyse with the S are the documented functions... however I better restore it, someone must be using the Z versions. I'll clean up the code as per you suggestions below and post an update. -- Jeremy Raymond 2010/4/24 Bj?rn Gustavsson > On Fri, Apr 23, 2010 at 10:56 PM, Jeremy Raymond > wrote: > > I've patched cover to search for source files in the location referenced > in > > the .beam file instead of just in the .beam directory and in the ../src > > relative dir. This is based upon a patch by Thomas Arts posted to > > erlang-questions several years ago that never made it into otp ( > > http://www.erlang.org/cgi-bin/ezmlm-cgi/4/29048). > > > > git fetch git://github.com/jeraymond/otp.git cover_src_path_fix > > Thanks! > > Your patch removes the export of three documented functions. Why? > > The code itself is easy to follow and looks reasonable (and the test > suite has been updated!), but the spacing is inconsistent both in the > code itself and compared to the rest of the module. There should a > space after commas in function calls, and spaces around list > comprehension generators (" <- "), but list matching > should be written without spaces like "[Main|_]". > > Also, "_" variables in the last clause of a case should be avoided > if the value is known. So it should be: > > case filelib:is_file(Main) of > true -> > ...; > false -> > ... > end. > > and so on for all the other "_" variables. > > I would also recommend that path_in_beam simply returns > 'error' instead of an error tuple whose value is never used. > > -- > Bj?rn Gustavsson, Erlang/OTP, Ericsson AB > From jeraymond@REDACTED Sat Apr 24 21:24:18 2010 From: jeraymond@REDACTED (Jeremy Raymond) Date: Sat, 24 Apr 2010 15:24:18 -0400 Subject: [erlang-patches] Fix searching for source files in cover:analyse_to_file/* In-Reply-To: References: Message-ID: I've made the suggested changes. Please take a look and let me know if there is anything else. Thanks! git fetch git://github.com/jeraymond/otp.git cover_src_path_fix -- Jeremy Raymond 2010/4/24 Jeremy Raymond > Hello, > > My mistake with the exports, I'd seen it as the functions being exported > twice but really it was different spellings of the functions: analyse with > an S vs analyze with a Z. It looks like analyse with the S are the > documented functions... however I better restore it, someone must be using > the Z versions. > > I'll clean up the code as per you suggestions below and post an update. > > -- > Jeremy Raymond > > > 2010/4/24 Bj?rn Gustavsson > > On Fri, Apr 23, 2010 at 10:56 PM, Jeremy Raymond >> wrote: >> > I've patched cover to search for source files in the location referenced >> in >> > the .beam file instead of just in the .beam directory and in the ../src >> > relative dir. This is based upon a patch by Thomas Arts posted to >> > erlang-questions several years ago that never made it into otp ( >> > http://www.erlang.org/cgi-bin/ezmlm-cgi/4/29048). >> > >> > git fetch git://github.com/jeraymond/otp.git cover_src_path_fix >> >> Thanks! >> >> Your patch removes the export of three documented functions. Why? >> >> The code itself is easy to follow and looks reasonable (and the test >> suite has been updated!), but the spacing is inconsistent both in the >> code itself and compared to the rest of the module. There should a >> space after commas in function calls, and spaces around list >> comprehension generators (" <- "), but list matching >> should be written without spaces like "[Main|_]". >> >> Also, "_" variables in the last clause of a case should be avoided >> if the value is known. So it should be: >> >> case filelib:is_file(Main) of >> true -> >> ...; >> false -> >> ... >> end. >> >> and so on for all the other "_" variables. >> >> I would also recommend that path_in_beam simply returns >> 'error' instead of an error tuple whose value is never used. >> >> -- >> Bj?rn Gustavsson, Erlang/OTP, Ericsson AB >> > > From fdmanana@REDACTED Sun Apr 25 22:20:36 2010 From: fdmanana@REDACTED (Filipe David Manana) Date: Sun, 25 Apr 2010 21:20:36 +0100 Subject: patch to add a wrapper around the syscall posix_fadvise Message-ID: Hi, The following patch adds a new function - file:advise/4 It's a wrapper around the POSIX syscall posix_fadvise, and does nothing (always returns 'ok') on Windows. This syscall allows one to declare the access pattern for a file's data. Useful for many disk IO bound tasks, as it allows the underlying OS to adopt a better caching strategy for the specified access pattern. Man page: http://linux.die.net/man/2/posix_fadvise I assigned the value 31 to the FILE_ADVISE constant because I assigned the value 30 to a previously submitted patch (which adds a wrapper around the syscall fdatasync). Branch posix_fadvise in my github account: git fetch git://github.com/fdmanana/otp.git posix_fadvise Documentation and tests are included. Let me know if all is fine. cheers -- Filipe David Manana, 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 bgustavsson@REDACTED Mon Apr 26 13:22:24 2010 From: bgustavsson@REDACTED (=?UTF-8?Q?Bj=C3=B6rn_Gustavsson?=) Date: Mon, 26 Apr 2010 13:22:24 +0200 Subject: [erlang-patches] patch to add a wrapper around the syscall posix_fadvise In-Reply-To: References: Message-ID: On Sun, Apr 25, 2010 at 10:20 PM, Filipe David Manana wrote: > > git fetch git://github.com/fdmanana/otp.git posix_fadvise Thank! I have created a new branch called fm/file-operations that include your previous fdatasync branch and this one, since it will be easier for us to review and graduate both changes together. This branch will be included in the 'pu' branch. > Documentation and tests are included. Let me know if all is fine. Looks reasonable to me. Someone else in the Erlang/OTP team will review the branch and decide whether to graduate it. -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From bgustavsson@REDACTED Mon Apr 26 13:25:01 2010 From: bgustavsson@REDACTED (=?UTF-8?Q?Bj=C3=B6rn_Gustavsson?=) Date: Mon, 26 Apr 2010 13:25:01 +0200 Subject: [erlang-patches] Fix searching for source files in cover:analyse_to_file/* In-Reply-To: References: Message-ID: 2010/4/24 Jeremy Raymond : > I've made the suggested changes. Please take a look and let me know if there > is anything else. Thanks! > > git fetch git://github.com/jeraymond/otp.git cover_src_path_fix Thanks! Looks much better. I will include it in 'pu' with only a minor change - I will replace filename:join([Dir,Path]) with filename:join(Dir, Path) -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From jeraymond@REDACTED Mon Apr 26 14:00:07 2010 From: jeraymond@REDACTED (Jeremy Raymond) Date: Mon, 26 Apr 2010 08:00:07 -0400 Subject: [erlang-patches] Fix searching for source files in cover:analyse_to_file/* In-Reply-To: References: Message-ID: Great thanks Bj?rn. -- Jeremy Raymond 2010/4/26 Bj?rn Gustavsson > 2010/4/24 Jeremy Raymond : > > I've made the suggested changes. Please take a look and let me know if > there > > is anything else. Thanks! > > > > git fetch git://github.com/jeraymond/otp.git cover_src_path_fix > > Thanks! Looks much better. I will include it in 'pu' with only a minor > change - I will replace > > filename:join([Dir,Path]) > > with > > filename:join(Dir, Path) > > -- > Bj?rn Gustavsson, Erlang/OTP, Ericsson AB > From nicolas@REDACTED Thu Apr 29 16:53:27 2010 From: nicolas@REDACTED (Nicolas Thauvin) Date: Thu, 29 Apr 2010 16:53:27 +0200 Subject: Problem with httpc_cookie:fix_netscape_cookie/2 Message-ID: Hi all, I found an oddity while using httpc with cookies enabled. A well-known web site replies with this header: {"set-cookie","visit=G; Expires=Tue, 17-May-2078 17:34:56 GMT; Path=/"}, httpc_cookie:fix_netscape_cookie/2 is not pleased when that happens. It does not see the upper case 'E' of 'Expires', and cannot "fix" the cookie. Here is the patch I used to make it work. -- Nicolas -------------- next part -------------- A non-text attachment was scrubbed... Name: httpc_cookie.patch Type: application/octet-stream Size: 575 bytes Desc: not available URL: From nicolas@REDACTED Thu Apr 29 17:00:29 2010 From: nicolas@REDACTED (Nicolas Thauvin) Date: Thu, 29 Apr 2010 17:00:29 +0200 Subject: http_util:convert_netscapecookie_date/1 Message-ID: Hi again, Yet another patch proposal to properly decode cookies ;) This time, the faulty header is {"set-cookie", "NSC_MC_QH_MFP=e242089229a0;expires=Thu, 29-Apr-10 14:53:38 GMT;path=/"}]} When trying to decode the date, there is a brutal function clause in http_util:convert_netscapecookie_date/1 (reason: the year has two digits, the code expects four) The patch proposal is attached. Best regards, -- Nicolas -------------- next part -------------- A non-text attachment was scrubbed... Name: http_util.patch Type: application/octet-stream Size: 540 bytes Desc: not available URL: From michael.santos@REDACTED Fri Apr 30 18:22:11 2010 From: michael.santos@REDACTED (Michael Santos) Date: Fri, 30 Apr 2010 12:22:11 -0400 Subject: [PATCH] Support opening files in exclusive mode Message-ID: <20100430162211.GA12819@ecn.lan> Add an option that atomically tests for the existence of a file and creates it if the file does not exist, by passing the O_EXCL flag to open() on Unix and CREATE_NEW flag on Windows. Support for O_EXCL varies across platforms and filesystems. {ok, Fd} = file:open("/tmp/foo", [write,exclusive]), {error, eexist} = file:open("/tmp/foo", [write,exclusive]). --- erts/emulator/drivers/common/erl_efile.h | 3 ++- erts/emulator/drivers/unix/unix_efile.c | 3 +++ erts/emulator/drivers/win32/win_efile.c | 3 +++ erts/preloaded/src/prim_file.erl | 5 ++++- lib/kernel/doc/src/file.xml | 8 +++++++- lib/kernel/src/file.erl | 2 +- lib/kernel/test/file_SUITE.erl | 20 ++++++++++++++++++-- lib/kernel/test/prim_file_SUITE.erl | 20 ++++++++++++++++++-- 8 files changed, 56 insertions(+), 8 deletions(-) diff --git a/erts/emulator/drivers/common/erl_efile.h b/erts/emulator/drivers/common/erl_efile.h index 9aa941e..d2ef9c0 100644 --- a/erts/emulator/drivers/common/erl_efile.h +++ b/erts/emulator/drivers/common/erl_efile.h @@ -32,7 +32,8 @@ #define EFILE_MODE_READ_WRITE 3 #define EFILE_MODE_APPEND 4 #define EFILE_COMPRESSED 8 -#define EFILE_NO_TRUNCATE 16 /* Special for reopening on VxWorks */ +#define EFILE_MODE_EXCL 16 +#define EFILE_NO_TRUNCATE 32 /* Special for reopening on VxWorks */ /* * Seek modes for efile_seek(). diff --git a/erts/emulator/drivers/unix/unix_efile.c b/erts/emulator/drivers/unix/unix_efile.c index d395b68..6171272 100644 --- a/erts/emulator/drivers/unix/unix_efile.c +++ b/erts/emulator/drivers/unix/unix_efile.c @@ -751,6 +751,9 @@ efile_openfile(Efile_error* errInfo, /* Where to return error codes. */ #endif } + if (flags & EFILE_MODE_EXCL) { + mode |= O_EXCL; + } #ifdef VXWORKS if (*name != '/') { diff --git a/erts/emulator/drivers/win32/win_efile.c b/erts/emulator/drivers/win32/win_efile.c index 89aaad3..de5cd21 100644 --- a/erts/emulator/drivers/win32/win_efile.c +++ b/erts/emulator/drivers/win32/win_efile.c @@ -689,6 +689,9 @@ Sint64* pSize; /* Where to store the size of the file. */ if (flags & EFILE_MODE_APPEND) { crFlags = OPEN_ALWAYS; } + if (flags & EFILE_MODE_EXCL) { + crFlags = CREATE_NEW; + } fd = CreateFile(name, access, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, crFlags, FILE_ATTRIBUTE_NORMAL, NULL); diff --git a/erts/preloaded/src/prim_file.erl b/erts/preloaded/src/prim_file.erl index 43e6f6c..035ff3e 100644 --- a/erts/preloaded/src/prim_file.erl +++ b/erts/preloaded/src/prim_file.erl @@ -114,9 +114,10 @@ -define(EFILE_MODE_READ_WRITE, 3). -define(EFILE_MODE_APPEND, 4). -define(EFILE_COMPRESSED, 8). +-define(EFILE_MODE_EXCL, 16). %% Use this mask to get just the mode bits to be passed to the driver. --define(EFILE_MODE_MASK, 15). +-define(EFILE_MODE_MASK, 31). %% Seek modes for the driver's seek function. -define(EFILE_SEEK_SET, 0). @@ -918,6 +919,8 @@ open_mode([compressed|Rest], Mode, Portopts, Setopts) -> open_mode([append|Rest], Mode, Portopts, Setopts) -> open_mode(Rest, Mode bor ?EFILE_MODE_APPEND bor ?EFILE_MODE_WRITE, Portopts, Setopts); +open_mode([exclusive|Rest], Mode, Portopts, Setopts) -> + open_mode(Rest, Mode bor ?EFILE_MODE_EXCL, Portopts, Setopts); open_mode([delayed_write|Rest], Mode, Portopts, Setopts) -> open_mode([{delayed_write, 64*1024, 2000}|Rest], Mode, Portopts, Setopts); diff --git a/lib/kernel/doc/src/file.xml b/lib/kernel/doc/src/file.xml index 50f9722..eed92d2 100644 --- a/lib/kernel/doc/src/file.xml +++ b/lib/kernel/doc/src/file.xml @@ -584,7 +584,7 @@ f.txt: {person, "kalle", 25}. Filename = name() Modes = [Mode] -  Mode = read | write | append | raw | binary | {delayed_write, Size, Delay} | delayed_write | {read_ahead, Size} | read_ahead | compressed +  Mode = read | write | append | exclusive | raw | binary | {delayed_write, Size, Delay} | delayed_write | {read_ahead, Size} | read_ahead | compressed   Size = Delay = int() IoDevice = io_device() Reason = ext_posix() | system_limit @@ -611,6 +611,12 @@ f.txt: {person, "kalle", 25}. file opened with append will take place at the end of the file.

+ exclusive + +

The file, when opened for writing, is created if it + does not exist. If the file exists, open will return + {error, eexist}.

+
raw

The raw option allows faster access to a file, diff --git a/lib/kernel/src/file.erl b/lib/kernel/src/file.erl index 46ffa9d..419d8db 100644 --- a/lib/kernel/src/file.erl +++ b/lib/kernel/src/file.erl @@ -81,7 +81,7 @@ -type mode() :: 'read' | 'write' | 'append' | 'raw' | 'binary' | {'delayed_write', non_neg_integer(), non_neg_integer()} | 'delayed_write' | {'read_ahead', pos_integer()} | - 'read_ahead' | 'compressed'. + 'read_ahead' | 'compressed' | 'exclusive'. -type name() :: string() | atom() | [name()]. -type posix() :: atom(). -type bindings() :: any(). diff --git a/lib/kernel/test/file_SUITE.erl b/lib/kernel/test/file_SUITE.erl index d01e1f1..b9d57ce 100644 --- a/lib/kernel/test/file_SUITE.erl +++ b/lib/kernel/test/file_SUITE.erl @@ -53,7 +53,7 @@ -export([file_info/1, file_info_basic_file/1, file_info_basic_directory/1, file_info_bad/1, file_info_times/1, file_write_file_info/1]). -export([rename/1, access/1, truncate/1, sync/1, - read_write/1, pread_write/1, append/1]). + read_write/1, pread_write/1, append/1, exclusive/1]). -export([errors/1, e_delete/1, e_rename/1, e_make_dir/1, e_del_dir/1]). -export([otp_5814/1]). @@ -377,7 +377,7 @@ win_cur_dir_1(_Config) -> files(suite) -> [open,pos,file_info,consult,eval,script,truncate,sync]. open(suite) -> [open1,old_modes,new_modes,path_open,close,access,read_write, - pread_write,append,open_errors]. + pread_write,append,open_errors,exclusive]. open1(suite) -> []; open1(doc) -> []; @@ -751,6 +751,22 @@ open_errors(Config) when is_list(Config) -> ?line test_server:timetrap_cancel(Dog), ok. +exclusive(suite) -> []; +exclusive(doc) -> "Test exclusive access to a file."; +exclusive(Config) when is_list(Config) -> + ?line Dog = test_server:timetrap(test_server:seconds(5)), + ?line RootDir = ?config(priv_dir,Config), + ?line NewDir = filename:join(RootDir, + atom_to_list(?MODULE) + ++"_exclusive"), + ?line ok = ?FILE_MODULE:make_dir(NewDir), + ?line Name = filename:join(NewDir, "ex_file.txt"), + ?line {ok, Fd} = ?FILE_MODULE:open(Name, [write, exclusive]), + ?line {error, eexist} = ?FILE_MODULE:open(Name, [write, exclusive]), + ?line ok = ?FILE_MODULE:close(Fd), + ?line test_server:timetrap_cancel(Dog), + ok. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% pos(suite) -> [pos1,pos2]. diff --git a/lib/kernel/test/prim_file_SUITE.erl b/lib/kernel/test/prim_file_SUITE.erl index 860aeec..9f6dd78 100644 --- a/lib/kernel/test/prim_file_SUITE.erl +++ b/lib/kernel/test/prim_file_SUITE.erl @@ -35,7 +35,7 @@ file_write_file_info_a/1, file_write_file_info_b/1]). -export([rename_a/1, rename_b/1, access/1, truncate/1, sync/1, - read_write/1, pread_write/1, append/1]). + read_write/1, pread_write/1, append/1, exclusive/1]). -export([errors/1, e_delete/1, e_rename/1, e_make_dir/1, e_del_dir/1]). -export([compression/1, read_not_really_compressed/1, @@ -380,7 +380,7 @@ win_cur_dir_1(_Config, Handle) -> files(suite) -> [open,pos,file_info,truncate,sync]. open(suite) -> [open1,modes,close,access,read_write, - pread_write,append]. + pread_write,append,exclusive]. open1(suite) -> []; open1(doc) -> []; @@ -605,6 +605,22 @@ append(Config) when is_list(Config) -> ?line test_server:timetrap_cancel(Dog), ok. +exclusive(suite) -> []; +exclusive(doc) -> "Test exclusive access to a file."; +exclusive(Config) when is_list(Config) -> + ?line Dog = test_server:timetrap(test_server:seconds(5)), + ?line RootDir = ?config(priv_dir,Config), + ?line NewDir = filename:join(RootDir, + atom_to_list(?MODULE) + ++"_exclusive"), + ?line ok = ?PRIM_FILE:make_dir(NewDir), + ?line Name = filename:join(NewDir, "ex_file.txt"), + ?line {ok,Fd} = ?PRIM_FILE:open(Name, [write, exclusive]), + ?line {error, eexist} = ?PRIM_FILE:open(Name, [write, exclusive]), + ?line ok = ?PRIM_FILE:close(Fd), + ?line test_server:timetrap_cancel(Dog), + ok. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% pos(suite) -> [pos1,pos2]. -- 1.5.6.4