From eric.pailleau@REDACTED Sun Jun 2 12:06:32 2013 From: eric.pailleau@REDACTED (PAILLEAU Eric) Date: Sun, 02 Jun 2013 12:06:32 +0200 Subject: [erlang-patches] Allow rb to use any io_device/registered name instead of only filename path Message-ID: <51AB1928.3080503@wanadoo.fr> Hello, Report Browser could not accept a file descriptor, for instance given by another application. this is a first patch needed in my wish to add a graphical log browser in observer. git fetch https://github.com/crownedgrouse/otp.git add_fd_usage_in_rb https://github.com/crownedgrouse/otp/compare/erlang:maint...add_fd_usage_in_rb https://github.com/crownedgrouse/otp/compare/erlang:maint...add_fd_usage_in_rb.patch regards From aaron.l.france@REDACTED Sun Jun 2 21:52:46 2013 From: aaron.l.france@REDACTED (Aaron France) Date: Sun, 2 Jun 2013 21:52:46 +0200 Subject: [erlang-patches] erl_tidy option to print to stdout Message-ID: Hi all, I've read the contribution rules and received some cursory guidance from nox in IRC so I hope I don't awaken any wrath from the format. I've added an option to erl_tidy to simply print to stdout. These may seem a trivial thing to want to have in but my use-case is wanting to build intermediary steps around erl_tidy and not simply replace the underlying file. Personally, I want to have this (and I am working on it now that I have patched it in) available to erlang-mode in emacs. So that I can have a save hook for formatting the code properly. Dealing with files is less than stellar but dealing with the unixy stdin/out method is far nicer. I have this set up on: https://github.com/AeroNotix/otp/tree/feat/erl_tidy_print_to_stdout I added the requisite source and added the docs for it in the right areas. Regards, Aaron -------------- next part -------------- An HTML attachment was scrubbed... URL: From eric.pailleau@REDACTED Sun Jun 2 23:00:30 2013 From: eric.pailleau@REDACTED (PAILLEAU Eric) Date: Sun, 02 Jun 2013 23:00:30 +0200 Subject: [erlang-patches] Fix io:xxxx(self()) no return Message-ID: <51ABB26E.2040903@wanadoo.fr> Hello, here is a patch that fix the bug I found. git fetch https://github.com/crownedgrouse/otp.git fix_io_noreturn_with_self_pid https://github.com/crownedgrouse/otp/compare/erlang:maint...fix_io_noreturn_with_self_pid https://github.com/crownedgrouse/otp/compare/erlang:maint...fix_io_noreturn_with_self_pid From n.oxyde@REDACTED Mon Jun 3 01:02:24 2013 From: n.oxyde@REDACTED (Anthony Ramine) Date: Mon, 3 Jun 2013 01:02:24 +0200 Subject: [erlang-patches] [erlang-bugs] Lift limitation to FD_SETSIZE file descriptors on Mac OS X in erl_poll In-Reply-To: <51A8CE85.4060705@erix.ericsson.se> References: <5B66A627-9663-4745-8282-9A4BFAB23229@gmail.com> <5190A402.4090406@erlang.org> <51A5CDD0.3040309@erix.ericsson.se> <719E32DA-731E-4BBD-B073-3A30900BDB63@gmail.com> <51A8CE85.4060705@erix.ericsson.se> Message-ID: <40F80D04-1940-4F9F-B2E9-3D90AA81FAB1@gmail.com> Hello Sverker, Did you try without your improvements? I don't have access to neither Leopard nor Snow Leopard, but judging from a quick search on the Web, there is no reason it wouldn't work on either of them. Regards, -- Anthony Ramine Le 31 mai 2013 ? 18:23, Sverker Eriksson a ?crit : > Anthony Ramine wrote: >> Thanks for the improvements, that's definitely better! >> >> > The patch fails on Leopard and Snow Leopard. It builds and the header files seems to recognize _DARWIN_UNLIMITED_SELECT. > But the emulator crashes at start in a call to select(): > > (gdb) bt > #0 0x92b91ac6 in select$DARWIN_EXTSN () > #1 0x00145eab in erts_sys_main_thread () at sys/unix/sys.c:2989 > #2 0x00028171 in erl_start (argc=, argv=0xbffff188) at beam/erl_init.c:1679 > #3 0xbffff36b in ?? () > #4 0x6c2f0074 in ?? () > > > I tried to add _DARWIN_UNLIMITED_SELECT to sys/unix/sys.c (where the crashing call is made) > but that made no difference. > > > /Sverker > From fredrik@REDACTED Mon Jun 3 09:09:50 2013 From: fredrik@REDACTED (Fredrik) Date: Mon, 3 Jun 2013 09:09:50 +0200 Subject: [erlang-patches] Allow rb to use any io_device/registered name instead of only filename path In-Reply-To: <51AB1928.3080503@wanadoo.fr> References: <51AB1928.3080503@wanadoo.fr> Message-ID: <51AC413E.20907@erlang.org> On 06/02/2013 12:06 PM, PAILLEAU Eric wrote: > Hello, > Report Browser could not accept a file descriptor, > for instance given by another application. > this is a first patch needed in my wish to > add a graphical log browser in observer. > > git fetch https://github.com/crownedgrouse/otp.git add_fd_usage_in_rb > > https://github.com/crownedgrouse/otp/compare/erlang:maint...add_fd_usage_in_rb > > https://github.com/crownedgrouse/otp/compare/erlang:maint...add_fd_usage_in_rb.patch > > regards > > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches Hello Eric, I've fetched your branch, and it should be visible in the 'pu' branch shortly. I had to rebase your patch on maint. You had merged maint into your patch, and you should not do that ;) -- BR Fredrik Gustafsson Erlang OTP Team From fredrik@REDACTED Mon Jun 3 09:28:17 2013 From: fredrik@REDACTED (Fredrik) Date: Mon, 3 Jun 2013 09:28:17 +0200 Subject: [erlang-patches] erl_tidy option to print to stdout In-Reply-To: References: Message-ID: <51AC4591.5060706@erlang.org> On 06/02/2013 09:52 PM, Aaron France wrote: > Hi all, > > I've read the contribution rules and received some cursory guidance > from nox in IRC so I hope I don't awaken any wrath from the format. > > I've added an option to erl_tidy to simply print to stdout. These may > seem a trivial thing to want to have in but my use-case is wanting to > build intermediary steps around erl_tidy and not simply replace the > underlying file. > > Personally, I want to have this (and I am working on it now that I > have patched it in) available to erlang-mode in emacs. So that I can > have a save hook for formatting the code properly. Dealing with files > is less than stellar but dealing with the unixy stdin/out method is > far nicer. > > I have this set up on: > https://github.com/AeroNotix/otp/tree/feat/erl_tidy_print_to_stdout > > I added the requisite source and added the docs for it in the right areas. > > Regards, > Aaron > > > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches Hello Aaron, I've fetched your patch and it should be visible in the 'pu' branch shortly. Thanks, -- BR Fredrik Gustafsson Erlang OTP Team -------------- next part -------------- An HTML attachment was scrubbed... URL: From fredrik@REDACTED Mon Jun 3 09:32:06 2013 From: fredrik@REDACTED (Fredrik) Date: Mon, 3 Jun 2013 09:32:06 +0200 Subject: [erlang-patches] Fix io:xxxx(self()) no return In-Reply-To: <51ABB26E.2040903@wanadoo.fr> References: <51ABB26E.2040903@wanadoo.fr> Message-ID: <51AC4676.6060502@erlang.org> On 06/02/2013 11:00 PM, PAILLEAU Eric wrote: > Hello, > here is a patch that fix the bug I found. > > git fetch https://github.com/crownedgrouse/otp.git > fix_io_noreturn_with_self_pid > > https://github.com/crownedgrouse/otp/compare/erlang:maint...fix_io_noreturn_with_self_pid > > https://github.com/crownedgrouse/otp/compare/erlang:maint...fix_io_noreturn_with_self_pid > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches Hello Eric, I've fetched your patch and it should be visible in the 'pu' branch shortly. Thanks, -- BR Fredrik Gustafsson Erlang OTP Team From stefan.zegenhagen@REDACTED Mon Jun 3 11:17:06 2013 From: stefan.zegenhagen@REDACTED (Stefan Zegenhagen) Date: Mon, 03 Jun 2013 11:17:06 +0200 Subject: [erlang-patches] Fix io:xxxx(self()) no return In-Reply-To: <51ABB26E.2040903@wanadoo.fr> References: <51ABB26E.2040903@wanadoo.fr> Message-ID: <1370251026.3947.38.camel@ax-sze> Dear Eric, > here is a patch that fix the bug I found. > > git fetch https://github.com/crownedgrouse/otp.git > fix_io_noreturn_with_self_pid I would like to note that there might be cases where group_leader() =:= self() In that case, your patch would cause an infinite loop. Please note that the pid passed to io:xxx() should be the pid of an I/O server that speaks the I/O protocol. The io:xxx() functions are not meant to be passed *ANY* pid. It surely is bad to have a process lock up easily just by calling io:xxx(self(), ...), but I'd rather prefer to return {error, enotsup} in that case. The caller should probably do the call to group_leader() if it needs to. Kind regards, -- Dr. Stefan Zegenhagen arcutronix GmbH Garbsener Landstr. 10 30419 Hannover Germany Tel: +49 511 277-2734 Fax: +49 511 277-2709 Email: stefan.zegenhagen@REDACTED Web: www.arcutronix.com *Synchronize the Ethernet* General Managers: Dipl. Ing. Juergen Schroeder, Dr. Josef Gfrerer - Legal Form: GmbH, Registered office: Hannover, HRB 202442, Amtsgericht Hannover; Ust-Id: DE257551767. Please consider the environment before printing this message. From eric.pailleau@REDACTED Mon Jun 3 14:58:03 2013 From: eric.pailleau@REDACTED (Eric Pailleau) Date: Mon, 03 Jun 2013 14:58:03 +0200 Subject: [erlang-patches] Fix io:xxxx(self()) no return Message-ID: ? Envoy? depuis mon mobile ? Eric Eric Pailleau a ?crit?: >hello stefan, >may be i miss something, but the case you are mentioning would make trouble in the code before my patch, either. >may be the real ?problem? is the lack of type io_device and related guard function is_iodevice()... >regards > >? Envoy? depuis mon mobile ? Eric From eric.pailleau@REDACTED Mon Jun 3 14:59:24 2013 From: eric.pailleau@REDACTED (Eric Pailleau) Date: Mon, 03 Jun 2013 14:59:24 +0200 Subject: [erlang-patches] Fix io:xxxx(self()) no return Message-ID: Cc ? Envoy? depuis mon mobile ? Eric Eric Pailleau a ?crit?: >hello stefan, >may be i miss something, but the case you are mentioning would make trouble in the code before my patch, either. >may be the real ?problem? is the lack of type io_device and related guard function is_iodevice()... >regards > >? Envoy? depuis mon mobile ? Eric From fredrik@REDACTED Tue Jun 4 09:13:31 2013 From: fredrik@REDACTED (Fredrik) Date: Tue, 4 Jun 2013 09:13:31 +0200 Subject: [erlang-patches] Allow rb to use any io_device/registered name instead of only filename path In-Reply-To: <51AB1928.3080503@wanadoo.fr> References: <51AB1928.3080503@wanadoo.fr> Message-ID: <51AD939B.80006@erlang.org> On 06/02/2013 12:06 PM, PAILLEAU Eric wrote: > Hello, > Report Browser could not accept a file descriptor, > for instance given by another application. > this is a first patch needed in my wish to > add a graphical log browser in observer. > > git fetch https://github.com/crownedgrouse/otp.git add_fd_usage_in_rb > > https://github.com/crownedgrouse/otp/compare/erlang:maint...add_fd_usage_in_rb > > https://github.com/crownedgrouse/otp/compare/erlang:maint...add_fd_usage_in_rb.patch > > regards > > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches Hello Eric, Your patch is failing the following testcases: Application: SASL, Suite: rb_SUITE, Testcase: list; Application: SASL, Suite: rb_SUITE, Testcase: rescan -- BR Fredrik Gustafsson Erlang OTP Team From Aleksander.Nycz@REDACTED Tue Jun 4 10:35:59 2013 From: Aleksander.Nycz@REDACTED (Aleksander Nycz) Date: Tue, 04 Jun 2013 10:35:59 +0200 Subject: [erlang-patches] Add info_port function to export in diameter_service module Message-ID: <51ADA6EF.2060000@comarch.pl> Hello, Could you add function info_port/1 to export in diameter_service module? %% towards diameter -export([subscribe/1, unsubscribe/1, services/0, info/2, info_port/1]). This funciton gets PID and returns connection details between two diameter peers (IP addresses and ports) I must use this function in pick_peer diameter callback to obtain proper peer to send ASR requests. Regards Aleksadner Nycz -- Aleksander Nycz Senior Software Engineer Telco_021 BSS R&D Comarch SA Phone: +48 12 646 1216 Mobile: +48 691 464 275 website: www.comarch.pl -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2182 bytes Desc: Kryptograficzna sygnatura S/MIME URL: From eric.pailleau@REDACTED Tue Jun 4 14:25:53 2013 From: eric.pailleau@REDACTED (Eric Pailleau) Date: Tue, 04 Jun 2013 14:25:53 +0200 Subject: [erlang-patches] Allow rb to use any io_device/registered name instead of only filename path Message-ID: hello Fredrik, this is due to the fact that with the patch the list() is now redirect to the log file if specified. not the case before. so i suppose the best way to deal is to export another function to do this, for instance rb:log_list() and leave list() behaviour unchanged... OTP team advice on this would be appreciated. by the way, I have to think in running test cases before any commit... sorry ! regards ? Envoy? depuis mon mobile ? Eric Fredrik a ?crit?: >On 06/02/2013 12:06 PM, PAILLEAU Eric wrote: >> Hello, >> Report Browser could not accept a file descriptor, >> for instance given by another application. >> this is a first patch needed in my wish to >> add a graphical log browser in observer. >> >> git fetch https://github.com/crownedgrouse/otp.git add_fd_usage_in_rb >> >> https://github.com/crownedgrouse/otp/compare/erlang:maint...add_fd_usage_in_rb >> >> https://github.com/crownedgrouse/otp/compare/erlang:maint...add_fd_usage_in_rb.patch >> >> regards >> >> _______________________________________________ >> erlang-patches mailing list >> erlang-patches@REDACTED >> http://erlang.org/mailman/listinfo/erlang-patches >Hello Eric, >Your patch is failing the following testcases: >Application: SASL, Suite: rb_SUITE, Testcase: list; >Application: SASL, Suite: rb_SUITE, Testcase: rescan > >-- > >BR Fredrik Gustafsson >Erlang OTP Team > From fredrik@REDACTED Tue Jun 4 14:29:52 2013 From: fredrik@REDACTED (Fredrik) Date: Tue, 4 Jun 2013 14:29:52 +0200 Subject: [erlang-patches] Allow rb to use any io_device/registered name instead of only filename path In-Reply-To: References: Message-ID: <51ADDDC0.1040706@erlang.org> On 06/04/2013 02:25 PM, Eric Pailleau wrote: > hello Fredrik, > this is due to the fact that with the patch the list() is now redirect to the log file if specified. not the case before. so i suppose the best way to deal is to export another function to do this, for instance rb:log_list() and leave list() behaviour unchanged... OTP team advice on this would be appreciated. > by the way, I have to think in running test cases before any commit... sorry ! > regards > > > ? Envoy? depuis mon mobile ? Eric > > Fredrik a ?crit : > >> On 06/02/2013 12:06 PM, PAILLEAU Eric wrote: >>> Hello, >>> Report Browser could not accept a file descriptor, >>> for instance given by another application. >>> this is a first patch needed in my wish to >>> add a graphical log browser in observer. >>> >>> git fetch https://github.com/crownedgrouse/otp.git add_fd_usage_in_rb >>> >>> https://github.com/crownedgrouse/otp/compare/erlang:maint...add_fd_usage_in_rb >>> >>> https://github.com/crownedgrouse/otp/compare/erlang:maint...add_fd_usage_in_rb.patch >>> >>> regards >>> >>> _______________________________________________ >>> erlang-patches mailing list >>> erlang-patches@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-patches >> Hello Eric, >> Your patch is failing the following testcases: >> Application: SASL, Suite: rb_SUITE, Testcase: list; >> Application: SASL, Suite: rb_SUITE, Testcase: rescan >> >> -- >> >> BR Fredrik Gustafsson >> Erlang OTP Team >> Hello, I will let the responsible team review this patch before going any further. You'll get updated when this is finished. -- BR Fredrik Gustafsson Erlang OTP Team From sverker.eriksson@REDACTED Tue Jun 4 14:50:22 2013 From: sverker.eriksson@REDACTED (Sverker Eriksson) Date: Tue, 4 Jun 2013 14:50:22 +0200 Subject: [erlang-patches] [erlang-bugs] Lift limitation to FD_SETSIZE file descriptors on Mac OS X in erl_poll In-Reply-To: <40F80D04-1940-4F9F-B2E9-3D90AA81FAB1@gmail.com> References: <5B66A627-9663-4745-8282-9A4BFAB23229@gmail.com> <5190A402.4090406@erlang.org> <51A5CDD0.3040309@erix.ericsson.se> <719E32DA-731E-4BBD-B073-3A30900BDB63@gmail.com> <51A8CE85.4060705@erix.ericsson.se> <40F80D04-1940-4F9F-B2E9-3D90AA81FAB1@gmail.com> Message-ID: <51ADE28E.9060300@erix.ericsson.se> Anthony Ramine wrote: > Hello Sverker, > > Did you try without your improvements? > > No, I just assumed that I had written flawless code as always ;-) > I don't have access to neither Leopard nor Snow Leopard, but judging > from a quick search on the Web, there is no reason it wouldn't work on > either of them. > > Yes, your original patch worked fine of course and I introduced the bug myself. I have pushed a fix to github git fetch git://github.com/sverker/otp.git sverk/darwin-unlimited-select /Sverker From eric.pailleau@REDACTED Tue Jun 4 23:59:41 2013 From: eric.pailleau@REDACTED (PAILLEAU Eric) Date: Tue, 04 Jun 2013 23:59:41 +0200 Subject: [erlang-patches] Allow rb to use any io_device/registered name instead of only filename path In-Reply-To: <51AD939B.80006@erlang.org> References: <51AB1928.3080503@wanadoo.fr> <51AD939B.80006@erlang.org> Message-ID: <51AE634D.7020608@wanadoo.fr> Le 04/06/2013 09:13, Fredrik a ?crit : > On 06/02/2013 12:06 PM, PAILLEAU Eric wrote: >> Hello, >> Report Browser could not accept a file descriptor, >> for instance given by another application. >> this is a first patch needed in my wish to >> add a graphical log browser in observer. >> >> git fetch https://github.com/crownedgrouse/otp.git add_fd_usage_in_rb >> >> https://github.com/crownedgrouse/otp/compare/erlang:maint...add_fd_usage_in_rb >> >> >> https://github.com/crownedgrouse/otp/compare/erlang:maint...add_fd_usage_in_rb.patch >> >> >> regards >> >> _______________________________________________ >> erlang-patches mailing list >> erlang-patches@REDACTED >> http://erlang.org/mailman/listinfo/erlang-patches > Hello Eric, > Your patch is failing the following testcases: > Application: SASL, Suite: rb_SUITE, Testcase: list; > Application: SASL, Suite: rb_SUITE, Testcase: rescan > Hello, please refetch. I came back to former behaviour for rb:list/1-2 functions, so the test suite do not fail anymore. I add 2 new exported function that allow to print list of reports in the log file. Regards From anders.otp@REDACTED Wed Jun 5 12:23:12 2013 From: anders.otp@REDACTED (Anders Svensson) Date: Wed, 5 Jun 2013 12:23:12 +0200 Subject: [erlang-patches] Add info_port function to export in diameter_service module In-Reply-To: <51ADA6EF.2060000@comarch.pl> References: <51ADA6EF.2060000@comarch.pl> Message-ID: On Tue, Jun 4, 2013 at 10:35 AM, Aleksander Nycz wrote: > Hello, > > Could you add function info_port/1 to export in diameter_service module? > > %% towards diameter > -export([subscribe/1, > unsubscribe/1, > services/0, > info/2, > info_port/1]). > > This funciton gets PID and returns connection details between two diameter > peers (IP addresses and ports) > I must use this function in pick_peer diameter callback to obtain proper > peer to send ASR requests. Could you provide a bit more detail? Otherwise, diameter_service isn't a module you should be calling directly. The interface module is diameter, and diameter:service_info/2 is intended to return various service-related information. It sounds like maybe you want more possibilities in this function. You can find addresses and ports in diameter:service_info(SvcName, connections), but for all connections, not just one: http://www.erlang.org/doc/man/diameter.html#service_info-2 Anders > > Regards > Aleksadner Nycz > > -- > Aleksander Nycz > Senior Software Engineer > Telco_021 BSS R&D > Comarch SA > Phone: +48 12 646 1216 > Mobile: +48 691 464 275 > website: www.comarch.pl > > > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches > From n.oxyde@REDACTED Thu Jun 6 01:47:10 2013 From: n.oxyde@REDACTED (Anthony Ramine) Date: Thu, 6 Jun 2013 01:47:10 +0200 Subject: [erlang-patches] [erlang-bugs] Compiler/linter bug breaking unused variable warnings In-Reply-To: <5312CBA2-4C31-46FF-9E8A-74589DB5349D@gmail.com> References: <82DC27D088947C4D943175FDA0DA60F411526021@EXMB13TSTRZ2.tcad.telia.se> <5312CBA2-4C31-46FF-9E8A-74589DB5349D@gmail.com> Message-ID: Hello, When analyzing complex expressions (i.e. comprehensions, cases, tries, ifs and receives), erl_lint does not forget about old unused variables when returning the updated variable table. This causes a bug where old unused variables are not recorded as such: t(X, Y) -> #r{a=[ K || K <- Y ],b=[ K || K <- Y ]. As erl_lint uses vtmerge_pat/2 to merge the results of the analysis of the two list comprehensions, X is marked as used and the warning is not emitted. The function vtmerge_pat/2 is used instead of the similar vtmerge/2 which does not mark multiple occurrences of a variable as usage to handle cases like the following one: t(X, Y) -> #r{a=A=X,b=A=Y}. Other simpler expressions like conses, tuples and external fun references does not correctly follow this behaviour. This patch fixes both issues and makes erl_lint not return old unused variables in updated tables and makes all compound expressions use vtmerge_pat/2. git fetch https://github.com/nox/otp.git fix-erl_lint-variable-usage https://github.com/nox/otp/compare/erlang:maint...fix-erl_lint-variable-usage https://github.com/nox/otp/compare/erlang:maint...fix-erl_lint-variable-usage.patch Regards, -- Anthony Ramine Le 31 mai 2013 ? 00:46, Anthony Ramine a ?crit : > Hello, > > Smaller test case reproducing the bug, without KeyList2 nor filter/1: > > -8<-- > -module(missing_warning). > > -export([test_missing_warning/2, > test_with_warning1/2, > test_with_warning2/2 > ]). > > -record(data, {aList, bList}). > > test_missing_warning(Data, KeyList) -> %% Data, KeyList never used - no warning. > #data{aList = [Key || Key <- []], > bList = [Key || Key <- []]}. > > test_with_warning1(Data, KeyList) -> %% Data, KeyList never used - get warning. > #data{aList = [Key || Key <- []]}. %% Only one LC in the record. > > test_with_warning2(Data, KeyList) -> %% Data, KeyList never used - get warning. > {data, > [Key || Key <- []], %% Not in a record. > [Key || Key <- []]}. > -->8- > > Regards, > > -- > Anthony Ramine > > Le 29 mai 2013 ? 20:02, a ?crit : > >> >> When a function creates a record and more than one field is bound to the value of a list comprehension the compiler/linter fails to generate warnings for unused variables in that function. I just tested this on R16B and the problem is still there. >> >> I use the following module to test this: >> >> --8<---------------------------------------------------------- >> -module(missing_warning). >> >> -export([test_missing_warning/2, >> test_with_warning1/2, >> test_with_warning2/2 >> ]). >> >> -record(data, {aList, bList}). >> >> test_missing_warning(Data, KeyList) -> %% Data never used - no warning. >> KeyList2 = filter(KeyList), %% KeyList2 never used - no warning. >> #data{aList = [Key || Key <- KeyList], >> bList = [Key || Key <- KeyList]}. >> >> test_with_warning1(Data, KeyList) -> %% Data never used - get warning. >> KeyList2 = filter(KeyList), %% KeyList2 never used - get warning. >> #data{aList = [Key || Key <- KeyList]}. %% Only one LC in the record. >> >> test_with_warning2(Data, KeyList) -> %% Data never used - get warning. >> KeyList2 = filter(KeyList), %% KeyList2 never used - get warning. >> {data, >> [Key || Key <- KeyList], %% Not in a record. >> [Key || Key <- KeyList]}. >> >> filter(L) -> L. >> --8<---------------------------------------------------------- >> >> In all three test functions the variables Data (in the function head) and KeyList2 (in the function body) are unused. >> Compiling the module should produce six warnings but I only get four. >> You get the same result with other "advanced" calls like >> lists:map(fun(Key) -> Key end, KeyList) >> so it's not limited to list comprehensions. >> If the fields are bound to e.g. the variable KeyList directly the warnings work just fine. >> >> /Anders >> >> _______________________________________________ >> erlang-bugs mailing list >> erlang-bugs@REDACTED >> http://erlang.org/mailman/listinfo/erlang-bugs > From n.oxyde@REDACTED Thu Jun 6 22:55:23 2013 From: n.oxyde@REDACTED (Anthony Ramine) Date: Thu, 6 Jun 2013 22:55:23 +0200 Subject: [erlang-patches] Silence a misleading warning with some comprehensions Message-ID: Hello, When compiling comprehensions with generators which are foldable to 'true', a misleading warning is emitted by sys_core_fold because a clause resulting from the compilation of the comprehension to Core Erlang is not marked as generated by the compiler. An example of such a comprehension is [ true || true ]. git fetch https://github.com/nox/otp.git fix-comp-warnings https://github.com/nox/otp/compare/erlang:maint...fix-comp-warnings https://github.com/nox/otp/compare/erlang:maint...fix-comp-warnings.patch Regards, -- Anthony Ramine From fredrik@REDACTED Fri Jun 7 09:21:28 2013 From: fredrik@REDACTED (Fredrik) Date: Fri, 7 Jun 2013 09:21:28 +0200 Subject: [erlang-patches] [erlang-bugs] Compiler/linter bug breaking unused variable warnings In-Reply-To: References: <82DC27D088947C4D943175FDA0DA60F411526021@EXMB13TSTRZ2.tcad.telia.se> <5312CBA2-4C31-46FF-9E8A-74589DB5349D@gmail.com> Message-ID: <51B189F8.3060901@erlang.org> On 06/06/2013 01:47 AM, Anthony Ramine wrote: > Hello, > > When analyzing complex expressions (i.e. comprehensions, cases, tries, ifs and receives), erl_lint does not forget about old unused variables when returning the updated variable table. This causes a bug where old > unused variables are not recorded as such: > > t(X, Y) -> > #r{a=[ K || K<- Y ],b=[ K || K<- Y ]. > > As erl_lint uses vtmerge_pat/2 to merge the results of the analysis of the two list comprehensions, X is marked as used and the warning is not emitted. > > The function vtmerge_pat/2 is used instead of the similar vtmerge/2 which does not mark multiple occurrences of a variable as usage to handle cases like the following one: > > t(X, Y) -> > #r{a=A=X,b=A=Y}. > > Other simpler expressions like conses, tuples and external fun references does not correctly follow this behaviour. > > This patch fixes both issues and makes erl_lint not return old unused variables in updated tables and makes all compound expressions use vtmerge_pat/2. > > git fetch https://github.com/nox/otp.git fix-erl_lint-variable-usage > > https://github.com/nox/otp/compare/erlang:maint...fix-erl_lint-variable-usage > https://github.com/nox/otp/compare/erlang:maint...fix-erl_lint-variable-usage.patch > > Regards, > Hello, I've fetched your patch and it should be visible in the 'pu' branch shortly. I also assigned it to be reviewed by the responsible team directly. Thanks, -- BR Fredrik Gustafsson Erlang OTP Team From fredrik@REDACTED Fri Jun 7 09:36:20 2013 From: fredrik@REDACTED (Fredrik) Date: Fri, 7 Jun 2013 09:36:20 +0200 Subject: [erlang-patches] Silence a misleading warning with some comprehensions In-Reply-To: References: Message-ID: <51B18D74.4090709@erlang.org> On 06/06/2013 10:55 PM, Anthony Ramine wrote: > Hello, > > When compiling comprehensions with generators which are foldable to 'true', a misleading warning is emitted by sys_core_fold because a clause resulting from the compilation of the comprehension to Core Erlang is not marked as generated by the compiler. > > An example of such a comprehension is [ true || true ]. > > git fetch https://github.com/nox/otp.git fix-comp-warnings > > https://github.com/nox/otp/compare/erlang:maint...fix-comp-warnings > https://github.com/nox/otp/compare/erlang:maint...fix-comp-warnings.patch > > Regards, > Hello Anthony, I've fetched your patch and it should be visible in the 'pu' branch shortly. Thanks, -- BR Fredrik Gustafsson Erlang OTP Team From n.oxyde@REDACTED Fri Jun 7 18:22:29 2013 From: n.oxyde@REDACTED (Anthony Ramine) Date: Fri, 7 Jun 2013 18:22:29 +0200 Subject: [erlang-patches] Scan "=<<" as something useful In-Reply-To: <6F811862-36D9-4E61-BEB0-C33AD9B01CFA@gmail.com> References: <20130429085342.GA7639@erix.ericsson.se> <20130429091833.GA8431@erix.ericsson.se> <20130429130545.GA12647@erix.ericsson.se> <410DB75B-3587-41C0-89C4-E5B49E9C5F59@gmail.com> <20130429133226.GA14490@erix.ericsson.se> <6F811862-36D9-4E61-BEB0-C33AD9B01CFA@gmail.com> Message-ID: Nothing to reply to this? -- Anthony Ramine Le 1 mai 2013 ? 15:14, Anthony Ramine a ?crit : > Hello Raimo, > > I've given some more thought about that subject and whether the fix could surprise people if they ever did a typo. > > 1/ "A=<<<1>>" ("A =< << 1 >>") instead of "A=<<1>>" ("A = << 1 >>") > > * If A is not bound, this is a compilation error. The intended code would have compiled fine. > * If A is bound, the intended code is to crash if A isn't <<1>>, that kind of quick and dirty check is usually to fail early and found not nested in a function body; the typo is a comparison expression and the compiler will complain its return value is not used. > * If A is bound and the expression's return value used, no compilation error or warning will be triggered but Dialyzer will complain about a binary/boolean type mismatch. > > 2/ "A=<<1>>" ("A = << 1 >>") instead of "A=<<<1>>" ("A =< << 1 >>") > > * If A isn't bound, code compiles just fine. The intended code would have failed with a compilation error. > * If A is bound, no compilation error but Dialyzer will complain of a binary/boolean type mismatch. > > So we are left with two cases where the compiler will say nothing, but Dialyzer will. > > Regards, > > -- > Anthony Ramine > > Le 29 avr. 2013 ? 15:32, Raimo Niskanen a ?crit : > >> On Mon, Apr 29, 2013 at 03:11:44PM +0200, Anthony Ramine wrote: >>> I don't understand how is that a typo, as "A=<<<1>>" is valid syntax with or without my patch. >> >> ...i misread the old arguments; rather that intending to write "A =< << 1 >>" >> without spaces as "A=<<<1>>" and misspelling to "A=<<1>>" would give no compiler >> error and unexpected runtime behaviour... >> >>> >>> -- >>> Anthony Ramine >>> >>> Le 29 avr. 2013 ? 15:05, Raimo Niskanen a ?crit : >>> >>>> One final straw back then was this: the typo "A=<<<1>>" accidentally >>>> becomes valid syntax with the proposed change. >>> >> >> -- >> >> / Raimo Niskanen, Erlang/OTP, Ericsson AB >> _______________________________________________ >> erlang-patches mailing list >> erlang-patches@REDACTED >> http://erlang.org/mailman/listinfo/erlang-patches > From n.oxyde@REDACTED Fri Jun 7 18:24:41 2013 From: n.oxyde@REDACTED (Anthony Ramine) Date: Fri, 7 Jun 2013 18:24:41 +0200 Subject: [erlang-patches] EEP37: Funs with names In-Reply-To: References: <50A4FAA9.1070706@erlang.org> <466D4B3A-8B3C-4AA7-9A2B-B85EA5EA2A90@gmail.com> <819C7547-3B43-4F8E-A4E0-91B77C547600@gmail.com> <514981E0.9030209@erlang.org> <806DFCE7-CC09-46F9-8B71-F97CE9E04A39@gmail.com> <5149C8AE.8030509@erlang.org> Message-ID: Ping? -- Anthony Ramine Le 21 avr. 2013 ? 22:17, Anthony Ramine a ?crit : > Hello, > > Any ETA for a review? > > Regards, > > On Wed, Mar 20, 2013 at 3:33 PM, Fredrik wrote: >> On 03/20/2013 03:30 PM, Anthony Ramine wrote: >>> >>> Rebased! :) >>> >>> Does it mean it may be included before R17? Branch maint is for minor >>> releases, right? >>> >> Right now im collecting all the patches active at the moment in pu. That >> does not mean it will be included in a minor release. :) >> >> -- >> >> BR Fredrik Gustafsson >> Erlang OTP Team >> From essen@REDACTED Mon Jun 10 03:01:40 2013 From: essen@REDACTED (=?ISO-8859-1?Q?Lo=EFc_Hoguin?=) Date: Mon, 10 Jun 2013 03:01:40 +0200 Subject: [erlang-patches] Small docs update Message-ID: <51B52574.2040604@ninenines.eu> This was forgotten in a previous patch. Sorry! git fetch git://github.com/essen/otp.git fix-doc-reserved-words https://github.com/essen/otp/compare/erlang:maint...fix-doc-reserved-words https://github.com/essen/otp/compare/erlang:maint...fix-doc-reserved-words.patch -- Lo?c Hoguin Erlang Cowboy Nine Nines http://ninenines.eu From fredrik@REDACTED Mon Jun 10 09:27:41 2013 From: fredrik@REDACTED (Fredrik) Date: Mon, 10 Jun 2013 09:27:41 +0200 Subject: [erlang-patches] Small docs update In-Reply-To: <51B52574.2040604@ninenines.eu> References: <51B52574.2040604@ninenines.eu> Message-ID: <51B57FED.4040007@erlang.org> On 06/10/2013 03:01 AM, Lo?c Hoguin wrote: > This was forgotten in a previous patch. Sorry! > > git fetch git://github.com/essen/otp.git fix-doc-reserved-words > > > https://github.com/essen/otp/compare/erlang:maint...fix-doc-reserved-words > > > https://github.com/essen/otp/compare/erlang:maint...fix-doc-reserved-words.patch > > Fetched. Thanks, -- BR Fredrik Gustafsson Erlang OTP Team From fredrik@REDACTED Mon Jun 10 10:54:46 2013 From: fredrik@REDACTED (Fredrik) Date: Mon, 10 Jun 2013 10:54:46 +0200 Subject: [erlang-patches] EEP37: Funs with names In-Reply-To: References: <50A4FAA9.1070706@erlang.org> <466D4B3A-8B3C-4AA7-9A2B-B85EA5EA2A90@gmail.com> <819C7547-3B43-4F8E-A4E0-91B77C547600@gmail.com> <514981E0.9030209@erlang.org> <806DFCE7-CC09-46F9-8B71-F97CE9E04A39@gmail.com> <5149C8AE.8030509@erlang.org> Message-ID: <51B59456.2000207@erlang.org> On 06/07/2013 06:24 PM, Anthony Ramine wrote: > Ping? > Hello Anthony, I've assigned it to be reviewed by the responsible team now. This must have fallen between the chairs when we changed the patch-process. But now the ball is officially on the developers. -- BR Fredrik Gustafsson Erlang OTP Team From stefan.zegenhagen@REDACTED Mon Jun 10 11:07:00 2013 From: stefan.zegenhagen@REDACTED (Stefan Zegenhagen) Date: Mon, 10 Jun 2013 11:07:00 +0200 Subject: [erlang-patches] SNMP/VACM: bugfix for vacmViewTreeFamilyMask Message-ID: <1370855220.3947.44.camel@ax-sze> Dear all, it's almost a year since I sent the patch attached to this e-mail, and I just found out that I have not yet gotten a response to it. I would consider this patch important because it fixes an issue with the interpretation of data that might be critical for SNMPv3 operation. I confirmed at that time that erlangs interpretation of vacmViewTreeFamilyMask is indeed not interoperable with other SNMP stacks. Kind regards, > > > the implementation of SNMP-VIEW-BASED-ACM.mib assumes that the input for > > > vacmViewTreeFamilyMask is an OID consisting of 1's and 0's only to form > > > the mask. However, the MIB states that the input should be a bitstring. > > > > > > The OID representation of the mask is useful in the code as it speeds up > > > time-critical code paths when checking access permissions for EACH SNMP > > > access. Reading/writing the view mask objects is less time-critical. > > > > > > Therefore, to fix the issue, convert between OID representation and > > > bitstring when the vacmViewTreeFamilyMask objects are accessed. This is > > > done by the patch attached to this e-mail. > > > I'm very sorry for the troubles that I am causing but it seems that the > previous version of the patch did more than it should: the OID-bitstring > conversion was also applied to other tables in the same MIB on > get/get-next requests. > > The version of the patch that is attached to this e-mail restricts the > OID-bitstring conversion to vacmViewTreeFamilyMask alone. -- Dr. Stefan Zegenhagen arcutronix GmbH Garbsener Landstr. 10 30419 Hannover Germany Tel: +49 511 277-2734 Fax: +49 511 277-2709 Email: stefan.zegenhagen@REDACTED Web: www.arcutronix.com *Synchronize the Ethernet* General Managers: Dipl. Ing. Juergen Schroeder, Dr. Josef Gfrerer - Legal Form: GmbH, Registered office: Hannover, HRB 202442, Amtsgericht Hannover; Ust-Id: DE257551767. Please consider the environment before printing this message. -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-bugfix-for-vacmViewTreeFamilyMask.patch Type: text/x-patch Size: 4709 bytes Desc: not available URL: From fredrik@REDACTED Mon Jun 10 11:14:52 2013 From: fredrik@REDACTED (Fredrik) Date: Mon, 10 Jun 2013 11:14:52 +0200 Subject: [erlang-patches] SNMP/VACM: bugfix for vacmViewTreeFamilyMask In-Reply-To: <1370855220.3947.44.camel@ax-sze> References: <1370855220.3947.44.camel@ax-sze> Message-ID: <51B5990C.8040108@erlang.org> On 06/10/2013 11:07 AM, Stefan Zegenhagen wrote: > Dear all, > > > it's almost a year since I sent the patch attached to this e-mail, and I > just found out that I have not yet gotten a response to it. > > I would consider this patch important because it fixes an issue with the > interpretation of data that might be critical for SNMPv3 operation. I > confirmed at that time that erlangs interpretation of > vacmViewTreeFamilyMask is indeed not interoperable with other SNMP > stacks. > > > Kind regards, > > >>>> the implementation of SNMP-VIEW-BASED-ACM.mib assumes that the input for >>>> vacmViewTreeFamilyMask is an OID consisting of 1's and 0's only to form >>>> the mask. However, the MIB states that the input should be a bitstring. >>>> >>>> The OID representation of the mask is useful in the code as it speeds up >>>> time-critical code paths when checking access permissions for EACH SNMP >>>> access. Reading/writing the view mask objects is less time-critical. >>>> >>>> Therefore, to fix the issue, convert between OID representation and >>>> bitstring when the vacmViewTreeFamilyMask objects are accessed. This is >>>> done by the patch attached to this e-mail. >> >> I'm very sorry for the troubles that I am causing but it seems that the >> previous version of the patch did more than it should: the OID-bitstring >> conversion was also applied to other tables in the same MIB on >> get/get-next requests. >> >> The version of the patch that is attached to this e-mail restricts the >> OID-bitstring conversion to vacmViewTreeFamilyMask alone. > > > > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches Hello Stefan, We would prefer to get all patches according to https://github.com/erlang/otp/wiki/submitting-patches We don't prefer mailpatches for bigger issues because they become more time-consuming for us. So set up your github account (if you don't already have one), follow the instructions and we will gladly review your patch. Thanks, -- BR Fredrik Gustafsson Erlang OTP Team -------------- next part -------------- An HTML attachment was scrubbed... URL: From stefan.zegenhagen@REDACTED Mon Jun 10 11:40:29 2013 From: stefan.zegenhagen@REDACTED (Stefan Zegenhagen) Date: Mon, 10 Jun 2013 11:40:29 +0200 Subject: [erlang-patches] SNMP/VACM: bugfix for vacmViewTreeFamilyMask In-Reply-To: <51B5990C.8040108@erlang.org> References: <1370855220.3947.44.camel@ax-sze> <51B5990C.8040108@erlang.org> Message-ID: <1370857229.3947.49.camel@ax-sze> Hi Fredrik, > Hello Stefan, > We would prefer to get all patches according to > https://github.com/erlang/otp/wiki/submitting-patches > We don't prefer mailpatches for bigger issues because they become more > time-consuming for us. > So set up your github account (if you don't already have one), follow > the instructions and we will gladly review your patch. I have to admit that I am not and probably never will be a good Netizen and will likely not get myself YAAS (Yet Another Account Somewhere). Would it be possible for you to at least create a bug report for this issue, so that it will be fixed at some point? Kind regards, -- Dr. Stefan Zegenhagen arcutronix GmbH Garbsener Landstr. 10 30419 Hannover Germany Tel: +49 511 277-2734 Fax: +49 511 277-2709 Email: stefan.zegenhagen@REDACTED Web: www.arcutronix.com *Synchronize the Ethernet* General Managers: Dipl. Ing. Juergen Schroeder, Dr. Josef Gfrerer - Legal Form: GmbH, Registered office: Hannover, HRB 202442, Amtsgericht Hannover; Ust-Id: DE257551767. Please consider the environment before printing this message. From n.oxyde@REDACTED Mon Jun 10 11:46:49 2013 From: n.oxyde@REDACTED (Anthony Ramine) Date: Mon, 10 Jun 2013 11:46:49 +0200 Subject: [erlang-patches] Wrap eunit macros into begin ... end blocks Message-ID: <3014117C-4F29-46F1-8CB7-2C9177F990D4@gmail.com> Hello, This makes typos such as missing commas between two assertions (e.g. ?assert(true) ?assert(true)) syntax errors instead of silently compiling and failing with a badfun error at runtime. This won't break any existing code as parenthesed expressions and blocks have the same precedence and none of these macros can be used as patterns. git fetch https://github.com/nox/otp.git eunit-macros-blocks https://github.com/nox/otp/compare/erlang:maint...eunit-macros-blocks https://github.com/nox/otp/compare/erlang:maint...eunit-macros-blocks.patch Regards, -- Anthony Ramine From carlsson.richard@REDACTED Mon Jun 10 11:49:58 2013 From: carlsson.richard@REDACTED (Richard Carlsson) Date: Mon, 10 Jun 2013 11:49:58 +0200 Subject: [erlang-patches] Wrap eunit macros into begin ... end blocks In-Reply-To: <3014117C-4F29-46F1-8CB7-2C9177F990D4@gmail.com> References: <3014117C-4F29-46F1-8CB7-2C9177F990D4@gmail.com> Message-ID: <51B5A146.6040501@gmail.com> On 2013-06-10 11:46 , Anthony Ramine wrote: > Hello, > > This makes typos such as missing commas between two assertions (e.g. ?assert(true) ?assert(true)) syntax errors instead of silently compiling and failing with a badfun error at runtime. > > This won't break any existing code as parenthesed expressions and blocks have the same precedence and none of these macros can be used as patterns. > > git fetch https://github.com/nox/otp.git eunit-macros-blocks > > https://github.com/nox/otp/compare/erlang:maint...eunit-macros-blocks > https://github.com/nox/otp/compare/erlang:maint...eunit-macros-blocks.patch > > Regards, > Good idea. /Richard From fredrik@REDACTED Mon Jun 10 11:58:04 2013 From: fredrik@REDACTED (Fredrik) Date: Mon, 10 Jun 2013 11:58:04 +0200 Subject: [erlang-patches] SNMP/VACM: bugfix for vacmViewTreeFamilyMask In-Reply-To: <1370855220.3947.44.camel@ax-sze> References: <1370855220.3947.44.camel@ax-sze> Message-ID: <51B5A32C.30708@erlang.org> On 06/10/2013 11:07 AM, Stefan Zegenhagen wrote: > Dear all, > > > it's almost a year since I sent the patch attached to this e-mail, and I > just found out that I have not yet gotten a response to it. > > I would consider this patch important because it fixes an issue with the > interpretation of data that might be critical for SNMPv3 operation. I > confirmed at that time that erlangs interpretation of > vacmViewTreeFamilyMask is indeed not interoperable with other SNMP > stacks. > > > Kind regards, > > >>>> the implementation of SNMP-VIEW-BASED-ACM.mib assumes that the input for >>>> vacmViewTreeFamilyMask is an OID consisting of 1's and 0's only to form >>>> the mask. However, the MIB states that the input should be a bitstring. >>>> >>>> The OID representation of the mask is useful in the code as it speeds up >>>> time-critical code paths when checking access permissions for EACH SNMP >>>> access. Reading/writing the view mask objects is less time-critical. >>>> >>>> Therefore, to fix the issue, convert between OID representation and >>>> bitstring when the vacmViewTreeFamilyMask objects are accessed. This is >>>> done by the patch attached to this e-mail. >> >> I'm very sorry for the troubles that I am causing but it seems that the >> previous version of the patch did more than it should: the OID-bitstring >> conversion was also applied to other tables in the same MIB on >> get/get-next requests. >> >> The version of the patch that is attached to this e-mail restricts the >> OID-bitstring conversion to vacmViewTreeFamilyMask alone. > > > > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches Your mailpatch has been taken cared of. It is now assigned to the responsible team. Thanks for the heads-up, -- BR Fredrik Gustafsson Erlang OTP Team -------------- next part -------------- An HTML attachment was scrubbed... URL: From raimo+erlang-patches@REDACTED Mon Jun 10 16:50:51 2013 From: raimo+erlang-patches@REDACTED (Raimo Niskanen) Date: Mon, 10 Jun 2013 16:50:51 +0200 Subject: [erlang-patches] Scan "=<<" as something useful In-Reply-To: References: <20130429085342.GA7639@erix.ericsson.se> <20130429091833.GA8431@erix.ericsson.se> <20130429130545.GA12647@erix.ericsson.se> <410DB75B-3587-41C0-89C4-E5B49E9C5F59@gmail.com> <20130429133226.GA14490@erix.ericsson.se> <6F811862-36D9-4E61-BEB0-C33AD9B01CFA@gmail.com> Message-ID: <20130610145051.GA9514@erix.ericsson.se> On Fri, Jun 07, 2013 at 06:22:29PM +0200, Anthony Ramine wrote: > Nothing to reply to this? Oops. Sorry about that. Good summary. > > -- > Anthony Ramine > > Le 1 mai 2013 ? 15:14, Anthony Ramine a ?crit : > > > Hello Raimo, > > > > I've given some more thought about that subject and whether the fix could surprise people if they ever did a typo. > > > > 1/ "A=<<<1>>" ("A =< << 1 >>") instead of "A=<<1>>" ("A = << 1 >>") > > > > * If A is not bound, this is a compilation error. The intended code would have compiled fine. > > * If A is bound, the intended code is to crash if A isn't <<1>>, that kind of quick and dirty check is usually to fail early and found not nested in a function body; the typo is a comparison expression and the compiler will complain its return value is not used. > > * If A is bound and the expression's return value used, no compilation error or warning will be triggered but Dialyzer will complain about a binary/boolean type mismatch. > > > > 2/ "A=<<1>>" ("A = << 1 >>") instead of "A=<<<1>>" ("A =< << 1 >>") > > > > * If A isn't bound, code compiles just fine. The intended code would have failed with a compilation error. > > * If A is bound, no compilation error but Dialyzer will complain of a binary/boolean type mismatch. > > > > So we are left with two cases where the compiler will say nothing, but Dialyzer will. I think the language should not depend too much on Dialyzer. Any strangeness is bad even if Dialyzer would detect it. Not that any of those cases looks very sensible.... Just for the record, so I can easily recall what I aggreed on: Intending to write: 1a) A = bound(), A = << 1 >>. 1b) A = bound(), A = << 1 >>, ... % Just a warning 2) A = bound(), A =< << 1 >>, ... without spaces between the variable and the binary plus mistyping the number of '<'s in the binary would get strangely behaving code through the compiler (1b with a warning), but not without Dialyzer warning. So this argument against implementing your suggested patch is not a very strong one today. Back then there was no Dialyzer (which we should not assume essential) and I think that compiler warning about unused return value from comparision did not exist either. But I still think that forever forcing Erlang to need an infinite look ahead custom syntax aware scanner still is a strong argument against the suggested improvement. > > > > Regards, > > > > -- > > Anthony Ramine > > > > Le 29 avr. 2013 ? 15:32, Raimo Niskanen a ?crit : > > > >> On Mon, Apr 29, 2013 at 03:11:44PM +0200, Anthony Ramine wrote: > >>> I don't understand how is that a typo, as "A=<<<1>>" is valid syntax with or without my patch. > >> > >> ...i misread the old arguments; rather that intending to write "A =< << 1 >>" > >> without spaces as "A=<<<1>>" and misspelling to "A=<<1>>" would give no compiler > >> error and unexpected runtime behaviour... > >> > >>> > >>> -- > >>> Anthony Ramine > >>> > >>> Le 29 avr. 2013 ? 15:05, Raimo Niskanen a ?crit : > >>> > >>>> One final straw back then was this: the typo "A=<<<1>>" accidentally > >>>> becomes valid syntax with the proposed change. > >>> > >> > >> -- > >> > >> / Raimo Niskanen, Erlang/OTP, Ericsson AB > >> _______________________________________________ > >> erlang-patches mailing list > >> erlang-patches@REDACTED > >> http://erlang.org/mailman/listinfo/erlang-patches > > > -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From rickard@REDACTED Wed Jun 12 00:40:58 2013 From: rickard@REDACTED (Rickard Green) Date: Wed, 12 Jun 2013 00:40:58 +0200 Subject: [erlang-patches] Disable scheduler sleep In-Reply-To: References: <60397.1368826712@snookles.snookles.com> Message-ID: <51B7A77A.3070806@erlang.org> > For the OTP team's consideration ... Disable scheduler sleep > > For use in conjunction with "+scl false", for example: > > erl +scl false +zdnfgtse 500:500 > > See the discussion in these mailing list threads for more > background: > > * http://erlang.org/pipermail/erlang-questions/2013-April/073490.html > * http://erlang.org/pipermail/erlang-bugs/2013-May/003529.html > > As noted in the email threads, all R15B releases as well as R16B are > vulnerable to the schedulers falling asleep too agressively. I've also > tested the future will-eventually-be-R16B01 from the OTP team's source > repo's "maint" branch, as described by: > > % git log | head -6 > commit a70d09b6e611771b467a91c7ebeca1e14390553a > Merge: 8260029 fb8cbfa > Author: Fredrik Gustafsson > Date: Fri May 17 10:03:30 2013 +0200 > > Merge branch 'nm/mnesia_idx_insert_speedup/OTP-11103' into maint > > ... and it is vulnerable, also. > > Patch info: > > git fetch git://github.com/slfritchie/otp.git disable-scheduler-sleeps > > https://github.com/slfritchie/otp/compare/erlang:maint...disable-scheduler-sleeps > https://github.com/slfritchie/otp/compare/erlang:maint...disable-scheduler-sleeps.patch > > With this patch, release R16B and the today's "maint" branch are not > vulnerable when run with "erl +scl false +zdnfgtse 500:500". > > This patch may be applied to the R15B releases and works correctly. > The "patch" utility will complain about some fuzz, but it should not > actually fail. > > -Scott > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches I've rejected this patch, but implemented something that behaves in a similar way but without latency issues. This should make it into R16B01 unless something unforeseen occurs. From the documentation: +sfwi Interval Set scheduler forced wakeup interval. All run queues will be scanned each Interval milliseconds. While there are sleeping schedulers in the system, one scheduler will be woken for each non-empty run queue found. An Interval of zero disables this feature, which also is the default. This feature has been introduced as a temporary workaround for lengthy executing native code, and native code that do not bump reductions properly in OTP. When these bugs have be fixed the +sfwi flag will be removed. Regards, Rickard -- Rickard Green, Erlang/OTP, Ericsson AB. From erlangsiri@REDACTED Wed Jun 12 17:07:38 2013 From: erlangsiri@REDACTED (Siri Hansen) Date: Wed, 12 Jun 2013 17:07:38 +0200 Subject: [erlang-patches] Non-overlapping Application Distribution Node Sets In-Reply-To: <518A5581.2080401@erlang.org> References: <20130503080752.GZ21384@aluminium> <51837891.9020207@erlang.org> <20130503134345.GB21384@aluminium> <5188BDFB.8090703@erlang.org> <20130508133013.GR31110@aluminium.local> <518A5581.2080401@erlang.org> Message-ID: Hi Vance, I have looked at your patch and discussed with my team and here is what we have so far: We do think that this type of functionality is interesting. We would, however, like to look at it in a bigger picture and possibly investigate the functionality for distributed applications a bit more before jumping to any conclusion. Would it be possible for you to provide us with some more information about the exact problem that you want to solve and maybe other use cases? Any input and ideas from other readers of the list would of course also be very welcome :) While reviewing, I also found that your patch is a bit incomplete as it does not introduce any new handling of #state.remote_started. This causes (at least) a hanging in the following scenario: 1. Start all nodes in first group 2. On first node in first group: application:start(MyDistApp). 3. Start all nodes in second group 4. On first node in second group: application:start(MyDistApp). 5. On other node in first group: application:start(MyDistApp). => hangs, since #state.remote_started contains two elements and only the first (which by chance is not the correct one) is considered. - This is just for information, and I don't suggest that you spend a lot of time solving this, since we don't yet know if we will accept the patch or not. Best regards /siri@REDACTED 2013/5/8 Fredrik > On 05/08/2013 03:30 PM, Vance Shipley wrote: > > On Tue, May 07, 2013 at 10:40:27AM +0200, Fredrik wrote: > } Your patch seems to fail some testcases, for certain I know that it > } is failing application_SUITE:distr_changed_tc2. > } And I have seen some indications that it is also is failing > } application_SUITE:script_start. > } Could you please look into this matter as I am removing it from pu > } until further notice from you. > > Frederik, > > I have pulled the pu branch, fetched my non_overlap_application_distribution > branch, built and run the application_SUITE test suite on my MacBook Pro > with the same results as before. The only case failing is otp_3002 which > failed before my changes. > > I'll look at distr_changed_tc2 and try and reason why it might fail. > > Any further information you can give me on the failure you saw would help. > What environment was it run on? > > > This happened on both linux and darwin. > The testcases are not failing without your patch in pu so that was the > cause, I know that for certain. > The script_start testcase is only failing on linux though. > distr_changed_tc2 is failing with reason: > > === reason = {suite_failed,"distribution error: Cp2 [app2,app3,app6,app8,kernel,stdlib] "} > > > And script_start with reason: > > === reason = {suite_failed,not_valid_start_type} > > > > -- > > BR Fredrik Gustafsson > Erlang OTP Team > > > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fritchie@REDACTED Wed Jun 12 23:07:45 2013 From: fritchie@REDACTED (Scott Lystig Fritchie) Date: Wed, 12 Jun 2013 16:07:45 -0500 Subject: [erlang-patches] Disable scheduler sleep In-Reply-To: Message of "Wed, 12 Jun 2013 00:40:58 +0200." <51B7A77A.3070806@erlang.org> Message-ID: <98336.1371071265@snookles.snookles.com> Rickard Green wrote: rg> I've rejected this patch, but implemented something that behaves in rg> a similar way but without latency issues. This should make it into rg> R16B01 unless something unforeseen occurs. Spiffy. What branch/commit/thingie should I be looking at to see the new patch? -Scott From vances@REDACTED Thu Jun 13 11:16:38 2013 From: vances@REDACTED (Vance Shipley) Date: Thu, 13 Jun 2013 14:46:38 +0530 Subject: [erlang-patches] Non-overlapping Application Distribution Node Sets In-Reply-To: References: <20130503080752.GZ21384@aluminium> <51837891.9020207@erlang.org> <20130503134345.GB21384@aluminium> <5188BDFB.8090703@erlang.org> <20130508133013.GR31110@aluminium.local> <518A5581.2080401@erlang.org> Message-ID: <20130613091638.GE32127@aluminium.local> On Wed, Jun 12, 2013 at 05:07:38PM +0200, Siri Hansen wrote: } We do think that this type of functionality is interesting. We would, } however, like to look at it in a bigger picture and possibly investigate } the functionality for distributed applications a bit more before jumping to } any conclusion. Would it be possible for you to provide us with some more } information about the exact problem that you want to solve and maybe other } use cases? The use case is simply that we run the same application on each node in a distributed Erlang cluster and want to designate a standby node for each as depicted below: +-----------+ +-----------+ |serverA | |serverB | | +-------+ | | +-------+ | | | node1 | | | | node2 | | | +-------+ | | +-------+ | | +-------+ | | +-------+ | | | node3 | | | | node4 | | | +-------+ | | +-------+ | +-----------+ +-----------+ node1: [{kernel, [{distributed, [{app1, [node1@REDACTED, node2@REDACTED]}]}]}, {sync_nodes_optional, [node2@REDACTED]}, {sync_nodes_timeout, 5000}]}]. node2: [{kernel, [{distributed, [{app1, [node1@REDACTED, node2@REDACTED]}]}]}, {sync_nodes_optional, [node1@REDACTED]}, {sync_nodes_timeout, 5000}]}]. node3: [{kernel, [{distributed, [{app1, [node4@REDACTED, node3@REDACTED]}]}]}, {sync_nodes_optional, [node4@REDACTED]}, {sync_nodes_timeout, 5000}]}]. node4: [{kernel, [{distributed, [{app1, [node4@REDACTED, node3@REDACTED]}]}]}, {sync_nodes_optional, [node3@REDACTED]}, {sync_nodes_timeout, 5000}]}]. } While reviewing, I also found that your patch is a bit incomplete as it } does not introduce any new handling of #state.remote_started. This causes } (at least) a hanging in the following scenario: } 1. Start all nodes in first group } 2. On first node in first group: application:start(MyDistApp). } 3. Start all nodes in second group } 4. On first node in second group: application:start(MyDistApp). } 5. On other node in first group: application:start(MyDistApp). } => hangs, since #state.remote_started contains two elements and only the } first (which by chance is not the correct one) is considered. Yes, I have since discovered this issue. I did intend to update the patch with a permanent solution ... } - This is just for information, and I don't suggest that you spend a lot of } time solving this, since we don't yet know if we will accept the patch or } not. If it can be done by simply anticipating that applications may run on non-overlapping nodes and handling it than I sincerely hope that you would. For us it was not obvious at all that there was any reason that we couldn't configure as above. The documentation only says: "All involved nodes must have the same value for distributed and sync_nodes_timeout, or the behaviour of the system is undefined." ... which we read to say that the {App, [Node, ...]} tuple should be consistent within those nodes. Beyond this, hopefully simple, enhancement I plan to implement a new distributed application controller to accomplish N+M redundancy as well. That seems to be something which we can do without much change to OTP. Ulf has shared his previous work on design with me, he seems to have recognized the same requirement. I wonder if anyone else on the list has done any work on this sort of thing or has thoughts on requirements or design? -- -Vance From vances@REDACTED Fri Jun 14 05:36:19 2013 From: vances@REDACTED (Vance Shipley) Date: Fri, 14 Jun 2013 09:06:19 +0530 Subject: [erlang-patches] Non-overlapping Application Distribution Node Sets In-Reply-To: <20130613091638.GE32127@aluminium.local> References: <20130503080752.GZ21384@aluminium> <51837891.9020207@erlang.org> <20130503134345.GB21384@aluminium> <5188BDFB.8090703@erlang.org> <20130508133013.GR31110@aluminium.local> <518A5581.2080401@erlang.org> <20130613091638.GE32127@aluminium.local> Message-ID: <20130614033619.GF32127@aluminium.local> On Thu, Jun 13, 2013 at 02:46:38PM +0530, Vance Shipley wrote: } The use case is simply that we run the same application on each node in } a distributed Erlang cluster and want to designate a standby node for } each as depicted below: Siri, For further clarification I should add that the node pairs need to know about each other because they use distributed mnesia. The node pairs which may run an instance of an application each maintain a copy of the mnesia tables which they need to run. If serverA fails node2 will take over it's app1 instance and continue operation with the current tables. The problem comes in with the fact that the active nodes all use mnesia distribution and pg2 betwen them (e.g. node & node4) as well. -- -Vance From jargon@REDACTED Fri Jun 14 17:22:17 2013 From: jargon@REDACTED (Johannes =?utf-8?B?V2Vpw59s?=) Date: Fri, 14 Jun 2013 17:22:17 +0200 Subject: [erlang-patches] Fix matching floating point on middle-endian machines In-Reply-To: <20130530080710.GA5654@molb.org> References: <20130530080710.GA5654@molb.org> Message-ID: <20130614152217.GA9970@molb.org> Hello again, I found and fixed three other occurrences in the code base where the endianness of doubles matters. After two weeks of testing I'm now fairly confident that Erlang runs fine on our platform. All four commits have been pushed to a new branch: git fetch git://github.com/weisslj/otp.git fix-float-middle-endian https://github.com/weisslj/otp/compare/erlang:maint...fix-float-middle-endian https://github.com/weisslj/otp/compare/erlang:maint...fix-float-middle-endian.patch Greetings, Johannes Wei?l On Thu, May 30, 2013 at 10:07:10AM +0200, Johannes Wei?l wrote: > This patch fixes matching of floating point numbers on middle-endian > platforms (ARM in my case). The error can be reproduced in QEMU using > this image: http://people.debian.org/~aurel32/qemu/armel/ > It builds up on Mike Sperbers patch (OTP-10209). Without this patch, the > float matching tests in bs_match_misc_SUITE fail. > > Here is a simple error example: > 1> <<_,_,_,_,_,_,_,_>> = <<1.25/float>>. > <<63,244,0,0,0,0,0,0>> > 2> <<1.25/float>> = <<63,244,0,0,0,0,0,0>>. > ** exception error: no match of right hand side value <<63,244,0,0,0,0,0,0>> From james@REDACTED Fri Jun 14 19:18:22 2013 From: james@REDACTED (James Wheare) Date: Fri, 14 Jun 2013 18:18:22 +0100 Subject: [erlang-patches] httpc: Allow content body in DELETE requests Message-ID: Fetch command: git fetch git://github.com/jwheare/otp.git httpc_delete_body Compare: https://github.com/jwheare/otp/compare/httpc_delete_body Patch: https://github.com/jwheare/otp/compare/httpc_delete_body.patch lib/inets/src/http_client/httpc.erl | 2 +- lib/inets/test/httpc_proxy_SUITE.erl | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) --- httpc: Allow content body in DELETE requests This isn't illegal according to the HTTP spec as far as I can see. Here's an example of a real world API that requires it: https://stripe.com/docs/api/curl#cancel_subscription From fredrik@REDACTED Mon Jun 17 10:39:43 2013 From: fredrik@REDACTED (Fredrik) Date: Mon, 17 Jun 2013 10:39:43 +0200 Subject: [erlang-patches] Fix matching floating point on middle-endian machines In-Reply-To: <20130614152217.GA9970@molb.org> References: <20130530080710.GA5654@molb.org> <20130614152217.GA9970@molb.org> Message-ID: <51BECB4F.4080807@erlang.org> On 06/14/2013 05:22 PM, Johannes Wei?l wrote: > Hello again, > > I found and fixed three other occurrences in the code base where the > endianness of doubles matters. After two weeks of testing I'm now fairly > confident that Erlang runs fine on our platform. > > All four commits have been pushed to a new branch: > > git fetch git://github.com/weisslj/otp.git fix-float-middle-endian > > https://github.com/weisslj/otp/compare/erlang:maint...fix-float-middle-endian > https://github.com/weisslj/otp/compare/erlang:maint...fix-float-middle-endian.patch > > Greetings, > > Johannes Wei?l > > > On Thu, May 30, 2013 at 10:07:10AM +0200, Johannes Wei?l wrote: >> This patch fixes matching of floating point numbers on middle-endian >> platforms (ARM in my case). The error can be reproduced in QEMU using >> this image: http://people.debian.org/~aurel32/qemu/armel/ >> It builds up on Mike Sperbers patch (OTP-10209). Without this patch, the >> float matching tests in bs_match_misc_SUITE fail. >> >> Here is a simple error example: >> 1> <<_,_,_,_,_,_,_,_>> =<<1.25/float>>. >> <<63,244,0,0,0,0,0,0>> >> 2> <<1.25/float>> =<<63,244,0,0,0,0,0,0>>. >> ** exception error: no match of right hand side value<<63,244,0,0,0,0,0,0>> > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches Hello, Fetched your patch and assigned it to be reviewed by the responsible team. Thanks, -- BR Fredrik Gustafsson Erlang OTP Team From fredrik@REDACTED Mon Jun 17 10:59:07 2013 From: fredrik@REDACTED (Fredrik) Date: Mon, 17 Jun 2013 10:59:07 +0200 Subject: [erlang-patches] httpc: Allow content body in DELETE requests In-Reply-To: References: Message-ID: <51BECFDB.1040209@erlang.org> On 06/14/2013 07:18 PM, James Wheare wrote: > Fetch command: > git fetch git://github.com/jwheare/otp.git httpc_delete_body > > Compare: https://github.com/jwheare/otp/compare/httpc_delete_body > Patch: https://github.com/jwheare/otp/compare/httpc_delete_body.patch > > lib/inets/src/http_client/httpc.erl | 2 +- > lib/inets/test/httpc_proxy_SUITE.erl | 17 +++++++++++++++++ > 2 files changed, 18 insertions(+), 1 deletion(-) > > --- > > httpc: Allow content body in DELETE requests > > This isn't illegal according to the HTTP spec as far as I can see. > Here's an example of a real world API that requires it: > https://stripe.com/docs/api/curl#cancel_subscription > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches Hello James, I've fetched your patch and assigned it to the responsible team for review. Thanks, -- BR Fredrik Gustafsson Erlang OTP Team From magnus@REDACTED Tue Jun 18 16:04:15 2013 From: magnus@REDACTED (Magnus Henoch) Date: Tue, 18 Jun 2013 15:04:15 +0100 Subject: [erlang-patches] Align line-initial commas with opening parenthesis Message-ID: This patch makes the Emacs erlang-mode accomodate the coding style where lists written across several lines have each line starting with a comma: [ just , like , this ] The current erlang-mode lines up the commas with the first list element ('just' in the sample above). With this change, the commas are lined up with the opening parenthesis. A more elaborate test case is included in the patch. As far as I can see, this doesn't affect code written according to the "normal" coding style. git fetch git://github.com/legoscia/otp.git line-initial-commas https://github.com/legoscia/otp/compare/legoscia:line-initial-commas https://github.com/legoscia/otp/compare/legoscia:line-initial-commas.patch Regards, Magnus From fredrik@REDACTED Tue Jun 18 16:07:06 2013 From: fredrik@REDACTED (Fredrik) Date: Tue, 18 Jun 2013 16:07:06 +0200 Subject: [erlang-patches] Align line-initial commas with opening parenthesis In-Reply-To: References: Message-ID: <51C0698A.5030805@erlang.org> On 06/18/2013 04:04 PM, Magnus Henoch wrote: > This patch makes the Emacs erlang-mode accomodate the coding style where > lists written across several lines have each line starting with a comma: > > [ just > , like > , this > ] > > The current erlang-mode lines up the commas with the first list element > ('just' in the sample above). With this change, the commas are lined up > with the opening parenthesis. A more elaborate test case is included in > the patch. > > As far as I can see, this doesn't affect code written according to the > "normal" coding style. > > git fetch git://github.com/legoscia/otp.git line-initial-commas > > https://github.com/legoscia/otp/compare/legoscia:line-initial-commas > https://github.com/legoscia/otp/compare/legoscia:line-initial-commas.patch > > Regards, > Magnus > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches Hello Magnus, I've fetched your patch and it will be visible in 'pu' when R16B01 has been released and it can earliest be included in R16B02. Thanks, -- BR Fredrik Gustafsson Erlang OTP Team From fredrik@REDACTED Tue Jun 18 16:36:12 2013 From: fredrik@REDACTED (Fredrik) Date: Tue, 18 Jun 2013 16:36:12 +0200 Subject: [erlang-patches] Allow rb to use any io_device/registered name instead of only filename path In-Reply-To: <51AE634D.7020608@wanadoo.fr> References: <51AB1928.3080503@wanadoo.fr> <51AD939B.80006@erlang.org> <51AE634D.7020608@wanadoo.fr> Message-ID: <51C0705C.9080301@erlang.org> On 06/04/2013 11:59 PM, PAILLEAU Eric wrote: > Le 04/06/2013 09:13, Fredrik a ?crit : >> On 06/02/2013 12:06 PM, PAILLEAU Eric wrote: >>> Hello, >>> Report Browser could not accept a file descriptor, >>> for instance given by another application. >>> this is a first patch needed in my wish to >>> add a graphical log browser in observer. >>> >>> git fetch https://github.com/crownedgrouse/otp.git add_fd_usage_in_rb >>> >>> https://github.com/crownedgrouse/otp/compare/erlang:maint...add_fd_usage_in_rb >>> >>> >>> https://github.com/crownedgrouse/otp/compare/erlang:maint...add_fd_usage_in_rb.patch >>> >>> >>> regards >>> >>> _______________________________________________ >>> erlang-patches mailing list >>> erlang-patches@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-patches >> Hello Eric, >> Your patch is failing the following testcases: >> Application: SASL, Suite: rb_SUITE, Testcase: list; >> Application: SASL, Suite: rb_SUITE, Testcase: rescan >> > Hello, > please refetch. > I came back to former behaviour for rb:list/1-2 functions, so the test > suite do not fail anymore. > I add 2 new exported function that allow to print list of reports in the > log file. > Regards > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches Hello Eric, We just stumbled across in your patch that you have merged maint into your patch, which you not should do. Do a rebase upon the latest maint branch on our github instead and notify us when done. Thanks, -- BR Fredrik Gustafsson Erlang OTP Team From fredrik@REDACTED Tue Jun 18 16:47:46 2013 From: fredrik@REDACTED (Fredrik) Date: Tue, 18 Jun 2013 16:47:46 +0200 Subject: [erlang-patches] Fix I/O-protocol handling in eunit In-Reply-To: <5190A291.1090308@erlang.org> References: <5190A291.1090308@erlang.org> Message-ID: <51C07312.10301@erlang.org> On 05/13/2013 10:21 AM, Fredrik wrote: > On 05/10/2013 11:09 PM, Yuki Ito wrote: >> Hi, >> >> Some io_requests, getopts, {get_geometry, rows} and {get_geometry, >> columns} in eunit raises unexpected error. >> >> For example, >> >> $ cat my_tests.erl >> -module(my_tests). >> -include_lib("eunit/include/eunit.hrl"). >> >> my_test() -> >> io:getopts(). >> >> 1> c(my_tests). >> {ok,my_tests} >> 2> eunit:test(my_tests). >> my_tests: my_test (module 'my_tests')...*skipped* >> undefined >> *unexpected termination of test process* >> ::{{badmatch,{error,{error,enotsup},[]}}, >> [{eunit_proc,io_request,4,[{file,"eunit_proc.erl"},{line,614}]}, >> >> {eunit_proc,group_leader_loop,3,[{file,"eunit_proc.erl"},{line,584}]}]} >> >> ======================================================= >> Failed: 0. Skipped: 0. Passed: 0. >> One or more tests were cancelled. >> error >> 3> >> =ERROR REPORT==== 11-May-2013::05:51:35 === >> Error in process <0.49.0> with exit value: >> {{badmatch,{error,{error,enotsup},[]}},[{eunit_proc,io_request,4,[{file,"eunit_proc.erl"},{line,614}]},{eunit_proc,group_leader_loop,3,[{file,"eunit_proc.erl"},{line,584}]}]} >> >> >> git fetch git@REDACTED:mururu/otp.git fix_eunit_io_protocol >> https://github.com/mururu/otp/compare/erlang:maint...fix_eunit_io_protocol >> https://github.com/mururu/otp/compare/erlang:maint...fix_eunit_io_protocol.patch >> >> Thanks. >> >> >> _______________________________________________ >> erlang-patches mailing list >> erlang-patches@REDACTED >> http://erlang.org/mailman/listinfo/erlang-patches > Hello Yuki, > I've fetched your branch and it is now located in the 'pu' branch for > further testing. > Thanks, > > -- > > BR Fredrik Gustafsson > Erlang OTP Team > > > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches Hello, Could you please provide a testcase for this? -- BR Fredrik Gustafsson Erlang OTP Team -------------- next part -------------- An HTML attachment was scrubbed... URL: From fredrik@REDACTED Tue Jun 18 16:59:39 2013 From: fredrik@REDACTED (Fredrik) Date: Tue, 18 Jun 2013 16:59:39 +0200 Subject: [erlang-patches] Fix I/O-protocol handling in eunit In-Reply-To: <51C07312.10301@erlang.org> References: <5190A291.1090308@erlang.org> <51C07312.10301@erlang.org> Message-ID: <51C075DB.6020703@erlang.org> On 06/18/2013 04:47 PM, Fredrik wrote: > On 05/13/2013 10:21 AM, Fredrik wrote: >> On 05/10/2013 11:09 PM, Yuki Ito wrote: >>> Hi, >>> >>> Some io_requests, getopts, {get_geometry, rows} and {get_geometry, >>> columns} in eunit raises unexpected error. >>> >>> For example, >>> >>> $ cat my_tests.erl >>> -module(my_tests). >>> -include_lib("eunit/include/eunit.hrl"). >>> >>> my_test() -> >>> io:getopts(). >>> >>> 1> c(my_tests). >>> {ok,my_tests} >>> 2> eunit:test(my_tests). >>> my_tests: my_test (module 'my_tests')...*skipped* >>> undefined >>> *unexpected termination of test process* >>> ::{{badmatch,{error,{error,enotsup},[]}}, >>> [{eunit_proc,io_request,4,[{file,"eunit_proc.erl"},{line,614}]}, >>> >>> {eunit_proc,group_leader_loop,3,[{file,"eunit_proc.erl"},{line,584}]}]} >>> >>> ======================================================= >>> Failed: 0. Skipped: 0. Passed: 0. >>> One or more tests were cancelled. >>> error >>> 3> >>> =ERROR REPORT==== 11-May-2013::05:51:35 === >>> Error in process <0.49.0> with exit value: >>> {{badmatch,{error,{error,enotsup},[]}},[{eunit_proc,io_request,4,[{file,"eunit_proc.erl"},{line,614}]},{eunit_proc,group_leader_loop,3,[{file,"eunit_proc.erl"},{line,584}]}]} >>> >>> >>> git fetch git@REDACTED:mururu/otp.git fix_eunit_io_protocol >>> https://github.com/mururu/otp/compare/erlang:maint...fix_eunit_io_protocol >>> https://github.com/mururu/otp/compare/erlang:maint...fix_eunit_io_protocol.patch >>> >>> Thanks. >>> >>> >>> _______________________________________________ >>> erlang-patches mailing list >>> erlang-patches@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-patches >> Hello Yuki, >> I've fetched your branch and it is now located in the 'pu' branch for >> further testing. >> Thanks, >> >> -- >> >> BR Fredrik Gustafsson >> Erlang OTP Team >> >> >> _______________________________________________ >> erlang-patches mailing list >> erlang-patches@REDACTED >> http://erlang.org/mailman/listinfo/erlang-patches > Hello, > Could you please provide a testcase for this? > > -- > > BR Fredrik Gustafsson > Erlang OTP Team > > > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches I just realized that eunit does not have any tests. Skip it, I will put it into building on more platforms when R16B01 has been released.. -- BR Fredrik Gustafsson Erlang OTP Team -------------- next part -------------- An HTML attachment was scrubbed... URL: From yuki.mururu@REDACTED Tue Jun 18 17:33:31 2013 From: yuki.mururu@REDACTED (Yuki Ito) Date: Wed, 19 Jun 2013 00:33:31 +0900 Subject: [erlang-patches] Fix I/O-protocol handling in eunit In-Reply-To: <51C075DB.6020703@erlang.org> References: <5190A291.1090308@erlang.org> <51C07312.10301@erlang.org> <51C075DB.6020703@erlang.org> Message-ID: Thank you. 2013/6/18 Fredrik > On 06/18/2013 04:47 PM, Fredrik wrote: > > On 05/13/2013 10:21 AM, Fredrik wrote: > > On 05/10/2013 11:09 PM, Yuki Ito wrote: > > Hi, > > Some io_requests, getopts, {get_geometry, rows} and {get_geometry, > columns} in eunit raises unexpected error. > > For example, > > $ cat my_tests.erl > -module(my_tests). > -include_lib("eunit/include/eunit.hrl"). > > my_test() -> > io:getopts(). > > 1> c(my_tests). > {ok,my_tests} > 2> eunit:test(my_tests). > my_tests: my_test (module 'my_tests')...*skipped* > undefined > *unexpected termination of test process* > ::{{badmatch,{error,{error,enotsup},[]}}, > [{eunit_proc,io_request,4,[{file,"eunit_proc.erl"},{line,614}]}, > > {eunit_proc,group_leader_loop,3,[{file,"eunit_proc.erl"},{line,584}]}]} > > ======================================================= > Failed: 0. Skipped: 0. Passed: 0. > One or more tests were cancelled. > error > 3> > =ERROR REPORT==== 11-May-2013::05:51:35 === > Error in process <0.49.0> with exit value: > {{badmatch,{error,{error,enotsup},[]}},[{eunit_proc,io_request,4,[{file,"eunit_proc.erl"},{line,614}]},{eunit_proc,group_leader_loop,3,[{file,"eunit_proc.erl"},{line,584}]}]} > > > git fetch git@REDACTED:mururu/otp.git fix_eunit_io_protocol > https://github.com/mururu/otp/compare/erlang:maint...fix_eunit_io_protocol > > https://github.com/mururu/otp/compare/erlang:maint...fix_eunit_io_protocol.patch > > Thanks. > > > _______________________________________________ > erlang-patches mailing listerlang-patches@REDACTED://erlang.org/mailman/listinfo/erlang-patches > > Hello Yuki, > I've fetched your branch and it is now located in the 'pu' branch for > further testing. > Thanks, > > -- > > BR Fredrik Gustafsson > Erlang OTP Team > > > > _______________________________________________ > erlang-patches mailing listerlang-patches@REDACTED://erlang.org/mailman/listinfo/erlang-patches > > Hello, > Could you please provide a testcase for this? > > -- > > BR Fredrik Gustafsson > Erlang OTP Team > > > > _______________________________________________ > erlang-patches mailing listerlang-patches@REDACTED://erlang.org/mailman/listinfo/erlang-patches > > I just realized that eunit does not have any tests. > Skip it, I will put it into building on more platforms when R16B01 has > been released.. > > > -- > > BR Fredrik Gustafsson > Erlang OTP Team > > -- ???? Yuki Ito yuki.mururu@REDACTED -------------- next part -------------- An HTML attachment was scrubbed... URL: From eric.pailleau@REDACTED Tue Jun 18 19:26:38 2013 From: eric.pailleau@REDACTED (PAILLEAU Eric) Date: Tue, 18 Jun 2013 19:26:38 +0200 Subject: [erlang-patches] Allow rb to use any io_device/registered name instead of only filename path In-Reply-To: <51C0705C.9080301@erlang.org> References: <51AB1928.3080503@wanadoo.fr> <51AD939B.80006@erlang.org> <51AE634D.7020608@wanadoo.fr> <51C0705C.9080301@erlang.org> Message-ID: <51C0984E.5090607@wanadoo.fr> _ >> erlang-patches mailing list >> erlang-patches@REDACTED >> http://erlang.org/mailman/listinfo/erlang-patches > Hello Eric, > We just stumbled across in your patch that you have merged maint into > your patch, > which you not should do. Do a rebase upon the latest maint branch on our > github instead and notify us when done. > Thanks, > Hello Fredrik, the first time you told me this, I though that I did a 'git merge', but no... The merge is done by the 'git push' after my commit, without any warning. By googling a bit, I found I need to add : git config --global --bool pull.rebase true or use git rebase -i @{u} before any push ... sorry for this, I'm using git only for otp and not a specialist ... I did a rebase, you can fetch now. I hope it is ok for you now... regards From erlangsiri@REDACTED Wed Jun 19 10:19:28 2013 From: erlangsiri@REDACTED (Siri Hansen) Date: Wed, 19 Jun 2013 10:19:28 +0200 Subject: [erlang-patches] Allow rb to use any io_device/registered name instead of only filename path In-Reply-To: <51C0984E.5090607@wanadoo.fr> References: <51AB1928.3080503@wanadoo.fr> <51AD939B.80006@erlang.org> <51AE634D.7020608@wanadoo.fr> <51C0705C.9080301@erlang.org> <51C0984E.5090607@wanadoo.fr> Message-ID: Hi Eric - I am looking at this patch, and I find the diff a bit strange. I see in the first commit that you updated the documentation (rb.xml) for e.g. rb:start: e.g. - FileName = string() | standard_io + FileName = string() | atom() | pid() but this is backed out again in your second commit, although is seems the code is still there (and, as far as I can understand, this functionality is also the main point of the patch). Could you please have a look at it? Did something go wrong in a merge or rebase? Regards /siri 2013/6/18 PAILLEAU Eric > _ > >> erlang-patches mailing list > >> erlang-patches@REDACTED > >> http://erlang.org/mailman/listinfo/erlang-patches > > Hello Eric, > > We just stumbled across in your patch that you have merged maint into > > your patch, > > which you not should do. Do a rebase upon the latest maint branch on our > > github instead and notify us when done. > > Thanks, > > > Hello Fredrik, > > the first time you told me this, I though that I did a 'git merge', but > no... > The merge is done by the 'git push' after my commit, without any warning. > By googling a bit, I found I need to add : > git config --global --bool pull.rebase true > > or use > git rebase -i @{u} > before any push ... > > sorry for this, I'm using git only for otp and not a specialist ... > > I did a rebase, you can fetch now. > I hope it is ok for you now... > > regards > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bgustavsson@REDACTED Wed Jun 19 15:16:36 2013 From: bgustavsson@REDACTED (=?UTF-8?Q?Bj=C3=B6rn_Gustavsson?=) Date: Wed, 19 Jun 2013 15:16:36 +0200 Subject: [erlang-patches] [eeps] EEP37: Funs with names In-Reply-To: References: <50A4FAA9.1070706@erlang.org> <466D4B3A-8B3C-4AA7-9A2B-B85EA5EA2A90@gmail.com> <819C7547-3B43-4F8E-A4E0-91B77C547600@gmail.com> <514981E0.9030209@erlang.org> <806DFCE7-CC09-46F9-8B71-F97CE9E04A39@gmail.com> <5149C8AE.8030509@erlang.org> Message-ID: The OTP Technical Board will discuss EEP37 at its next meeting. On Fri, Jun 7, 2013 at 6:24 PM, Anthony Ramine wrote: > Ping? > > -- > Anthony Ramine > > Le 21 avr. 2013 ? 22:17, Anthony Ramine a ?crit : > > > Hello, > > > > Any ETA for a review? > > > > Regards, > > > > On Wed, Mar 20, 2013 at 3:33 PM, Fredrik wrote: > >> On 03/20/2013 03:30 PM, Anthony Ramine wrote: > >>> > >>> Rebased! :) > >>> > >>> Does it mean it may be included before R17? Branch maint is for minor > >>> releases, right? > >>> > >> Right now im collecting all the patches active at the moment in pu. That > >> does not mean it will be included in a minor release. :) > >> > >> -- > >> > >> BR Fredrik Gustafsson > >> Erlang OTP Team > >> > > _______________________________________________ > eeps mailing list > eeps@REDACTED > http://erlang.org/mailman/listinfo/eeps > -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB -------------- next part -------------- An HTML attachment was scrubbed... URL: From fredrik@REDACTED Wed Jun 19 15:55:38 2013 From: fredrik@REDACTED (Fredrik) Date: Wed, 19 Jun 2013 15:55:38 +0200 Subject: [erlang-patches] make edlin understand a few important control keys In-Reply-To: <1367844839.31752.73.camel@ax-sze> References: <1367844839.31752.73.camel@ax-sze> Message-ID: <51C1B85A.3050109@erlang.org> On 05/06/2013 02:53 PM, Stefan Zegenhagen wrote: > Dear all, > > the patch attached to this e-mail teaches edlin.erl a few more important > control keys that many users might have become *VERY* accustomed to. The > control keys are: > > -+W : backward kill word > -+U : backward kill line > - : goto start of line > - : goto end of line > -+ : backward word > -+ : forward word > > With this patch in place, command line editing in erlang's own shell as > well as in any input using io:get_line() comes a little closer to that > in many contemporary shells. > > > Kind regards, > > > > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches Hello Stefan, I've gotten some feedback from your review, You need to add documentation under Erts-> "User's Guide" -> "tty - A command line interface" You need to add testcase in interactive_shell_SUITE a simplified example of how this testcase could look like; ctrl_w_and_ctrl_u(_Conf) -> rtnode([{putline,""}, {putline, "2."}, {getline, "2"}, {putline,"xxx yy"++[$\^w]++"."}, {getline,"xxx"}, {putline,"xxx yy"++[$\^u]++"z."}, {getline,"z"}],[]). -- BR Fredrik Gustafsson Erlang OTP Team -------------- next part -------------- An HTML attachment was scrubbed... URL: From erlangsiri@REDACTED Wed Jun 19 16:01:27 2013 From: erlangsiri@REDACTED (Siri Hansen) Date: Wed, 19 Jun 2013 16:01:27 +0200 Subject: [erlang-patches] Non-overlapping Application Distribution Node Sets In-Reply-To: <20130614033619.GF32127@aluminium.local> References: <20130503080752.GZ21384@aluminium> <51837891.9020207@erlang.org> <20130503134345.GB21384@aluminium> <5188BDFB.8090703@erlang.org> <20130508133013.GR31110@aluminium.local> <518A5581.2080401@erlang.org> <20130613091638.GE32127@aluminium.local> <20130614033619.GF32127@aluminium.local> Message-ID: Hi Vance, we have decided that we would like to take in this functionality if the bug I mentioned in my last mail is corrected and some more extensive tests are added. We also need an update of the documentation, of course. Thanks for your contribution! /siri 2013/6/14 Vance Shipley > On Thu, Jun 13, 2013 at 02:46:38PM +0530, Vance Shipley wrote: > } The use case is simply that we run the same application on each node in > } a distributed Erlang cluster and want to designate a standby node for > } each as depicted below: > > Siri, > > For further clarification I should add that the node pairs need to > know about each other because they use distributed mnesia. The node > pairs which may run an instance of an application each maintain a copy > of the mnesia tables which they need to run. If serverA fails node2 > will take over it's app1 instance and continue operation with the current > tables. The problem comes in with the fact that the active nodes all > use mnesia distribution and pg2 betwen them (e.g. node & node4) as well. > > -- > -Vance > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bgustavsson@REDACTED Wed Jun 19 16:45:59 2013 From: bgustavsson@REDACTED (=?UTF-8?Q?Bj=C3=B6rn_Gustavsson?=) Date: Wed, 19 Jun 2013 16:45:59 +0200 Subject: [erlang-patches] Limit maximum line length in interactive shells In-Reply-To: <1367936530.31752.96.camel@ax-sze> References: <1367929784.31752.94.camel@ax-sze> <1367936530.31752.96.camel@ax-sze> Message-ID: First, I'll quote a paragraph from https://github.com/erlang/otp/wiki/Submitting-patches: "If you submit a patch in a way other than what is described here, it implies more work for the Erlang/OTP team. In that case we cannot guarantee anything. It is up to the maintainer for that part of OTP to decide whether (s)he will pick up the patch." The patch also does not include a test case for the new functionality and has some code issues (e.g. "%" comments when the convention is to use "%%" comments). Therefore additional work is needed before it is ready for inclusion. Moving on to the problem that the patch addresses, the use case is not clear to us. If a user has access to an Erlang shell, there are many other ways in which (s)he could bring down the system. Therefore, it is not clear that you would gain very much by fixing this particular issue. For these reasons, we reject the patch. /Bjorn On Tue, May 7, 2013 at 4:22 PM, Stefan Zegenhagen < stefan.zegenhagen@REDACTED> wrote: > Dear all, > > > it seems as if I sent around the wrong version of the patch. Please find > the correct version attached to this e-mail. > > Kind regards, > > > > one of our testers found out that he could reliably reboot our > > erlang-based device by just sending tons of 'A' characters to an > > interactive shell. > > > > It appears that the I/O server of the interactive shell (in group.erl) > > is always reading a full line before doing any end-of-input processing, > > so that by sending bytes without a newline in between, it slowly eats up > > all available memory. > > > > The patch attached to this e-mail fixes that by introducing a new > > io:setopt() option in group.erl named 'max_length' that is used to check > > whether the current line length exceeds this maximum whenever the line > > is edited. If an overlong line is detected, max_length bytes are > > returned immediately (without the actual stop condition being fulfilled, > > though, allowing I/O clients to detect this situation). > > > > max_length is allowed to be an integer() > 0 or 'unlimited'. The default > > is 'unlimited' to have the old behaviour by default. > > > > > > > > Kind regards, > > > > _______________________________________________ > > erlang-patches mailing list > > erlang-patches@REDACTED > > http://erlang.org/mailman/listinfo/erlang-patches > > -- > Dr. Stefan Zegenhagen > > arcutronix GmbH > Garbsener Landstr. 10 > 30419 Hannover > Germany > > Tel: +49 511 277-2734 > Fax: +49 511 277-2709 > Email: stefan.zegenhagen@REDACTED > Web: www.arcutronix.com > > *Synchronize the Ethernet* > > General Managers: Dipl. Ing. Juergen Schroeder, Dr. Josef Gfrerer - > Legal Form: GmbH, Registered office: Hannover, HRB 202442, Amtsgericht > Hannover; Ust-Id: DE257551767. > > Please consider the environment before printing this message. > > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches > > -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB -------------- next part -------------- An HTML attachment was scrubbed... URL: From ali.sabil@REDACTED Wed Jun 19 22:41:35 2013 From: ali.sabil@REDACTED (Ali Sabil) Date: Wed, 19 Jun 2013 22:41:35 +0200 Subject: [erlang-patches] Fix the typespec for the inet:ifget/2 and inet:ifget/3 return value Message-ID: Hi, The typespecs for inet:ifget/2 and inet:ifget/3 dont include the loopback flag in the list of possible flags. This patch adds the missing information. git fetch git://github.com/asabil/otp.git fix-inet-typespec https://github.com/asabil/otp/compare/erlang:maint...fix-inet-typespec https://github.com/asabil/otp/compare/erlang:maint...fix-inet-typespec.patch Best, Ali -------------- next part -------------- An HTML attachment was scrubbed... URL: From Aleksander.Nycz@REDACTED Wed Jun 19 18:51:40 2013 From: Aleksander.Nycz@REDACTED (Aleksander Nycz) Date: Wed, 19 Jun 2013 18:51:40 +0200 Subject: [erlang-patches] New index type in mnesia (new feature) Message-ID: <51C1E19C.2070000@comarch.pl> Hello, Mnesia gives possibility to create table indexes, when the user wants to frequently use some other field than the key field to look up records. Current index solution in mnesia uses ets table (type bag or duplicated_bag) to maintain mapping: Indexed field value -> Primary key value. Unfortunatelly current solution has very significant disadvantage: operation performance (loading table, insert new records, delete records, etc.) is very low when index is set on 'Low-cardinality column' http://en.wikipedia.org/wiki/Cardinality_%28SQL_statements%29 In such case operation complexity is O(n) when n is number of Primary Key Values. For small n performance can be acceptable for some application, but when n is the hundreds, thousands or even more such index are useless. New index type provides O(1) complexity. This patch introduces new index type in mnesia database. Main concept is to maintain all Primary Key Values not direcly in bag/duplicated_bag ets but in set of ets. For each Indexed field value new ets is created and Primary Key Values are strored in this ets. For 'Low-cardinality column' there is only a few Indexed key value (eg. isActive (true/false), state (new/pending/suspended/active), ...) so memory overhead for ets is not significant. Standard index: Indexed field value -> [Primary key value] New index based on ets: Indexed field value -> ets, that contains Primary key value Restrictions: 1. New index can be created on disc_copies or ram_copies tables only. Tables disc_only_copies are not supported. 2. Index type can't be changed. The only way to change existing index idx_list to idx_ets and vice versa is to delete existing index and create new one by mnesia:add_table_index/3 (new function, see below) New API: 1. Define index type when table is created: create_table(Name, TabDef) -> {atomic, ok} | {aborted, Reason} New TabDef value: {index_type, [{atom() | int(), 'idx_std' | 'idx_ets'}]} - 'idx_std' is default when index is created Example: -type(poolId() :: integer()). -type(bucketId() :: integer()). -type(resourceState() :: free | reserved | gracePeriod). -record(rmResource, {id :: {poolId(), any()} ,state :: {poolId(), bucketId(), resourceState()} ,availableFrom :: integer() ,availableTo :: integer() ,requestorId :: any() ,reservedFrom :: integer() ,reservedTo :: integer() ,isDeleted = false :: boolean() ,mTime :: integer()}). {atomic,ok} = mnesia:create_table(tRMResources ,[ {disc_copies, []} ,{ram_copies, [node()]} ,{type,set} ,{attributes,record_info(fields, rmResource)} ,{record_name, rmResource} ,{index, [state, requestorId, mTime]} ,{index_type, [{state, idx_ets}, {requestorId, idx_std}]} ]), 2. Add new index to existing table: mnesia:add_table_index(Tab, AttrName, IndexOpts) -> {aborted, R} | {atomic, ok} This function creates a index on Mnesia table called Tab on AttrName field according to the argument IndexOpts. This list must be a list of {Item, Value} tuples, currently only one option is allowed: {index_type, 'idx_std' | 'idx_ets'} Example: mnesia:add_table_index(tRMResources, isDeleted, [{index_type, 'idx_ets'}]) 3. New match_object/4, dirty_match_object/3 functions: match_object(Tab, Pat, Limit, LockKind) -> [Record] | transaction abort. dirty_match_object(Tab, Pat, Limit) -> [Record] | exit({aborted, Reason}). Similar to match_object/3 and dirty_match_object/2, but returns no more than Limit records. 4. New index_match_object/5, dirty_index_match_object/4 functions: index_match_object(Tab, Pat, Attr, Limit, LockKind) -> [Record] | transaction abort. dirty_index_match_object(Tab, Pat, Attr, Limit) -> [Record] | exit({aborted, Reason}). Similar to index_match_object/4, dirty_index_match_object/3 but returns no more than Limit records. 5. New index_read/4, dirty_index_read/4 functions: index_read(Tab, Key, Attr, Limit) -> [Record] | transaction abort. dirty_index_read(Tab, Key, Attr, Limit) -> [Record] | exit({aborted, Reason}). Similar to index_read/3, dirty_index_read/3 but returns no more than Limit records. 6. New select_limit/3, select_limit/4, dirty_select/3 functions; select_limit(Tab, MatchSpec, NObjects [, Lock]) -> [Object] | transaction abort. Similar to select(Tab, MatchSpec [, Lock]) but returns maximum NObjects records, of course empty list can also be returned. Continuation (see select/4) is not possible. This function can also use indexes to find matching records as contrasted with select/4. dirty_select(Tab, Spec, Limit) -> [Object] | exit({aborted, Reason}. Similar to dirty_select/2 but returns no more than Limit records. And git links: git fetch git://github.com/nyczol/otp.git mnesia_new_index https://github.com/nyczol/otp/compare/erlang:master...mnesia_new_index https://github.com/nyczol/otp/compare/erlang:master...mnesia_new_index.patch Regards, Aleksander Nycz -- Aleksander Nycz Senior Software Engineer Telco_021 BSS R&D Comarch SA Phone: +48 12 646 1216 Mobile: +48 691 464 275 website: www.comarch.pl -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2182 bytes Desc: Kryptograficzna sygnatura S/MIME URL: From eric.pailleau@REDACTED Wed Jun 19 23:23:43 2013 From: eric.pailleau@REDACTED (PAILLEAU Eric) Date: Wed, 19 Jun 2013 23:23:43 +0200 Subject: [erlang-patches] Allow rb to use any io_device/registered name instead of only filename path In-Reply-To: References: <51AB1928.3080503@wanadoo.fr> <51AD939B.80006@erlang.org> <51AE634D.7020608@wanadoo.fr> <51C0705C.9080301@erlang.org> <51C0984E.5090607@wanadoo.fr> Message-ID: <51C2215F.3010009@wanadoo.fr> Le 19/06/2013 10:19, Siri Hansen a ?crit : > Hi Eric - I am looking at this patch, and I find the diff a bit strange. > I see in the first commit that you updated the documentation (rb.xml) > for e.g. rb:start: > > e.g. > - FileName = string() | standard_io > + FileName = string() | atom() | pid() > > but this is backed out again in your second commit, although is seems > the code is still there (and, as far as I can understand, this > functionality is also the main point of the patch). Could you please > have a look at it? Did something go wrong in a merge or rebase? > > Regards Hello Siri, yes you are true. I fixed this. Fredik can refetch. Regards From dangud@REDACTED Wed Jun 19 23:30:32 2013 From: dangud@REDACTED (Dan Gudmundsson) Date: Wed, 19 Jun 2013 23:30:32 +0200 Subject: [erlang-patches] New index type in mnesia (new feature) In-Reply-To: <51C1E19C.2070000@comarch.pl> References: <51C1E19C.2070000@comarch.pl> Message-ID: There is a patch included in the today's release that address this issue in a simpler way, for set (and ordered set if I remember correctly). Can you check if the performance is good enough for you in R16B01. /Dan On Wed, Jun 19, 2013 at 6:51 PM, Aleksander Nycz wrote: > Hello, > > Mnesia gives possibility to create table indexes, when > the user wants to frequently use some other field > than the key field to look up records. > > Current index solution in mnesia uses ets table (type bag or > duplicated_bag) to maintain mapping: > Indexed field value -> Primary key value. > > Unfortunatelly current solution has very significant disadvantage: > operation performance (loading table, insert new records, > delete records, etc.) is very low when index is set on 'Low-cardinality > column' > > http://en.wikipedia.org/wiki/**Cardinality_%28SQL_statements%**29 > > In such case operation complexity is O(n) when n is number > of Primary Key Values. For small n performance can be acceptable for some > application, > but when n is the hundreds, thousands or even more such index > are useless. New index type provides O(1) complexity. > > This patch introduces new index type in mnesia database. > Main concept is to maintain all Primary Key Values not direcly in > bag/duplicated_bag ets but in set of ets. > For each Indexed field value new ets is created > and Primary Key Values are strored in this ets. > For 'Low-cardinality column' there is only a few Indexed key value (eg. > isActive (true/false), state (new/pending/suspended/active)**, ...) > so memory overhead for ets is not significant. > > Standard index: > Indexed field value -> [Primary key value] > > New index based on ets: > Indexed field value -> ets, that contains Primary key value > > Restrictions: > > 1. New index can be created on disc_copies or ram_copies tables only. > Tables disc_only_copies are not supported. > 2. Index type can't be changed. The only way to change existing index > idx_list to idx_ets and vice versa > is to delete existing index and create new one by > mnesia:add_table_index/3 (new function, see below) > > > New API: > > 1. Define index type when table is created: > > create_table(Name, TabDef) -> {atomic, ok} | {aborted, Reason} > > New TabDef value: > {index_type, [{atom() | int(), 'idx_std' | 'idx_ets'}]} - 'idx_std' is > default when index is created > > Example: > > -type(poolId() :: integer()). > -type(bucketId() :: integer()). > -type(resourceState() :: free | reserved | gracePeriod). > > -record(rmResource, {id :: {poolId(), > any()} > ,state :: {poolId(), > bucketId(), resourceState()} > ,availableFrom :: integer() > ,availableTo :: integer() > ,requestorId :: any() > ,reservedFrom :: integer() > ,reservedTo :: integer() > ,isDeleted = false :: boolean() > ,mTime :: integer()}). > > {atomic,ok} = mnesia:create_table(**tRMResources > ,[ > {disc_copies, []} > ,{ram_copies, [node()]} > ,{type,set} > ,{attributes,record_info(**fields, rmResource)} > ,{record_name, rmResource} > ,{index, [state, requestorId, > mTime]} > ,{index_type, [{state, idx_ets}, > {requestorId, idx_std}]} > ]), > > 2. Add new index to existing table: > > mnesia:add_table_index(Tab, AttrName, IndexOpts) -> {aborted, R} | > {atomic, ok} > > This function creates a index on Mnesia table called Tab on AttrName > field according to the argument IndexOpts. > This list must be a list of {Item, Value} tuples, currently only one > option is allowed: > {index_type, 'idx_std' | 'idx_ets'} > > Example: > > mnesia:add_table_index(**tRMResources, isDeleted, [{index_type, > 'idx_ets'}]) > > 3. New match_object/4, dirty_match_object/3 functions: > > match_object(Tab, Pat, Limit, LockKind) -> [Record] | transaction abort. > dirty_match_object(Tab, Pat, Limit) -> [Record] | exit({aborted, Reason}). > > Similar to match_object/3 and dirty_match_object/2, but returns no more > than Limit records. > > > 4. New index_match_object/5, dirty_index_match_object/4 functions: > > index_match_object(Tab, Pat, Attr, Limit, LockKind) -> [Record] | > transaction abort. > dirty_index_match_object(Tab, Pat, Attr, Limit) -> [Record] | > exit({aborted, Reason}). > > Similar to index_match_object/4, dirty_index_match_object/3 but returns no > more than Limit records. > > > 5. New index_read/4, dirty_index_read/4 functions: > > index_read(Tab, Key, Attr, Limit) -> [Record] | transaction abort. > dirty_index_read(Tab, Key, Attr, Limit) -> [Record] | exit({aborted, > Reason}). > > Similar to index_read/3, dirty_index_read/3 but returns no more than Limit > records. > > > 6. New select_limit/3, select_limit/4, dirty_select/3 functions; > > select_limit(Tab, MatchSpec, NObjects [, Lock]) -> [Object] | transaction > abort. > > Similar to select(Tab, MatchSpec [, Lock]) but returns maximum NObjects > records, of course empty list can also be returned. > Continuation (see select/4) is not possible. This function can also use > indexes to find matching records > as contrasted with select/4. > > dirty_select(Tab, Spec, Limit) -> [Object] | exit({aborted, Reason}. > > Similar to dirty_select/2 but returns no more than Limit records. > > And git links: > > git fetch git://github.com/nyczol/otp.**gitmnesia_new_index > > https://github.com/nyczol/otp/**compare/erlang:master...**mnesia_new_index > https://github.com/nyczol/otp/**compare/erlang:master...** > mnesia_new_index.patch > > Regards, > Aleksander Nycz > > -- > Aleksander Nycz > Senior Software Engineer > Telco_021 BSS R&D > Comarch SA > Phone: +48 12 646 1216 > Mobile: +48 691 464 275 > website: www.comarch.pl > > > > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lpgauth@REDACTED Thu Jun 20 07:59:29 2013 From: lpgauth@REDACTED (Louis-Philippe Gauthier) Date: Thu, 20 Jun 2013 01:59:29 -0400 Subject: [erlang-patches] Add support for "zlib@openssh.com" compression (SSH) Message-ID: Hi, I added support for "zlib@REDACTED" compression type for ssh transports. http://tools.ietf.org/html/draft-miller-secsh-compression-delayed-00 e.g. 1> application:start(crypto). ok 2> application:start(asn1). ok 3> application:start(public_key). ok 3> application:start(ssh). ok 4> ssh:connect("38.71.4.132", 22, [{compression, openssh_zlib}]). {ok,<0.57.0>} Here's the branch / patch: git fetch git://github.com/lpgauth/otp.git openssh_zlib https://github.com/lpgauth/otp/compare/maint...openssh_zlib.patch LP -------------- next part -------------- An HTML attachment was scrubbed... URL: From fredrik@REDACTED Thu Jun 20 09:49:48 2013 From: fredrik@REDACTED (Fredrik) Date: Thu, 20 Jun 2013 09:49:48 +0200 Subject: [erlang-patches] Fix the typespec for the inet:ifget/2 and inet:ifget/3 return value In-Reply-To: References: Message-ID: <51C2B41C.2050808@erlang.org> On 06/19/2013 10:41 PM, Ali Sabil wrote: > Hi, > > The typespecs for inet:ifget/2 and inet:ifget/3 dont include the > loopback flag > in the list of possible flags. This patch adds the missing information. > > git fetch git://github.com/asabil/otp.git > fix-inet-typespec > > https://github.com/asabil/otp/compare/erlang:maint...fix-inet-typespec > > https://github.com/asabil/otp/compare/erlang:maint...fix-inet-typespec.patch > > Best, > Ali > > > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches Hello, I've fetched your patch and it should be visible in the 'pu' branch shortly. Thanks, -- BR Fredrik Gustafsson Erlang OTP Team -------------- next part -------------- An HTML attachment was scrubbed... URL: From fredrik@REDACTED Thu Jun 20 09:52:18 2013 From: fredrik@REDACTED (Fredrik) Date: Thu, 20 Jun 2013 09:52:18 +0200 Subject: [erlang-patches] Allow rb to use any io_device/registered name instead of only filename path In-Reply-To: <51C2215F.3010009@wanadoo.fr> References: <51AB1928.3080503@wanadoo.fr> <51AD939B.80006@erlang.org> <51AE634D.7020608@wanadoo.fr> <51C0705C.9080301@erlang.org> <51C0984E.5090607@wanadoo.fr> <51C2215F.3010009@wanadoo.fr> Message-ID: <51C2B4B2.6010204@erlang.org> On 06/19/2013 11:23 PM, PAILLEAU Eric wrote: > Le 19/06/2013 10:19, Siri Hansen a ?crit : >> Hi Eric - I am looking at this patch, and I find the diff a bit strange. >> I see in the first commit that you updated the documentation (rb.xml) >> for e.g. rb:start: >> >> e.g. >> -FileName = string() | standard_io >> +FileName = string() | atom() | pid() >> >> but this is backed out again in your second commit, although is seems >> the code is still there (and, as far as I can understand, this >> functionality is also the main point of the patch). Could you please >> have a look at it? Did something go wrong in a merge or rebase? >> >> Regards > Hello Siri, > yes you are true. > I fixed this. > Fredik can refetch. > Regards Re-fetched. Thanks, -- BR Fredrik Gustafsson Erlang OTP Team From fredrik@REDACTED Thu Jun 20 09:57:23 2013 From: fredrik@REDACTED (Fredrik) Date: Thu, 20 Jun 2013 09:57:23 +0200 Subject: [erlang-patches] Add support for "zlib@openssh.com" compression (SSH) In-Reply-To: References: Message-ID: <51C2B5E3.8080709@erlang.org> On 06/20/2013 07:59 AM, Louis-Philippe Gauthier wrote: > > Hi, > > I added support for "zlib@REDACTED " > compression type for ssh transports. > > http://tools.ietf.org/html/draft-miller-secsh-compression-delayed-00 > > e.g. > 1> application:start(crypto). > ok > 2> application:start(asn1). > ok > 3> application:start(public_key). > ok > 3> application:start(ssh). > ok > 4> ssh:connect("38.71.4.132", 22, [{compression, openssh_zlib}]). > {ok,<0.57.0>} > > Here's the branch / patch: > > git fetch git://github.com/lpgauth/otp.git > openssh_zlib > https://github.com/lpgauth/otp/compare/maint...openssh_zlib.patch > > LP > > > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches Hello, I've fetched your branch and created a ticket for review. It should be visible in the 'pu' branch shortly. Thanks, -- BR Fredrik Gustafsson Erlang OTP Team -------------- next part -------------- An HTML attachment was scrubbed... URL: From stefan.zegenhagen@REDACTED Thu Jun 20 10:23:53 2013 From: stefan.zegenhagen@REDACTED (Stefan Zegenhagen) Date: Thu, 20 Jun 2013 10:23:53 +0200 Subject: [erlang-patches] Limit maximum line length in interactive shells In-Reply-To: References: <1367929784.31752.94.camel@ax-sze> <1367936530.31752.96.camel@ax-sze> Message-ID: <1371716633.4174.16.camel@ax-sze> Dear Bj?rn, > Moving on to the problem that the patch addresses, > the use case is not clear to us. > > > If a user has access to an Erlang shell, > > there are many other ways in which (s)he > could bring down the system. Therefore, it is not > clear that you would gain very much by fixing this > particular issue. Just to make myself absolutely clear: we are producing a device that has a serial port for the user to access *OUR OWN* device specific CLI. We are using the bits and pieces that erlang provides: namely group.erl as the I/O server for the interactive shell. The user *DOES HAVE TO LOGIN* to the device in order to access any functionality. Our CLI implementation does naturally use the I/O server group.erl to input username/password. How else would we do that? It is possible for the user to crash the erlang system *WITHOUT LOGGING ON* by just sending tons of data to the serial port without a newline in between instead of a username or password. It works, just try it. A bad-minded person can crash the system *WITHOUT BEING AUTHENTICATED*, just by having physical access to the device. The effect is running out of memory and dramatically slowing the system down due to the amount of data that needs to be handed by group.erl (and garbage collection, etc), which might cause other software failures even before erlang finally crashes. I would deem such an unauthenticated method to crash any erlang system that uses group.erl for interactive shells *A SEVERE SECURITY ISSUE*. You only need physical access to the device. But since there is a serial management port, I would assume that you can guess that physical access to the device is nothing that is excluded from the use cases of it. > For these reasons, we reject the patch. I think it is very sad that this patch is being rejected and I will free to raise this issue as severe security "feature" on erlang-bugs again until it is solved! Please note that other erlang components, e.g. erlang SSH, are also using group.erl as their I/O server for line-based input/output of user data. Regards, -- Dr. Stefan Zegenhagen arcutronix GmbH Garbsener Landstr. 10 30419 Hannover Germany Tel: +49 511 277-2734 Fax: +49 511 277-2709 Email: stefan.zegenhagen@REDACTED Web: www.arcutronix.com *Synchronize the Ethernet* General Managers: Dipl. Ing. Juergen Schroeder, Dr. Josef Gfrerer - Legal Form: GmbH, Registered office: Hannover, HRB 202442, Amtsgericht Hannover; Ust-Id: DE257551767. Please consider the environment before printing this message. From mononcqc@REDACTED Thu Jun 20 20:16:11 2013 From: mononcqc@REDACTED (Fred Hebert) Date: Thu, 20 Jun 2013 14:16:11 -0400 Subject: [erlang-patches] add application:start_all/1-2 (recursive OTP app starting) Message-ID: <20130620181610.GB93763@ferdair.local> This adds two new functions to the application module that will recursively look for missing dependencies to start the entire dependency chain of a given application, and then the application itself, if possible. Its entire behavior is based on the currently existing 'start/1-2' functions, which will report dependencies that have not yet been started and other problems encountered. 'start_all/1-2' will use this information the way any programmer would manually do it to automate the process. This kind of functionality, while not OTP-ish (releases do this start sequence for the user), is still useful for testing purposes, quick demonstrations, and programmers who do not wish or know how to use OTP releases. The function returns 'ok' for all started or already started applications, and will return '{error, {AppName, Reason}}' on a failure to allow users to rapidly know why the function failed. I decided to call it start_all even though its semantics are somewhat similar to ensure_start in how it ignores already_started applications, but am open to changing the name if the OTP team prefers 'ensure_all/1-2' as functions for this module. Documentation has been added, and so were tests, looking for a few simple case: simple app, app with a dependency, and apps with a 3rd-level dependency not booting, all locally. Note that no specific check is made for direct or indirect circular dependencies between applications, and these will make the function go in an infinite loop. git fetch git://github.com/ferd/otp.git start-all https://github.com/ferd/otp/compare/erlang:maint...start-all https://github.com/ferd/otp/compare/erlang:maint...start-all.patch Regards, Fred Hebert. From aleksander.nycz@REDACTED Fri Jun 21 18:35:26 2013 From: aleksander.nycz@REDACTED (aleksander.nycz@REDACTED) Date: Fri, 21 Jun 2013 18:35:26 +0200 (CEST) Subject: [erlang-patches] New index type in mnesia (new feature) In-Reply-To: References: <51C1E19C.2070000@comarch.pl> Message-ID: <39731.89.66.142.184.1371832526.squirrel@wmail.comarch.com> Hello, Unfortunatelly patch in R16B01 does't fix all performance problem for low cardinality columns. I've prepared simple benchmark for otp_R16B, otp_R16B01 and otp_R16B01 with mnesia new index patch. File test.erl shouls be run on otp_R16B, otp_R16B01 and test2.erl on otp_R16B01 with mnesia new index patch. In atachement benchmark results from my laptop (ubuntu 13.04, 4 core, 4GB RAM). Please note that patch, that was applied in R1601 fix only problem with insert operation (was bag in R16B, is duplicated_bag in R16B01): {{TableType, Storage, IndexesAndType, Unused}, TransactionContext, Operation, Records, OperationTime [us], Rec/sec} otp_R16: {{set,ram_copies,[state],[]},async_dirty,'Insert',10000,754401,13255.55}, otp_R16B01: {{set,ram_copies,[state],[]},async_dirty,'Insert',10000,111412,89756.94}, but write and delete operations are still very slow: {{set,ram_copies,[state],[]},async_dirty,'UpdateStateField',10000,3107059,3218.48}, {{set,ram_copies,[state],[]},async_dirty,'UpdatemTimeField',10000,2920105,3424.53}, {{set,ram_copies,[state],[]},async_dirty,'Delete',10000,1445054,6920.16}, In my solution, there is no necessity to iterate long lists (in case of low cardinality column), but Primary key value are deleted/inserted from/info ets. Below benchmark result for my solution with new index type: {{set,ram_copies,{state,idx_ets},[]},async_dirty,'Insert',10000,122417,81688.00}, {{set,ram_copies,{state,idx_ets},[]},async_dirty,'UpdateStateField',10000,149560,66862.80}, {{set,ram_copies,{state,idx_ets},[]},async_dirty,'UpdatemTimeField',10000,146501,68258.92}, {{set,ram_copies,{state,idx_ets},[]},async_dirty,'Delete',10000,103037,97052.52} Please run this benchmarks on your machine and check results. Regards Aleksander Nycz > There is a patch included in the today's release that address this issue > in > a simpler way, > for set (and ordered set if I remember correctly). > > Can you check if the performance is good enough for you in R16B01. > > /Dan > > > On Wed, Jun 19, 2013 at 6:51 PM, Aleksander Nycz > > wrote: > >> Hello, >> >> Mnesia gives possibility to create table indexes, when >> the user wants to frequently use some other field >> than the key field to look up records. >> >> Current index solution in mnesia uses ets table (type bag or >> duplicated_bag) to maintain mapping: >> Indexed field value -> Primary key value. >> >> Unfortunatelly current solution has very significant disadvantage: >> operation performance (loading table, insert new records, >> delete records, etc.) is very low when index is set on 'Low-cardinality >> column' >> >> http://en.wikipedia.org/wiki/**Cardinality_%28SQL_statements%**29 >> >> In such case operation complexity is O(n) when n is number >> of Primary Key Values. For small n performance can be acceptable for >> some >> application, >> but when n is the hundreds, thousands or even more such index >> are useless. New index type provides O(1) complexity. >> >> This patch introduces new index type in mnesia database. >> Main concept is to maintain all Primary Key Values not direcly in >> bag/duplicated_bag ets but in set of ets. >> For each Indexed field value new ets is created >> and Primary Key Values are strored in this ets. >> For 'Low-cardinality column' there is only a few Indexed key value (eg. >> isActive (true/false), state (new/pending/suspended/active)**, ...) >> so memory overhead for ets is not significant. >> >> Standard index: >> Indexed field value -> [Primary key value] >> >> New index based on ets: >> Indexed field value -> ets, that contains Primary key value >> >> Restrictions: >> >> 1. New index can be created on disc_copies or ram_copies tables only. >> Tables disc_only_copies are not supported. >> 2. Index type can't be changed. The only way to change existing index >> idx_list to idx_ets and vice versa >> is to delete existing index and create new one by >> mnesia:add_table_index/3 (new function, see below) >> >> >> New API: >> >> 1. Define index type when table is created: >> >> create_table(Name, TabDef) -> {atomic, ok} | {aborted, Reason} >> >> New TabDef value: >> {index_type, [{atom() | int(), 'idx_std' | 'idx_ets'}]} - 'idx_std' is >> default when index is created >> >> Example: >> >> -type(poolId() :: integer()). >> -type(bucketId() :: integer()). >> -type(resourceState() :: free | reserved | gracePeriod). >> >> -record(rmResource, {id :: {poolId(), >> any()} >> ,state :: {poolId(), >> bucketId(), resourceState()} >> ,availableFrom :: integer() >> ,availableTo :: integer() >> ,requestorId :: any() >> ,reservedFrom :: integer() >> ,reservedTo :: integer() >> ,isDeleted = false :: boolean() >> ,mTime :: integer()}). >> >> {atomic,ok} = mnesia:create_table(**tRMResources >> ,[ >> {disc_copies, []} >> ,{ram_copies, [node()]} >> ,{type,set} >> ,{attributes,record_info(**fields, rmResource)} >> ,{record_name, rmResource} >> ,{index, [state, requestorId, >> mTime]} >> ,{index_type, [{state, idx_ets}, >> {requestorId, idx_std}]} >> ]), >> >> 2. Add new index to existing table: >> >> mnesia:add_table_index(Tab, AttrName, IndexOpts) -> {aborted, R} | >> {atomic, ok} >> >> This function creates a index on Mnesia table called Tab on AttrName >> field according to the argument IndexOpts. >> This list must be a list of {Item, Value} tuples, currently only one >> option is allowed: >> {index_type, 'idx_std' | 'idx_ets'} >> >> Example: >> >> mnesia:add_table_index(**tRMResources, isDeleted, [{index_type, >> 'idx_ets'}]) >> >> 3. New match_object/4, dirty_match_object/3 functions: >> >> match_object(Tab, Pat, Limit, LockKind) -> [Record] | transaction abort. >> dirty_match_object(Tab, Pat, Limit) -> [Record] | exit({aborted, >> Reason}). >> >> Similar to match_object/3 and dirty_match_object/2, but returns no more >> than Limit records. >> >> >> 4. New index_match_object/5, dirty_index_match_object/4 functions: >> >> index_match_object(Tab, Pat, Attr, Limit, LockKind) -> [Record] | >> transaction abort. >> dirty_index_match_object(Tab, Pat, Attr, Limit) -> [Record] | >> exit({aborted, Reason}). >> >> Similar to index_match_object/4, dirty_index_match_object/3 but returns >> no >> more than Limit records. >> >> >> 5. New index_read/4, dirty_index_read/4 functions: >> >> index_read(Tab, Key, Attr, Limit) -> [Record] | transaction abort. >> dirty_index_read(Tab, Key, Attr, Limit) -> [Record] | exit({aborted, >> Reason}). >> >> Similar to index_read/3, dirty_index_read/3 but returns no more than >> Limit >> records. >> >> >> 6. New select_limit/3, select_limit/4, dirty_select/3 functions; >> >> select_limit(Tab, MatchSpec, NObjects [, Lock]) -> [Object] | >> transaction >> abort. >> >> Similar to select(Tab, MatchSpec [, Lock]) but returns maximum NObjects >> records, of course empty list can also be returned. >> Continuation (see select/4) is not possible. This function can also use >> indexes to find matching records >> as contrasted with select/4. >> >> dirty_select(Tab, Spec, Limit) -> [Object] | exit({aborted, Reason}. >> >> Similar to dirty_select/2 but returns no more than Limit records. >> >> And git links: >> >> git fetch >> git://github.com/nyczol/otp.**gitmnesia_new_index >> >> https://github.com/nyczol/otp/**compare/erlang:master...**mnesia_new_index >> https://github.com/nyczol/otp/**compare/erlang:master...** >> mnesia_new_index.patch >> >> Regards, >> Aleksander Nycz >> >> -- >> Aleksander Nycz >> Senior Software Engineer >> Telco_021 BSS R&D >> Comarch SA >> Phone: +48 12 646 1216 >> Mobile: +48 691 464 275 >> website: www.comarch.pl >> >> >> >> _______________________________________________ >> erlang-patches mailing list >> erlang-patches@REDACTED >> http://erlang.org/mailman/listinfo/erlang-patches >> >> > -------------- next part -------------- A non-text attachment was scrubbed... Name: test2.erl Type: text/x-erlang Size: 3834 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: test.erl Type: text/x-erlang Size: 3857 bytes Desc: not available URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: benchmark_result.txt URL: From jargon@REDACTED Sat Jun 22 20:37:00 2013 From: jargon@REDACTED (Johannes =?utf-8?B?V2Vpw59s?=) Date: Sat, 22 Jun 2013 20:37:00 +0200 Subject: [erlang-patches] Fix httpd config option 'erl_script_nocache' Message-ID: <20130622183700.GA8171@molb.org> Hello! This patch fixes the usage of the httpd configuration option 'erl_script_nocache', which got ignored before. git fetch git://github.com/weisslj/otp.git fix-httpd-erl-script-nocache https://github.com/weisslj/otp/compare/erlang:maint...fix-httpd-erl-script-nocache https://github.com/weisslj/otp/compare/erlang:maint...fix-httpd-erl-script-nocache.patch Greetings, Johannes Wei?l From fredrik@REDACTED Mon Jun 24 09:00:03 2013 From: fredrik@REDACTED (Fredrik) Date: Mon, 24 Jun 2013 09:00:03 +0200 Subject: [erlang-patches] add application:start_all/1-2 (recursive OTP app starting) In-Reply-To: <20130620181610.GB93763@ferdair.local> References: <20130620181610.GB93763@ferdair.local> Message-ID: <51C7EE73.9080606@erlang.org> On 06/20/2013 08:16 PM, Fred Hebert wrote: > This adds two new functions to the application module that will > recursively look for missing dependencies to start the entire dependency > chain of a given application, and then the application itself, if > possible. > > Its entire behavior is based on the currently existing 'start/1-2' > functions, which will report dependencies that have not yet been started > and other problems encountered. 'start_all/1-2' will use this > information the way any programmer would manually do it to automate the > process. > > This kind of functionality, while not OTP-ish (releases do this start > sequence for the user), is still useful for testing purposes, quick > demonstrations, and programmers who do not wish or know how to use OTP > releases. > > The function returns 'ok' for all started or already started > applications, and will return '{error, {AppName, Reason}}' on a failure > to allow users to rapidly know why the function failed. > > I decided to call it start_all even though its semantics are somewhat > similar to ensure_start in how it ignores already_started applications, > but am open to changing the name if the OTP team prefers > 'ensure_all/1-2' as functions for this module. > > Documentation has been added, and so were tests, looking for a few > simple case: simple app, app with a dependency, and apps with a > 3rd-level dependency not booting, all locally. > > Note that no specific check is made for direct or indirect circular > dependencies between applications, and these will make the function go > in an infinite loop. > > git fetch git://github.com/ferd/otp.git start-all > > https://github.com/ferd/otp/compare/erlang:maint...start-all > https://github.com/ferd/otp/compare/erlang:maint...start-all.patch > > Regards, > Fred Hebert. > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches Hello Fred, I've fetched your patch and assigned it to be reviewed. Thanks, -- BR Fredrik Gustafsson Erlang OTP Team From fredrik@REDACTED Mon Jun 24 09:09:09 2013 From: fredrik@REDACTED (Fredrik) Date: Mon, 24 Jun 2013 09:09:09 +0200 Subject: [erlang-patches] Fix httpd config option 'erl_script_nocache' In-Reply-To: <20130622183700.GA8171@molb.org> References: <20130622183700.GA8171@molb.org> Message-ID: <51C7F095.7030701@erlang.org> On 06/22/2013 08:37 PM, Johannes Wei?l wrote: > Hello! > > This patch fixes the usage of the httpd configuration option > 'erl_script_nocache', which got ignored before. > > git fetch git://github.com/weisslj/otp.git fix-httpd-erl-script-nocache > > https://github.com/weisslj/otp/compare/erlang:maint...fix-httpd-erl-script-nocache > https://github.com/weisslj/otp/compare/erlang:maint...fix-httpd-erl-script-nocache.patch > > Greetings, > > Johannes Wei?l > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches Hello Johannes, I've fetched your patch and it should be visible in the 'pu' branch soon. Thanks, -- BR Fredrik Gustafsson Erlang OTP Team From aleksander.nycz@REDACTED Mon Jun 24 11:37:52 2013 From: aleksander.nycz@REDACTED (aleksander.nycz@REDACTED) Date: Mon, 24 Jun 2013 11:37:52 +0200 (CEST) Subject: [erlang-patches] New index type in mnesia (new feature) In-Reply-To: <39731.89.66.142.184.1371832527.squirrel@wmail.comarch.com> References: <51C1E19C.2070000@comarch.pl> <39731.89.66.142.184.1371832527.squirrel@wmail.comarch.com> Message-ID: <52321.89.66.142.184.1372066672.squirrel@wmail.comarch.com> Hello, Can you answer my last mail? Regards ANycz > Hello, > > Unfortunatelly patch in R16B01 does't fix all performance problem for low > cardinality columns. > > I've prepared simple benchmark for otp_R16B, otp_R16B01 and otp_R16B01 > with mnesia new index patch. File test.erl shouls be run on otp_R16B, > otp_R16B01 > and test2.erl on otp_R16B01 with mnesia new index patch. > In atachement benchmark results from my laptop (ubuntu 13.04, 4 core, 4GB > RAM). > > Please note that patch, that was applied in R1601 fix only problem with > insert operation (was bag in R16B, is duplicated_bag in R16B01): > > {{TableType, Storage, IndexesAndType, Unused}, TransactionContext, > Operation, Records, OperationTime [us], Rec/sec} > > otp_R16: > {{set,ram_copies,[state],[]},async_dirty,'Insert',10000,754401,13255.55}, > otp_R16B01: > {{set,ram_copies,[state],[]},async_dirty,'Insert',10000,111412,89756.94}, > > but write and delete operations are still very slow: > {{set,ram_copies,[state],[]},async_dirty,'UpdateStateField',10000,3107059,3218.48}, > {{set,ram_copies,[state],[]},async_dirty,'UpdatemTimeField',10000,2920105,3424.53}, > {{set,ram_copies,[state],[]},async_dirty,'Delete',10000,1445054,6920.16}, > > In my solution, there is no necessity to iterate long lists (in case of > low cardinality column), but Primary key value are deleted/inserted > from/info ets. > > Below benchmark result for my solution with new index type: > {{set,ram_copies,{state,idx_ets},[]},async_dirty,'Insert',10000,122417,81688.00}, > {{set,ram_copies,{state,idx_ets},[]},async_dirty,'UpdateStateField',10000,149560,66862.80}, > {{set,ram_copies,{state,idx_ets},[]},async_dirty,'UpdatemTimeField',10000,146501,68258.92}, > {{set,ram_copies,{state,idx_ets},[]},async_dirty,'Delete',10000,103037,97052.52} > > Please run this benchmarks on your machine and check results. > > Regards > Aleksander Nycz > >> There is a patch included in the today's release that address this issue >> in >> a simpler way, >> for set (and ordered set if I remember correctly). >> >> Can you check if the performance is good enough for you in R16B01. >> >> /Dan >> >> >> On Wed, Jun 19, 2013 at 6:51 PM, Aleksander Nycz >> >> wrote: >> >>> Hello, >>> >>> Mnesia gives possibility to create table indexes, when >>> the user wants to frequently use some other field >>> than the key field to look up records. >>> >>> Current index solution in mnesia uses ets table (type bag or >>> duplicated_bag) to maintain mapping: >>> Indexed field value -> Primary key value. >>> >>> Unfortunatelly current solution has very significant disadvantage: >>> operation performance (loading table, insert new records, >>> delete records, etc.) is very low when index is set on 'Low-cardinality >>> column' >>> >>> http://en.wikipedia.org/wiki/**Cardinality_%28SQL_statements%**29 >>> >>> In such case operation complexity is O(n) when n is number >>> of Primary Key Values. For small n performance can be acceptable for >>> some >>> application, >>> but when n is the hundreds, thousands or even more such index >>> are useless. New index type provides O(1) complexity. >>> >>> This patch introduces new index type in mnesia database. >>> Main concept is to maintain all Primary Key Values not direcly in >>> bag/duplicated_bag ets but in set of ets. >>> For each Indexed field value new ets is created >>> and Primary Key Values are strored in this ets. >>> For 'Low-cardinality column' there is only a few Indexed key value (eg. >>> isActive (true/false), state (new/pending/suspended/active)**, ...) >>> so memory overhead for ets is not significant. >>> >>> Standard index: >>> Indexed field value -> [Primary key value] >>> >>> New index based on ets: >>> Indexed field value -> ets, that contains Primary key value >>> >>> Restrictions: >>> >>> 1. New index can be created on disc_copies or ram_copies tables only. >>> Tables disc_only_copies are not supported. >>> 2. Index type can't be changed. The only way to change existing index >>> idx_list to idx_ets and vice versa >>> is to delete existing index and create new one by >>> mnesia:add_table_index/3 (new function, see below) >>> >>> >>> New API: >>> >>> 1. Define index type when table is created: >>> >>> create_table(Name, TabDef) -> {atomic, ok} | {aborted, Reason} >>> >>> New TabDef value: >>> {index_type, [{atom() | int(), 'idx_std' | 'idx_ets'}]} - 'idx_std' is >>> default when index is created >>> >>> Example: >>> >>> -type(poolId() :: integer()). >>> -type(bucketId() :: integer()). >>> -type(resourceState() :: free | reserved | gracePeriod). >>> >>> -record(rmResource, {id :: {poolId(), >>> any()} >>> ,state :: {poolId(), >>> bucketId(), resourceState()} >>> ,availableFrom :: integer() >>> ,availableTo :: integer() >>> ,requestorId :: any() >>> ,reservedFrom :: integer() >>> ,reservedTo :: integer() >>> ,isDeleted = false :: boolean() >>> ,mTime :: integer()}). >>> >>> {atomic,ok} = mnesia:create_table(**tRMResources >>> ,[ >>> {disc_copies, []} >>> ,{ram_copies, [node()]} >>> ,{type,set} >>> ,{attributes,record_info(**fields, rmResource)} >>> ,{record_name, rmResource} >>> ,{index, [state, requestorId, >>> mTime]} >>> ,{index_type, [{state, >>> idx_ets}, >>> {requestorId, idx_std}]} >>> ]), >>> >>> 2. Add new index to existing table: >>> >>> mnesia:add_table_index(Tab, AttrName, IndexOpts) -> {aborted, R} | >>> {atomic, ok} >>> >>> This function creates a index on Mnesia table called Tab on AttrName >>> field according to the argument IndexOpts. >>> This list must be a list of {Item, Value} tuples, currently only one >>> option is allowed: >>> {index_type, 'idx_std' | 'idx_ets'} >>> >>> Example: >>> >>> mnesia:add_table_index(**tRMResources, isDeleted, [{index_type, >>> 'idx_ets'}]) >>> >>> 3. New match_object/4, dirty_match_object/3 functions: >>> >>> match_object(Tab, Pat, Limit, LockKind) -> [Record] | transaction >>> abort. >>> dirty_match_object(Tab, Pat, Limit) -> [Record] | exit({aborted, >>> Reason}). >>> >>> Similar to match_object/3 and dirty_match_object/2, but returns no more >>> than Limit records. >>> >>> >>> 4. New index_match_object/5, dirty_index_match_object/4 functions: >>> >>> index_match_object(Tab, Pat, Attr, Limit, LockKind) -> [Record] | >>> transaction abort. >>> dirty_index_match_object(Tab, Pat, Attr, Limit) -> [Record] | >>> exit({aborted, Reason}). >>> >>> Similar to index_match_object/4, dirty_index_match_object/3 but returns >>> no >>> more than Limit records. >>> >>> >>> 5. New index_read/4, dirty_index_read/4 functions: >>> >>> index_read(Tab, Key, Attr, Limit) -> [Record] | transaction abort. >>> dirty_index_read(Tab, Key, Attr, Limit) -> [Record] | exit({aborted, >>> Reason}). >>> >>> Similar to index_read/3, dirty_index_read/3 but returns no more than >>> Limit >>> records. >>> >>> >>> 6. New select_limit/3, select_limit/4, dirty_select/3 functions; >>> >>> select_limit(Tab, MatchSpec, NObjects [, Lock]) -> [Object] | >>> transaction >>> abort. >>> >>> Similar to select(Tab, MatchSpec [, Lock]) but returns maximum NObjects >>> records, of course empty list can also be returned. >>> Continuation (see select/4) is not possible. This function can also use >>> indexes to find matching records >>> as contrasted with select/4. >>> >>> dirty_select(Tab, Spec, Limit) -> [Object] | exit({aborted, Reason}. >>> >>> Similar to dirty_select/2 but returns no more than Limit records. >>> >>> And git links: >>> >>> git fetch >>> git://github.com/nyczol/otp.**gitmnesia_new_index >>> >>> https://github.com/nyczol/otp/**compare/erlang:master...**mnesia_new_index >>> https://github.com/nyczol/otp/**compare/erlang:master...** >>> mnesia_new_index.patch >>> >>> Regards, >>> Aleksander Nycz >>> >>> -- >>> Aleksander Nycz >>> Senior Software Engineer >>> Telco_021 BSS R&D >>> Comarch SA >>> Phone: +48 12 646 1216 >>> Mobile: +48 691 464 275 >>> website: www.comarch.pl >>> >>> >>> >>> _______________________________________________ >>> erlang-patches mailing list >>> erlang-patches@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-patches >>> >>> >> From bgustavsson@REDACTED Wed Jun 26 14:43:24 2013 From: bgustavsson@REDACTED (=?UTF-8?Q?Bj=C3=B6rn_Gustavsson?=) Date: Wed, 26 Jun 2013 14:43:24 +0200 Subject: [erlang-patches] [erlang-bugs] Compiler crash with 'inline_list_funcs' and "fun Fun/Arity" notation In-Reply-To: <21AE91E1-9EF1-41B8-913E-AC0C959AC3F7@gmail.com> References: <5195F094.2010003@ymir.co.jp> <21AE91E1-9EF1-41B8-913E-AC0C959AC3F7@gmail.com> Message-ID: Thanks! Looks good. I have only two slight comments: If find the first sentence in the commit message confusing: "Local fun references look like plain old variables in the Core Erlang AST and should not be treated as such." I would suggest "but" instead of "and": "Local fun references look like plain old variables in the Core Erlang AST, but should not be treated as such." The test cases tests that the compiler does not crash and that the code can be loaded, but it does not test that the code actually works. I suggest that you rewrite it to something like this: ?MODULE() -> F = fun bar/1, G = lists:last([(fun (X) when F =:= X -> X end)]), F = G(F), ok. bar(X) -> X. /Bjorn On Sat, May 18, 2013 at 6:22 PM, Anthony Ramine wrote: > Hello, > > This patch fixes the bug by forbidding inlining of variables which values > are local fun references outside of application contexts. > > git fetch https://github.com/nox/otp.git fix-fname-inlining > > > https://github.com/nox/otp/compare/erlang:maint...fix-fname-inlining > > https://github.com/nox/otp/compare/erlang:maint...fix-fname-inlining.patch > > Regards, > > -- > Anthony Ramine > > Le 17 mai 2013 ? 20:06, Anthony Ramine a ?crit : > > > Hello, > > > > Shorter test case, showing the problem comes from the inline itself and > not inline_list_funcs: > > > > -module(test). > > -compile(inline). > > -export([foo/0]). > > > > foo() -> > > F = fun bar/1, > > fun (X) when X =:= F -> X end. > > > > bar(X) -> X. > > > > If you run the core_lint pass, you can see where the problem comes from: > > > > $ erlc +clint test.erl > > test: illegal guard expression in foo/0 > > > > The inliner inlines `when 'erlang':'=:='(X, F)` to `'erlang':'=:='(X, > 'bar'/1)` but local fun references can't appear in guards. > > > > I'll try to make a patch. > > > > Regards, > > > > -- > > Anthony Ramine > > > > Le 17 mai 2013 ? 10:55, Masatake Daimon a ?crit : > > > >> Hello, > >> > >> Compiling the following module makes the compiler crash. I'm using > >> R16B. > >> > >> ===== test.erl ===== > >> -module(test). > >> -compile(inline). > >> -compile(inline_list_funcs). > >> -export([foo/0]). > >> > >> foo() -> > >> lists:map(fun bar/1, [1]). > >> > >> bar(X) -> X. > >> > >> ===== the crash ==== > >> % erlc test.erl > >> test: function '-foo/0-lists^map/1-0-'/1+15: > >> Internal consistency check failed - please report this bug. > >> Instruction: {move,{x,0},{yy,0}} > >> Error: {invalid_store,{yy,0},term}: > >> > >> > >> Note that the problem disappears with any of these changes: > >> > >> * Commenting out "-compile(inline)." > >> * Commenting out "-compile(inline_list_funcs)." > >> * Changing the definition of foo/0 to: > >> foo() -> > >> lists:map(fun bar/1, []). % [] instead of [1] > >> * Changing the definition of foo/0 to: > >> foo() -> > >> lists:map(fun (A) -> bar(A) end, [1]). > >> > >> Regards, > >> -- > >> ?? ?? > >> _______________________________________________ > >> erlang-bugs mailing list > >> erlang-bugs@REDACTED > >> http://erlang.org/mailman/listinfo/erlang-bugs > > > > _______________________________________________ > erlang-bugs mailing list > erlang-bugs@REDACTED > http://erlang.org/mailman/listinfo/erlang-bugs > -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB -------------- next part -------------- An HTML attachment was scrubbed... URL: From n.oxyde@REDACTED Wed Jun 26 14:52:23 2013 From: n.oxyde@REDACTED (Anthony Ramine) Date: Wed, 26 Jun 2013 14:52:23 +0200 Subject: [erlang-patches] [erlang-bugs] Compiler crash with 'inline_list_funcs' and "fun Fun/Arity" notation In-Reply-To: References: <5195F094.2010003@ymir.co.jp> <21AE91E1-9EF1-41B8-913E-AC0C959AC3F7@gmail.com> Message-ID: <599774A3-5492-4D15-9EC3-860BE4A9D484@gmail.com> Will amend. -- Anthony Ramine Le 26 juin 2013 ? 14:43, Bj?rn Gustavsson a ?crit : > Thanks! Looks good. I have only two slight comments: > > If find the first sentence in the commit message confusing: > > "Local fun references look like plain old variables in the Core Erlang > AST and should not be treated as such." > > I would suggest "but" instead of "and": > > "Local fun references look like plain old variables in the Core Erlang > AST, but should not be treated as such." > > The test cases tests that the compiler does not crash and that > the code can be loaded, but it does not test that the code actually > works. I suggest that you rewrite it to something like this: > > ?MODULE() -> > F = fun bar/1, > G = lists:last([(fun (X) when F =:= X -> X end)]), > F = G(F), > ok. > > bar(X) -> > X. > > /Bjorn > > > > On Sat, May 18, 2013 at 6:22 PM, Anthony Ramine wrote: > Hello, > > This patch fixes the bug by forbidding inlining of variables which values are local fun references outside of application contexts. > > git fetch https://github.com/nox/otp.git fix-fname-inlining > > https://github.com/nox/otp/compare/erlang:maint...fix-fname-inlining > https://github.com/nox/otp/compare/erlang:maint...fix-fname-inlining.patch > > Regards, > > -- > Anthony Ramine > > Le 17 mai 2013 ? 20:06, Anthony Ramine a ?crit : > > > Hello, > > > > Shorter test case, showing the problem comes from the inline itself and not inline_list_funcs: > > > > -module(test). > > -compile(inline). > > -export([foo/0]). > > > > foo() -> > > F = fun bar/1, > > fun (X) when X =:= F -> X end. > > > > bar(X) -> X. > > > > If you run the core_lint pass, you can see where the problem comes from: > > > > $ erlc +clint test.erl > > test: illegal guard expression in foo/0 > > > > The inliner inlines `when 'erlang':'=:='(X, F)` to `'erlang':'=:='(X, 'bar'/1)` but local fun references can't appear in guards. > > > > I'll try to make a patch. > > > > Regards, > > > > -- > > Anthony Ramine > > > > Le 17 mai 2013 ? 10:55, Masatake Daimon a ?crit : > > > >> Hello, > >> > >> Compiling the following module makes the compiler crash. I'm using > >> R16B. > >> > >> ===== test.erl ===== > >> -module(test). > >> -compile(inline). > >> -compile(inline_list_funcs). > >> -export([foo/0]). > >> > >> foo() -> > >> lists:map(fun bar/1, [1]). > >> > >> bar(X) -> X. > >> > >> ===== the crash ==== > >> % erlc test.erl > >> test: function '-foo/0-lists^map/1-0-'/1+15: > >> Internal consistency check failed - please report this bug. > >> Instruction: {move,{x,0},{yy,0}} > >> Error: {invalid_store,{yy,0},term}: > >> > >> > >> Note that the problem disappears with any of these changes: > >> > >> * Commenting out "-compile(inline)." > >> * Commenting out "-compile(inline_list_funcs)." > >> * Changing the definition of foo/0 to: > >> foo() -> > >> lists:map(fun bar/1, []). % [] instead of [1] > >> * Changing the definition of foo/0 to: > >> foo() -> > >> lists:map(fun (A) -> bar(A) end, [1]). > >> > >> Regards, > >> -- > >> ?? ?? > >> _______________________________________________ > >> erlang-bugs mailing list > >> erlang-bugs@REDACTED > >> http://erlang.org/mailman/listinfo/erlang-bugs > > > > _______________________________________________ > erlang-bugs mailing list > erlang-bugs@REDACTED > http://erlang.org/mailman/listinfo/erlang-bugs > > > > -- > Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From hm@REDACTED Wed Jun 26 16:04:43 2013 From: hm@REDACTED (=?ISO-8859-1?Q?H=E5kan_Mattsson?=) Date: Wed, 26 Jun 2013 16:04:43 +0200 Subject: [erlang-patches] Release the reltool script Message-ID: With this patch the reltool script is released among the the other top level executables, such as dialyzer, ct_run etc. I did also take the liberty of enhancing the script and renaming it script to "reltool". A new test suite and a new man(1) page is included. git fetch git://github.com/hawk/otp.git hawk/reltool_script or viewed here https://github.com/hawk/otp/compare/hawk/reltool_script https://github.com/hawk/otp/compare/hawk/reltool_script.patch /H?kan From fredrik@REDACTED Wed Jun 26 16:13:25 2013 From: fredrik@REDACTED (Fredrik) Date: Wed, 26 Jun 2013 16:13:25 +0200 Subject: [erlang-patches] Release the reltool script In-Reply-To: References: Message-ID: <51CAF705.2040900@erlang.org> On 06/26/2013 04:04 PM, H?kan Mattsson wrote: > With this patch the reltool script is released among the the other top > level executables, such as dialyzer, ct_run etc. > I did also take the liberty of enhancing the script and renaming it > script to "reltool". > > A new test suite and a new man(1) page is included. > > git fetch git://github.com/hawk/otp.git hawk/reltool_script > > or viewed here > > https://github.com/hawk/otp/compare/hawk/reltool_script > https://github.com/hawk/otp/compare/hawk/reltool_script.patch > > /H?kan > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches Hello H?kan, I've fetched your patch and it should soon be visible in the 'pu' branch on github. Thanks, -- BR Fredrik Gustafsson Erlang OTP Team From tcury@REDACTED Thu Jun 27 02:00:28 2013 From: tcury@REDACTED (Tiago Cury) Date: Wed, 26 Jun 2013 21:00:28 -0300 Subject: [erlang-patches] erl_tar improvements Message-ID: <629BE9E8-9F23-4A7C-859C-CF6C4F386F83@ymail.com> 1. Ability to enable/disable directory recursion through option for erl_tar:add and erl_tar:extract. (tcury) 2. I have met another problem with recursive directories. I've written a tool that creates debian packages and wanted to use erl_tar. dpkg requires that directories must exist in tar archive and erl_tar cannot add only directory, it starts adding files inside and forget to add inner directories. So, this archive becomes unuseable for dpkg. I think that I need to make a patch and try to push it to mainline. (max) From sgolovan@REDACTED Thu Jun 27 08:13:34 2013 From: sgolovan@REDACTED (Sergei Golovan) Date: Thu, 27 Jun 2013 10:13:34 +0400 Subject: [erlang-patches] odbcserver crash fix Message-ID: Hi! Appears that odbcserver crashes if it's started with incorrect data on its stdin. The following command leads to a segmentation fault: echo -en "\x0\x0\x0\x1\x0" | ./odbcserver The problem basically is tokenizing input using strtok() and not checking for NULL after that. I don't think that it's a very serious bug (odbcserver is executed only in odbc module and doesn't receive arbitrary input), but it'd be better to have it fixed. I'd like to propose a small fix for it: git fetch git://github.com/sgolovan/otp.git odbcserver_crash_fix The diff and patch can be seen at https://github.com/sgolovan/otp/compare/erlang:maint...odbcserver_crash_fix https://github.com/sgolovan/otp/compare/erlang:maint...odbcserver_crash_fix.patch -- Sergei Golovan From fredrik@REDACTED Thu Jun 27 10:07:01 2013 From: fredrik@REDACTED (Fredrik) Date: Thu, 27 Jun 2013 10:07:01 +0200 Subject: [erlang-patches] odbcserver crash fix In-Reply-To: References: Message-ID: <51CBF2A5.4080101@erlang.org> On 06/27/2013 08:13 AM, Sergei Golovan wrote: > Hi! > > Appears that odbcserver crashes if it's started with incorrect data on > its stdin. The following command leads to a segmentation fault: > > echo -en "\x0\x0\x0\x1\x0" | ./odbcserver > > The problem basically is tokenizing input using strtok() and not > checking for NULL after that. > > I don't think that it's a very serious bug (odbcserver is executed > only in odbc module and doesn't receive arbitrary input), but it'd be > better to have it fixed. > > I'd like to propose a small fix for it: > > git fetch git://github.com/sgolovan/otp.git odbcserver_crash_fix > > The diff and patch can be seen at > > https://github.com/sgolovan/otp/compare/erlang:maint...odbcserver_crash_fix > https://github.com/sgolovan/otp/compare/erlang:maint...odbcserver_crash_fix.patch > > -- > Sergei Golovan > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches Hello Sergei, I've fetched your patch and it should soon be visible in the 'pu' branch. Thanks, -- BR Fredrik Gustafsson Erlang OTP Team From david.cabrero@REDACTED Fri Jun 28 02:27:38 2013 From: david.cabrero@REDACTED (David Cabrero) Date: Fri, 28 Jun 2013 02:27:38 +0200 Subject: [erlang-patches] Add ei_x_vformat to erl_interface library Message-ID: Hello, I'd like to submit this patch to add two new functions to the erl_interface library. Repo branch: https://github.com/cabrero/otp/tree/add_ei_x_vformat Compare: https://github.com/cabrero/otp/compare/erlang:master...add_ei_x_vformat Why this new feature? *It allows to write **functions that take a variable number of arguments and use ei_x_format * Risks / uncertain artifacts *None* How did you solve it?Adding new functions like printf vs vprintf Thanks. -- David -------------- next part -------------- An HTML attachment was scrubbed... URL: From fredrik@REDACTED Fri Jun 28 12:22:55 2013 From: fredrik@REDACTED (Fredrik) Date: Fri, 28 Jun 2013 12:22:55 +0200 Subject: [erlang-patches] New index type in mnesia (new feature) In-Reply-To: <51C1E19C.2070000@comarch.pl> References: <51C1E19C.2070000@comarch.pl> Message-ID: <51CD63FF.1070303@erlang.org> On 06/19/2013 06:51 PM, Aleksander Nycz wrote: > Hello, > > Mnesia gives possibility to create table indexes, when > the user wants to frequently use some other field > than the key field to look up records. > > Current index solution in mnesia uses ets table (type bag or > duplicated_bag) to maintain mapping: > Indexed field value -> Primary key value. > > Unfortunatelly current solution has very significant disadvantage: > operation performance (loading table, insert new records, > delete records, etc.) is very low when index is set on > 'Low-cardinality column' > > http://en.wikipedia.org/wiki/Cardinality_%28SQL_statements%29 > > In such case operation complexity is O(n) when n is number > of Primary Key Values. For small n performance can be acceptable for > some application, > but when n is the hundreds, thousands or even more such index > are useless. New index type provides O(1) complexity. > > This patch introduces new index type in mnesia database. > Main concept is to maintain all Primary Key Values not direcly in > bag/duplicated_bag ets but in set of ets. > For each Indexed field value new ets is created > and Primary Key Values are strored in this ets. > For 'Low-cardinality column' there is only a few Indexed key value > (eg. isActive (true/false), state (new/pending/suspended/active), ...) > so memory overhead for ets is not significant. > > Standard index: > Indexed field value -> [Primary key value] > > New index based on ets: > Indexed field value -> ets, that contains Primary key value > > Restrictions: > > 1. New index can be created on disc_copies or ram_copies tables only. > Tables disc_only_copies are not supported. > 2. Index type can't be changed. The only way to change existing index > idx_list to idx_ets and vice versa > is to delete existing index and create new one by > mnesia:add_table_index/3 (new function, see below) > > > New API: > > 1. Define index type when table is created: > > create_table(Name, TabDef) -> {atomic, ok} | {aborted, Reason} > > New TabDef value: > {index_type, [{atom() | int(), 'idx_std' | 'idx_ets'}]} - 'idx_std' is > default when index is created > > Example: > > -type(poolId() :: integer()). > -type(bucketId() :: integer()). > -type(resourceState() :: free | reserved | gracePeriod). > > -record(rmResource, {id :: {poolId(), > any()} > ,state :: {poolId(), > bucketId(), resourceState()} > ,availableFrom :: integer() > ,availableTo :: integer() > ,requestorId :: any() > ,reservedFrom :: integer() > ,reservedTo :: integer() > ,isDeleted = false :: boolean() > ,mTime :: integer()}). > > {atomic,ok} = mnesia:create_table(tRMResources > ,[ > {disc_copies, []} > ,{ram_copies, [node()]} > ,{type,set} > ,{attributes,record_info(fields, rmResource)} > ,{record_name, rmResource} > ,{index, [state, requestorId, > mTime]} > ,{index_type, [{state, > idx_ets}, {requestorId, idx_std}]} > ]), > > 2. Add new index to existing table: > > mnesia:add_table_index(Tab, AttrName, IndexOpts) -> {aborted, R} | > {atomic, ok} > > This function creates a index on Mnesia table called Tab on AttrName > field according to the argument IndexOpts. > This list must be a list of {Item, Value} tuples, currently only one > option is allowed: > {index_type, 'idx_std' | 'idx_ets'} > > Example: > > mnesia:add_table_index(tRMResources, isDeleted, [{index_type, > 'idx_ets'}]) > > 3. New match_object/4, dirty_match_object/3 functions: > > match_object(Tab, Pat, Limit, LockKind) -> [Record] | transaction abort. > dirty_match_object(Tab, Pat, Limit) -> [Record] | exit({aborted, > Reason}). > > Similar to match_object/3 and dirty_match_object/2, but returns no > more than Limit records. > > > 4. New index_match_object/5, dirty_index_match_object/4 functions: > > index_match_object(Tab, Pat, Attr, Limit, LockKind) -> [Record] | > transaction abort. > dirty_index_match_object(Tab, Pat, Attr, Limit) -> [Record] | > exit({aborted, Reason}). > > Similar to index_match_object/4, dirty_index_match_object/3 but > returns no more than Limit records. > > > 5. New index_read/4, dirty_index_read/4 functions: > > index_read(Tab, Key, Attr, Limit) -> [Record] | transaction abort. > dirty_index_read(Tab, Key, Attr, Limit) -> [Record] | exit({aborted, > Reason}). > > Similar to index_read/3, dirty_index_read/3 but returns no more than > Limit records. > > > 6. New select_limit/3, select_limit/4, dirty_select/3 functions; > > select_limit(Tab, MatchSpec, NObjects [, Lock]) -> [Object] | > transaction abort. > > Similar to select(Tab, MatchSpec [, Lock]) but returns maximum NObjects > records, of course empty list can also be returned. > Continuation (see select/4) is not possible. This function can also use > indexes to find matching records > as contrasted with select/4. > > dirty_select(Tab, Spec, Limit) -> [Object] | exit({aborted, Reason}. > > Similar to dirty_select/2 but returns no more than Limit records. > > And git links: > > git fetch git://github.com/nyczol/otp.git mnesia_new_index > > https://github.com/nyczol/otp/compare/erlang:master...mnesia_new_index > https://github.com/nyczol/otp/compare/erlang:master...mnesia_new_index.patch > > > Regards, > Aleksander Nycz > > > > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches Hello, Please rebase this patch upon current maint. No mergeing ;) Thanks, -- BR Fredrik Gustafsson Erlang OTP Team -------------- next part -------------- An HTML attachment was scrubbed... URL: From ulf@REDACTED Fri Jun 28 14:15:53 2013 From: ulf@REDACTED (Ulf Wiger) Date: Fri, 28 Jun 2013 14:15:53 +0200 Subject: [erlang-patches] New index type in mnesia (new feature) In-Reply-To: <51CD63FF.1070303@erlang.org> References: <51C1E19C.2070000@comarch.pl> <51CD63FF.1070303@erlang.org> Message-ID: <7655CD11-0A3D-4BB0-B21D-A8B187CA8507@feuerlabs.com> The mnesia extension presented at the EUC 2012, http://www.erlang-factory.com/upload/presentations/601/EUC2012-009.pdf actually contains a solutions for new index types, primarily ordered indexes. It is still evolving and will soon appear in a public repository. The improvement in terms of indexing is that you can specify an index as {Pos, ordered | bag} where ram_copies and disc_copies support both types, but disc_only_copies supports only bag. When combined with backend plugins, the plugin gets to define which kinds of indexes it supports, as well as a callback function for generating index values. The user interface will also be extended to allow user-defined index functions, so that derived indexes can be created. A slight problem is that indexes are tied to attribute positions, and derived indexes really shouldn't be. (Strictly speaking, a backend plugin can specify other index types, but mnesia will only allow an index type on a table if it's supported by all types of backends used by that table). The addition was necessary since leveldb supports ordered_set semantics, but not bag semantics. We have since then implemented bag semantics on top of leveldb, but mainly for compatibility - not for performance. Ordered indexes have good performance characteristics. The representation is {{IxValue, Key}}, and relies on the facts that (1) insert and delete are both very efficient, and (2) a match on {{IxVal, '_'}} in an ordered set is an efficient operation. BR, Ulf W On 28 Jun 2013, at 12:22, Fredrik wrote: > On 06/19/2013 06:51 PM, Aleksander Nycz wrote: >> >> Hello, >> >> Mnesia gives possibility to create table indexes, when >> the user wants to frequently use some other field >> than the key field to look up records. >> >> Current index solution in mnesia uses ets table (type bag or duplicated_bag) to maintain mapping: >> Indexed field value -> Primary key value. >> Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc. http://feuerlabs.com