andor_SUITE: Don't native-compile

Temporary commit to avoid the failures in t_andalso/1 and
t_orelse/1 test cases.
Disable native code if on_load is used

The on_load functionality does not work yet (will cause a crash)
if a module has been native-compiled. Fix it by disabling
native-code compilation if a module has an on_load attribute.
seq_trace_SUITE: Don't native-compile

Sequential tracing does not work on native-compiled modules.

(Other kind of tracing also don't work, but those test case
are already skipped.)
Inline less aggressively for native-code compilation

The native code compiler will get very slow if we do aggressive
inlining with the old inliner (i.e. without subsequent optimizations),
and the test case self_compile_old_inliner/1 may fail due to
a time-trap timeout.

Fix this by inlining less aggressively if we are compiling natively.
Avoid crash by skipping compilation_SUITE:on_load/1

compilation_SUITE:on_load/1 crashes if the compilation_SUITE module is
natively compiled. I don't know the exact reason for that, but it
seems to be that the module 'on_load' (which is not native-compiled)
is loaded and unloaded multiple times, and that it does not contain
exactly the same functions each time (inlining cause a function and a
function call to be removed).
Make erlang-mode more compatible with package.el

Package.el  and Emacs  package  repositories (like  ELPA or  Marmalade
place some requirements onto packages which are uploaded to them. This
commit does  minor cosmetic  changes which makes  it easier  to create
appropriate package file for those repositories.
fix reading compressed binary terms from Java

Larger compressed binary could not be decoded inside JInterface.

- applied a patch posted on erlang-questins in September 2009
  http://erlang.org/pipermail/erlang-patches/2009-September/000478.html
-> extended this patch as it alone was not enough to fix the bug

Problem was that when reading from an InputStream, you can only specify a maximum number of bytes to read. Java doesn't quarantee that it actually reads this many bytes - it could be less!
This patch now reads up until the expected size bytes. If there are more than expected, the actual number of available bytes is not printed (we probably shouldn't read the additional bytes, security-wise - the erlang external byte representation is broken in this case though).
release_handler:find_script/4 to use 're' matching in .appup scripts

The function release_handler:find_script/4 locates an .appup script
for a given application, and searches it for the matching up- or
downgrade script (given OldVsn). The original implementation of this
function used lists:keysearch/3 to find the matching script, but since
the .appup files nowadays may contain regexps instead of distinct versions,
that approach no longer works.

This patch uses re:run/2 to find a matching script instead.

Example:

Stock R15B:

Erlang R15B (erts-5.9) [source] [...]

Eshell V5.9  (abort with ^G)
1> release_handler:upgrade_script(stdlib,code:lib_dir(stdlib)).
** exception throw: {version_not_in_appup,"1.18"}
     in function  release_handler:find_script/4 (release_handler.erl, line 501)
     in call from release_handler:upgrade_script/2 (release_handler.erl, line 439)

Current patch:
Erlang R16B (erts-5.10) [source] [...]

Eshell V5.10  (abort with ^G)
1> release_handler:upgrade_script(stdlib,code:lib_dir(stdlib)).
{ok,"1.19",[restart_new_emulator,point_of_no_return]}
ignore calls to gs* modules if it is not built
Test supervisor pass through error
Have supervisor send errors up the chain

If a child fails to start, supervisor relies upon error_logger which does not
work when IO is inhibited. Instead pass the error up the chain and let someone
else use a proper Reason for any possible printouts.
Improve interoperability with SSH clients

This patch fixes a few problems of the SSH shell server that affect the
interoperability with SSH clients in widespread use.

First problem is that, whenever a channel_request message is
received with want_reply=true, the reply ends up being sent to the
servers channel id, not the clients channel id. This causes the client
to terminate the connection. The easiest solution to the problem appears
to be a new function in ssh_connection_manager.erl that translates the
servers channel id before sending the reply (in the same manner as
other functions do it).

Second problem is in ssh_cli.erl. When an SSH client sends a
window_change request between PTY allocation and starting the shell
(which appears to happen with some clients), ssh_cli.erl crashes
because #state.buf is yet 'undefined'. Allocating an empty buffer at PTY
allocation time solves the problem.

Affected SSH clients:
 - all clients based on SSH-2.0-TrileadSSH2Java_213 (problem #1)
 - SSH Term Pro (problem #2)
verify table row index constraints in SNMP set requests

When a set-request is received for table columns, check that the varbind
OIDs are syntactically correct. This includes checking that Table Entry
OID as well as the Column OID are present, and that the row index
contains an acceptable number of subidentifiers.

This check was not done carefully enough before, giving the following
test result from an erlang-snmp agent:

 Response: Version = SNMPv3, MsgId = 173, MaxSize = 2048
 Flags = Auth/Priv, SecurityModel = USM
 EngineId = [...], EngineBoots = 16, EngineTime = 81244, UserName = ...
 ContextEngineId = [...], ContextName = [...]
 Request Id = 173, Error Status = No Error , Error Index = 0
 Oid1 = snmpTargetAddrRowStatus , Type = Integer, Value = 4
 Oid2 = snmpTargetAddrTAddress , Type = OctetString, Value = ...
 Oid3 = snmpTargetAddrTimeout , Type = Integer, Value = 100
 Oid4 = snmpTargetAddrRetryCount , Type = Integer, Value = 3
 Oid5 = snmpTargetAddrTagList , Type = OctetString, Value = abc
 Oid6 = snmpTargetAddrParams , Type = OctetString, Value = abc
 Oid7 = snmpTargetAddrStorageType , Type = Integer, Value = 2
 Oid8 = snmpTargetAddrTDomain , Type = ObjectID, Value = 1.3.6.1.6.1.1

Please observe that a table row in snmptargetAddrParams is created
without errors, although an empty RowIndex was specified for all
columnar objects in the request. The index to that table is defined as
IMPLIED SnmpAdminString(1..32).
fix snmp_generic:split_index_to_keys/2

The function snmp_generic:split_index_to_keys/2 handles dynamic length
RowIndex members, but fails to check that their length actually falls
within the constraints given by the MIB.

The problem becomes real for table indices having an 'OCTET STRING'
syntax, e.g. OCTET STRING(1..32) where it is possible to pass
zero-length strings or strings longer than 32 chars without any
validation failure.
Enable silent start of wx

Add {silent_start, boolean()} option to wx:new/1 in order to be able
to suppress error messages during startup of wx.
add (de)compress roundtrip tests with larger values
Fix various doc typos for R15B03
Update version numbers
fix invalid return values from snmpTargetAddrExtTable

The is_set_ok/set callbacks from the snmpTargetAddrExtTable handlers can
return invalid column numbers in error responses. They store their data in
snmpTargetAddrTable from column #11 onwards and correctly convert the
column numbers before calling the generic table handler. When that
returns an error, however, the errorneous column number remains at >10
and causes a genErr in the further SNMP processing. Fix that by looking
for error responses from the generic table handler and correcting column
numbers therein.
fix error code for invalid get-requests

get-requests for scalar variables that have an instance OID of [] have
returned an noSuchObject error. Some SNMP testers consider this result
to be invalid (they expect a noSuchInstance error instead).

This change is purely cosmetic, but helps passing SNMP compliance tests.