aboutsummaryrefslogtreecommitdiffstats
path: root/erts
AgeCommit message (Collapse)Author
2015-10-08Take out automatic insertion of 'undefined' from typed record fieldsKostis Sagonas
Background ----------- In record fields with a type declaration but without an initializer, the Erlang parser inserted automatically the singleton type 'undefined' to the list of declared types, if that value was not present there. I.e. the record declaration: -record(rec, {f1 :: float(), f2 = 42 :: integer(), f3 :: some_mod:some_typ()}). was translated by the parser to: -record(rec, {f1 :: float() | 'undefined', f2 = 42 :: integer(), f3 :: some_mod:some_typ() | 'undefined'}). The rationale for this was that creation of a "dummy" #rec{} record should not result in a warning from dialyzer that e.g. the implicit initialization of the #rec.f1 field violates its type declaration. Problems --------- This seemingly innocent action has some unforeseen consequences. For starters, there is no way for programmers to declare that e.g. only floats make sense for the f1 field of #rec{} records when there is no `obvious' default initializer for this field. (This also affects tools like PropEr that use these declarations produced by the Erlang parser to generate random instances of records for testing purposes.) It also means that dialyzer does not warn if e.g. an is_atom/1 test or something more exotic like an atom_to_list/1 call is performed on the value of the f1 field. Similarly, there is no way to extend dialyzer to warn if it finds record constructions where f1 is not initialized to some float. Last but not least, it is semantically problematic when the type of the field is an opaque type: creating a union of an opaque and a structured type is very problematic for analysis because it fundamentally breaks the opacity of the term at that point. Change ------- To solve these problems the parser will not automatically insert the 'undefined' value anymore; instead the user has the option to choose the places where this value makes sense (for the field) and where it does not and insert the | 'undefined' there manually. Consequences of this change ---------------------------- This change means that dialyzer will issue a warning for all places where records with uninitialized fields are created and those fields have a declared type that is incompatible with 'undefined' (e.g. float()). This warning can be suppressed easily by adding | 'undefined' to the type of this field. This also adds documentation that the user really intends to create records where this field is uninitialized.
2015-10-06Merge branch 'maint'Sverker Eriksson
2015-10-06Merge branch 'sverk/erts/doc-review' into maintSverker Eriksson
* sverk/erts/doc-review: erts: Spell-check erlang.xml erts: Review newer additions to erlang.xml erts: Review module erlang docs erts: Update module erlang docs erts: Review time correction docs erts: Update erts time correction docs
2015-10-05erts: Spell-check erlang.xmlSverker Eriksson
2015-10-05Merge branch 'maint'Lukas Larsson
2015-10-05Merge branch 'lukas/erts/fix_ptab_assert/OTP-13028' into maintLukas Larsson
2015-10-02Merge branch 'maint'Zandra
2015-10-02Merge branch 'essen/missing-behavior-absform' into maintZandra
* essen/missing-behavior-absform: Add missing behavior/behaviours to absform docs
2015-10-01erts: Review newer additions to erlang.xmlSverker Eriksson
Trying to adopt same style as done by xsipewe in e17e236cd1661bc for later additions.
2015-10-01erts: Review module erlang docsSverker Eriksson
2015-10-01erts: Update module erlang docsxsipewe
Rebased 6ac77046b05cd3cb7b117 on OTP-18.1 Conflicts: erts/doc/src/erlang.xml
2015-10-01erts: Review time correction docsSverker Eriksson
2015-10-01erts: Update erts time correction docsxsipewe
2015-10-01Merge branch 'maint'Henrik Nord
2015-10-01Merge branch 'maint-17' into maintHenrik Nord
Conflicts: OTP_VERSION erts/doc/src/notes.xml erts/vsn.mk lib/debugger/doc/src/notes.xml lib/debugger/vsn.mk otp_versions.table
2015-09-30Merge branch 'maint'Henrik Nord
2015-09-30Merge branch 'c-rack/fix-list_to_bitstring-example' into maintHenrik Nord
* c-rack/fix-list_to_bitstring-example: Typos in documentation example of list_to_bitstring/1 OTP-13017
2015-09-28erts: Remove assertion that ptab is emptyLukas Larsson
Another process may already have been placed in this slot since the free och the process struct can be scheduled for later.
2015-09-23Merge tag 'OTP-18.1'Henrik Nord
=== OTP-18.1 === Changed Applications: - compiler-6.0.1 - crypto-3.6.1 - debugger-4.1.1 - dialyzer-2.8.1 - diameter-1.11 - erts-7.1 - eunit-2.2.11 - hipe-3.13 - inets-6.0.1 - kernel-4.1 - mnesia-4.13.1 - odbc-2.11.1 - public_key-1.0.1 - sasl-2.6 - ssh-4.1 - ssl-7.1 - stdlib-2.6 - tools-2.8.1 - wx-1.5 Unchanged Applications: - asn1-4.0 - common_test-1.11 - cosEvent-2.2 - cosEventDomain-1.2 - cosFileTransfer-1.2 - cosNotification-1.2 - cosProperty-1.2 - cosTime-1.2 - cosTransactions-1.3 - edoc-0.7.17 - eldap-1.2 - erl_docgen-0.4 - erl_interface-3.8 - et-1.5.1 - gs-1.6 - ic-4.4 - jinterface-1.6 - megaco-3.18 - observer-2.1 - orber-3.8 - os_mon-2.4 - ose-1.1 - otp_mibs-1.1 - parsetools-2.1 - percept-0.8.11 - reltool-0.7 - runtime_tools-1.9.1 - snmp-5.2 - syntax_tools-1.7 - test_server-3.9 - typer-0.9.9 - webtool-0.9 - xmerl-1.3.8 Conflicts: OTP_VERSION erts/vsn.mk
2015-09-22Adjust test case for missing applicationsHans Bolinder
2015-09-21Prepare releaseErlang/OTP
2015-09-17Merge branch 'maint'Rickard Green
* maint: erts: Make sure to deal with EINTR write failures
2015-09-17Merge branch 'lukas/erts/ttsl_eintr/OTP-12987' into maintRickard Green
* lukas/erts/ttsl_eintr/OTP-12987: erts: Make sure to deal with EINTR write failures
2015-09-17Merge branch 'maint'Henrik Nord
2015-09-17Exclude ose application from upgrade testSiri Hansen
2015-09-17Merge branch 'goertzenator/enif_make_pid-unused_param' into maintHenrik Nord
* goertzenator/enif_make_pid-unused_param: fix unused parameter warning in enif_make_pid OTP-12989
2015-09-17Merge branch 'mikpe/erts-binary_to_integer-fix' into maintHenrik Nord
* mikpe/erts-binary_to_integer-fix: erts: fix binary_to_integer boundary case OTP-12988
2015-09-16erts: Make sure to deal with EINTR write failuresLukas Larsson
2015-09-15Typos in documentation example of list_to_bitstring/1Constantin Rack
2015-09-10Merge branch 'maint'Ingela Anderton Andin
2015-09-10Merge branch 'sverk/inet-packet-ssl_tls-passive' into maintSverker Eriksson
* sverk/inet-packet-ssl_tls-passive: erts: Fix inet packet mode ssl_tls for passive mode
2015-09-09Merge branch 'maint'Rickard Green
* maint: Add configure switch --disable-saved-compile-time Fix ethread events with timeout Improve choice of clock sources at build time
2015-09-09Merge branch 'rickard/disable-saved-compile-time/OTP-12971' into maintRickard Green
* rickard/disable-saved-compile-time/OTP-12971: Add configure switch --disable-saved-compile-time Conflicts: HOWTO/INSTALL.md
2015-09-09Merge branch 'rickard/clock-sources/OTP-12945' into maintRickard Green
* rickard/clock-sources/OTP-12945: Improve choice of clock sources at build time
2015-09-09Merge branch 'rickard/event-tmo/OTP-12954' into maintRickard Green
* rickard/event-tmo/OTP-12954: Fix ethread events with timeout
2015-09-09Add configure switch --disable-saved-compile-timeRickard Green
2015-09-07Prepare releaseErlang/OTP
2015-09-07Merge branch 'sverk/trace-process_dump-matchstate-17/OTP-12968' into maint-17Erlang/OTP
* sverk/trace-process_dump-matchstate-17/OTP-12968: erts: Add testcase for tracing whith 'process_dump' erts: Fix bug when tracing with 'process_dump'
2015-09-07erts: Fix inet packet mode ssl_tls for passive modeSverker Eriksson
Caused stack corruption leading to VM crash on windows. {packet,ssl_tls} is undocumented by the way.
2015-09-07Merge branch 'maint'Sverker Eriksson
2015-09-02Merge branch 'maint' into sverk/trace-process_dump-matchstateSverker Eriksson
Conflicts: erts/emulator/beam/erl_printf_term.c erts/emulator/beam/erl_term.c erts/emulator/beam/utils.c
2015-09-01erts: Add testcase for tracing whith 'process_dump'Sverker Eriksson
of a process with a matchstate on the stack.
2015-09-01erts: Fix bug when tracing with 'process_dump'Sverker Eriksson
If the process stack contained a match state the print function would crash the vm as it was not recognized by tag_val_def(). Add new MATCHSTATE_DEF returned by tag_val_def(). All other callers either ignore it or has a default clause to handle invalid terms.
2015-08-31Merge branch 'maint'Sverker Eriksson
2015-08-31Merge branch 'sverk/hipe-fix-literal-crc' into maintSverker Eriksson
* sverk/hipe-fix-literal-crc: erts,hipe,dialyzer: Fix hipe checkum of target runtime system erts: Change THE_NON_VALUE to not be hard coded in hipe compiler OTP-12962 OTP-12963 OTP-12964
2015-08-31erts,hipe,dialyzer: Fix hipe checkum of target runtime systemSverker Eriksson
Main problem: A faulty HIPE_LITERAL_CRC was not detected by the loader. Strangeness #1: Dialyzer should ask the hipe compiler about the target checksum, not an internal bif. Strangeness #2: The HIPE_SYSTEM_CRC checksum was based on the HIPE_LITERALS_CRC checksum. Solution: New HIPE_ERTS_CHECKSUM which is an bxor of the two (now independent) HIPE_LITERALS_CRC and HIPE_SYSTEM_CRC. HIPE_LITERALS_CRC represents values that are assumed to stay constant for different VM configurations of the same arch, and are therefor hard coded into the hipe compiler. HIPE_SYSTEM_CRC represents values that may differ between VM variants. By default the hipe compiler asks the running VM for this checksum, in order to create beam files for the same running VM. The hipe compiler can be configured (with "make XCOMP=yes ...") to create beam files for another VM variant, in which case HIPE_SYSTEM_CRC is also hard coded. ToDo: Treat all erts properties the same. Either ask the running VM or hard coded into hipe (if XCOMP=yes). This will simplify and reduce the risk of dangerous mismatches. One concern might be the added overhead from more frequent calls to hipe_bifs:get_rts_param.
2015-08-31Merge branch 'maint'Sverker Eriksson
2015-08-31Merge branch 'sverk/hipe-maps-merge-wrapper' into maintSverker Eriksson
* sverk/hipe-maps-merge-wrapper: erts: Fix hipe bug for maps:merge/2 erts: Beautify hipe wrapper macro OTP-12965
2015-08-28erts: Fix hipe bug for maps:merge/2Sverker Eriksson
Add forgotten HIPE_WRAPPER_BIF_DISABLE_GC which could lead to stack-heap overrun if unlucky with the yielding during maps:merge when called by native hipe code.
2015-08-28erts: Beautify hipe wrapper macroSverker Eriksson