summaryrefslogtreecommitdiff
path: root/lib/stdlib
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'nox/fix-erl_lint-variable-usage' into puFredrik Gustafsson2013-08-012-22/+75
|\
| * Fix variable usage tracking in some record errorsAnthony Ramine2013-07-312-2/+9
| | | | | | | | | | When reporting a field redefinition in a record, erl_lint can forget about some old unused variables.
| * Fix unsafe variable tracking in try expressionsAnthony Ramine2013-07-222-2/+19
| | | | | | | | | | | | | | | | | | Variables used in the body of a try expression were marked as unsafe *and* used, which makes no sense as an unsafe variable can't be used. Function vtsubtract/2 is used to forget usage of such unsafe variables. Reported-by: Paul Davis
| * Fix variable usage tracking in erl_lintAnthony Ramine2013-07-012-20/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 do not correctly follow this behaviour, e.g. A is not marked as used in the following code: t(X, Y) -> {A=X,A=Y}. This commit fixes both issues and makes erl_lint not return old unused variables in updated tables and makes all compound expressions use vtmerge_pat/2. Reported-by: Anders Ramsell
* | Merge branch 'epa/fix_io_noreturn_with_self_pid' into puFredrik Gustafsson2013-08-011-0/+2
|\ \
| * | Fix no return of io functions when self() used as Iodevicecrownedgrouse2013-06-031-0/+2
| | | | | | | | | | | | | | | | | | | | | When self() is used as Iodevice in io functions, this was resulting in an infinite wait of function return. This patch add a guard in request and replace self() by the current group_leader.
* | | Merge branch 'sze/limit_max_length_int_shell' into puFredrik Gustafsson2013-08-013-2/+15
|\ \ \
| * | | Limit maximum line length in interactive shellsStefan Zegenhagen2013-05-083-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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@erlang.org > 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@arcutronix.com 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 b8b904f4ca1e0b418f8e758c9aa5e43b6469c3b4 Mon Sep 17 00:00:00 2001 From: Stefan Zegenhagen <stefan.zegenhagen@arcutronix.com> Date: Tue, 7 May 2013 14:14:50 +0200 Subject: [PATCH] limit line length in interactive shells Since the I/O server in group.erl was always collecting full lines before doing any further end-of-input processing, it was possible to crash any erlang system by just sending tons of characters without any newline to an interactive shell. Fix that by allowing to specify a maximum input length. Whenever new characters are received from the input device, check whether the new input exceeds the maximum line length and if so, return the data that was read so far (up to the maximum line length characters).
* | | | Merge branch 'sze/edlin_understand_keys' into puFredrik Gustafsson2013-08-011-0/+30
|\ \ \ \
| * | | | make edlin understand a few important control keysStefan Zegenhagen2013-05-061-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: - <CTRL>+W : backward kill word - <CTRL>+U : backward kill line - <HOME> : goto start of line - <END> : goto end of line - <CTRL>+<LEFT> : backward word - <CTRL>+<RIGHT> : 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, -- Dr. Stefan Zegenhagen arcutronix GmbH Garbsener Landstr. 10 30419 Hannover Germany Tel: +49 511 277-2734 Fax: +49 511 277-2709 Email: stefan.zegenhagen@arcutronix.com 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 39f497adec90fc397f366da275fd5a7ca748cc5f Mon Sep 17 00:00:00 2001 From: Stefan Zegenhagen <stefan.zegenhagen@arcutronix.com> Date: Mon, 6 May 2013 14:39:07 +0200 Subject: [PATCH] [EDLIN] support a few more control keys Add support for the following control keys that many users have become accustomed to: - <CTRL>+W : backward kill word - <CTRL>+U : backward kill line - <HOME> : goto start of line - <END> : goto end of line - <CTRL>+<LEFT> : backward word - <CTRL>+<RIGHT> : forward word It seems that the <CTRL>+<LEFT|RIGHT> control key sequences are different between terminal emulators, therefore a few possible combinations were added (similar to how libreadline is configured).
* | | | | Merge branch 'jv/update-io_prompt-type/OTP-11208' into maintBjörn-Egil Dahlberg2013-07-241-1/+1
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | * jv/update-io_prompt-type/OTP-11208: Update io:prompt() type
| * | | | | Update io:prompt() typeJosé Valim2013-07-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Functions that expect an io:prompt() also accept binaries and iolists as arguments. Therefore its type has been updated to reflect the same types accepted by other io functions.
* | | | | | Update filelib.erl typespecsJosé Valim2013-07-211-10/+13
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Most functions in filelib support binaries as arguments but that was not reflected in the typespecs. The types filename_all() and dirname_all() were introduced to mimic file:name_all().
* | | | | Fix supervisor typogoofansu2013-07-111-1/+1
| | | | | | | | | | | | | | | | | | | | `I` should be `If`
* | | | | Merge branch 'genrich/stdlib/gen_server_typo/OTP-11200' into maintFredrik Gustafsson2013-07-091-1/+1
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | * genrich/stdlib/gen_server_typo/OTP-11200: handle_info Info type possible typo
| * | | | | handle_info Info type possible typogenrich2013-06-081-1/+1
| | | | | | | | | | | | | | | | | | Should it be 'timeout' instead of timeout(), as in doc: http://www.erlang.org/doc/man/gen_server.html#Module:handle_info-2?
* | | | | | Update version numbers for R16B02 developmentMagnus Lidén2013-06-191-1/+1
| | | | | |
* | | | | | Prepare releaseOTP_R16B01Erlang/OTP2013-06-171-0/+173
| | | | | |
* | | | | | Update copyright yearsBjörn-Egil Dahlberg2013-06-1220-20/+20
|/ / / / /
* | | | | Merge branch 'pan/unicode_error_wrong_offset' into maintPatrik Nyblom2013-06-051-2/+145
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * pan/unicode_error_wrong_offset: Fix faulty rest on error in unicode:characters_to_list OTP-11080
| * | | | | Fix faulty rest on error in unicode:characters_to_listPatrik Nyblom2013-05-021-2/+145
| | | | | |
* | | | | | Merge branch 'jv/erl_lint-default_types/OTP-11143' into maintFredrik Gustafsson2013-06-051-71/+66
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * jv/erl_lint-default_types/OTP-11143: Updated primary bootstrap stdlib: re-factored erl_lint.erl Improve erl_lint performance
| * | | | | | stdlib: re-factored erl_lint.erlFredrik Gustafsson2013-05-281-1/+4
| | | | | | |
| * | | | | | Improve erl_lint performanceJosé Valim2013-05-281-71/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The default_types() in erl_lint returned a dictionary with all default types. However, calculating this dict was expensive and we actually didn't use the default values in this dictionary. This patch replaces the dictionary use for one function that checks if the type is a default type or not, and remove the bits that checked explicitly for those default types when iterating the dictionary.
* | | | | | | Merge branch 'rickard-sverker/carrier-migration/OTP-10279' into maintRickard Green2013-06-041-5/+14
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * rickard-sverker/carrier-migration/OTP-10279: stdlib: Fix ets_SUITE memory tests
| * | | | | | | stdlib: Fix ets_SUITE memory testsRickard Green2013-06-041-5/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Need to take 'mbcs_pool' into account.
* | | | | | | | Merge branch 'nox/erl_pp-callback/OTP-11140' into maintFredrik Gustafsson2013-06-042-5/+16
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * nox/erl_pp-callback/OTP-11140: Update primary bootstrap Support callback attributes in erl_pp
| * | | | | | | | Support callback attributes in erl_ppAnthony Ramine2013-05-282-5/+16
| | |/ / / / / / | |/| | | | | |
* | | | | | | | Merge branch 'rickard-sverker/carrier-migration/OTP-10279' into maintRickard Green2013-06-041-2/+1
|\ \ \ \ \ \ \ \ | | |/ / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * rickard-sverker/carrier-migration/OTP-10279: erts: Document the +M<S>acul command line argument erts: Carrier pool information in allocator information erts: Use carrier pool for migration of carriers erts: Implement test case for carrier pool erts: Implement carrier pool erts: Fix type errors in info functions erts: Use Uint64 for call counts erts: Fix failing testcase alloc_SUITE:rbtree erts: Rename allocator aoffcbf to aoffcaobf erts: Remove unnecessary flag arguments in allocators erts: Remove SBMBC allocator erts: Add test for add_mbc and remove_mbc callbacks erts: Fix deallocation in removed carrier erts: Change naive list to rb-tree of carriers in AOFF allocator erts: Prepare aoff allocator for carrier migration erts: Make carrier header sizes customizable erts: Add "bestfit within carrier" for aoff allocator (aoffcbf)
| * | | | | | | erts: Remove SBMBC allocatorSverker Eriksson2013-06-031-2/+1
| | |_|_|_|/ / | |/| | | | |
* | | | | | | beam_lib: Correct wrong type specificationBjörn Gustavsson2013-06-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The function was updated in 5805b576, but not the type specificatin.
* | | | | | | Merge branch 'bmk/snmp/snmp424_integration/r16' into maintMicael Karlberg2013-06-031-1/+3
|\ \ \ \ \ \ \
| * \ \ \ \ \ \ Merge branch 'bmk/snmp/agent/mib_storage_behaviour/OTP-11107' into ↵Micael Karlberg2013-05-281-1/+3
| |\ \ \ \ \ \ \ | | |_|/ / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bmk/snmp/snmp424_integration/r16 Conflicts: lib/snmp/doc/src/notes.xml
| | * | | | | | [stdlib] Updated for snmp deprecationsMicael Karlberg2013-05-281-1/+3
| | | |/ / / / | | |/| | | |
* | | | | | | Merge branch 'nox/erl_eval-receive/OTP-11137' into maintFredrik Gustafsson2013-06-032-57/+12
|\ \ \ \ \ \ \ | |_|_|/ / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * nox/erl_eval-receive/OTP-11137: Updated primary bootstrap for erl_eval Added preloaded prim_eval Fix receive support in erl_eval with a BEAM module
| * | | | | | Fix receive support in erl_eval with a BEAM moduleAnthony Ramine2013-05-282-57/+12
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using the low-level BEAM instructions, we can loop over each message in the process queue and removes the first message that matches, without receiving them all to later send them back to itself. The function prim_eval:'receive'/2 is equivalent to the following pseudo-code: 'receive'(F, T) -> RESET MESSAGE QUEUE POINTER, LOOP: case PEEK CURRENT MESSAGE WITH TIMEOUT T of {ok,Msg} -> case F(Msg) of nomatch -> DECREMENT TIMEOUT T, ADVANCE MESSAGE QUEUE POINTER, GOTO LOOP; Result -> RESET MESSAGE QUEUE POINTER, Result end; timeout -> RESET MESSAGE QUEUE POINTER, timeout end. To not break Dialyzer and other tools, we use a stub Erlang module which abstract code is forcefully inserted into prim_inet.erl afterwards compilation.
* | | | | | Merge branch 'bjorn/stdlib/improve-ls/OTP-11108' into maintBjörn Gustavsson2013-05-293-6/+15
|\ \ \ \ \ \ | |/ / / / / |/| | | | | | | | | | | | | | | | | * bjorn/stdlib/improve-ls/OTP-11108: Teach c:ls/1 to show non-directory files
| * | | | | Teach c:ls/1 to show non-directory filesBjörn Gustavsson2013-05-223-6/+15
| | |_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In an email to erlang-questions, Bengt Kleberg wrote: When I use c:ls/1 it reminds me so much of Unix "ls" that I expect c:ls("filename") to work. The resulting error surprises me every time (not the same day). While teaching c:ls/1 to show non-directory files, update the error handling to make use of the POSIX error codes from file:list_dir/1 and file:format_error/1 (which had not been invented when the c module was first implemented). Suggested-by: Bengt Kleberg Test-suite-by: Bengt Kleberg
* | | | | beam_lib, compile: Replace use of deprecated crypto functionsBjörn Gustavsson2013-05-201-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since both the STDLIB and compiler applications turn warnings into errors, we must stop using the old deprecated crypto functions. While we are at it, generalize the format of the key tuple returned by beam_lib:make_crypto_key/2 to facilitate introducing new crypto methods in the future. Change the format to: {Type,Key,IV,BlockSize} where Type, Key, and IV are the first three arguments for either crypto:block_encrypt4/ or crypto:block_decrypt/4, and BlockSize is the block size for the crypto algorithm (it is needed to properly pad the plaintext blocks before encryption).
* | | | | crypto: Correct deprecated informationIngela Anderton Andin2013-05-201-14/+58
|/ / / /
* | | | Merge branch 'siri/cuddle-with-tests' into maintSiri Hansen2013-05-172-6/+35
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | * siri/cuddle-with-tests: Fix gen_server_SUITE:call_with_huge_message_queue Fix zip_SUITE:borderline test
| * | | | Fix gen_server_SUITE:call_with_huge_message_queueSiri Hansen2013-05-031-3/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This test always fails when gen is native compiled, since the optmization is not implemented then. The test is now skipped when running with hipe. The test does also quite often fail on one of the test hosts which runs in a virtual machine. The reason is that the clock runs "in bursts" on this host, which is outside of the control of the erlang VM and probably due to the fact that the host runs as a virtual machine. To overcome this problem, the echo message is now sent 10000 times instead of 10 times - i.e. the test run is prolonged in order to even out the effect of the bursts.
| * | | | Fix zip_SUITE:borderline testSiri Hansen2013-05-021-3/+22
| | | | | | | | | | | | | | | | | | | | | | | | | This test fails on a test host where no proper unix unzip is installed. This has been corrected.
* | | | | [stdlib] Fix pretty printing of invalid formsHans Bolinder2013-05-162-18/+58
| | | | | | | | | | | | | | | | | | | | Thanks to Tomáš Janoušek.
* | | | | ssl & crypto: Generalize the remaining crypto APIIngela Anderton Andin2013-05-081-1/+1
| | | | |
* | | | | crypto: New API for ciphersIngela Anderton Andin2013-05-081-0/+61
| | | | |
* | | | | crypto: Deprecate functions, update doc and specsIngela Anderton Andin2013-05-081-0/+72
| |_|_|/ |/| | |
* | | | Merge branch 'sverk/ets-test-cuddle' into maintSverker Eriksson2013-05-061-15/+53
|\ \ \ \ | |_|_|/ |/| | | | | | | | | | | * sverk/ets-test-cuddle: stdlib: Make memcheck in ets_SUITE less sensitive
| * | | stdlib: Make memcheck in ets_SUITE less sensitiveSverker Eriksson2013-04-191-15/+53
| | | |
* | | | Merge branch 'nox/fix-epp-file-attrs/OTP-11079' into maintFredrik Gustafsson2013-05-032-1/+5
|\ \ \ \ | |_|/ / |/| | | | | | | | | | | * nox/fix-epp-file-attrs/OTP-11079: Fix an inconsistent state in epp