Is there a way to suppress :OutputWarning: in Pact verify? - pact-lang

I have some models (property tests and invariants) in my module, and I want them to be verified using Pact's formal verification. When running (verify 'my-module), where 'my-module depends on the coin-v4 contract, I am receiving output warnings:
:OutputWarning: Unsupported operation: validate-principal: substituting True
:OutputWarning: Unsupported operation: is-charset: substituting True
These warnings are being emitted by the coin contract, not my contract. Can I suppress these warnings?

Related

How to abort a macports portfile on an error condition?

I working on a version bump on the cc65 and encountered a problem with the linuxdoc-tools. Since I can't fix the linuxdoc-tools and there is a simple workaround possible I decided to add an if statement to inform the user together with the workaround:
if {! [file exists ${prefix}/bin/perl] } {
ui_error "
«${prefix}/bin/perl» is missing but the linuxdoc-tools depends on it.
Please create an appropriate symbolic link for linuxdoc-tools to work.
"
exit 1
}
Crude but the best I can do since I'm neither the perl5 nor the linuxdoc-tools maintainer and I don't want to spend to much time on a version bump.
However, the MacPorts doesn't understand exit 1 and ui_error won't stop execution on its own.
How do I stop the execution so not to waste the users time on a build which will otherwise fail right at the end.
Use return -code error "error message", or the shorthand for the same thing, error "error message".
Note that you should use ui_error before that to print a human-readable message for the user – while the error message is also being printed, it can sometimes get lost in the output.
Additionally, note that $prefix/bin/perl is a build dependency of linuxdoc-tools. If it is also needed at runtime, you should submit a pull request that adds depends_run path:bin/perl:perl5 to the port rather than attempting to fix this bug in your port.

What may be the reason why I get "Test ignored." message while running any test class in Apex?

Tests ignored: 14, passed: 0
Whenever I run any test class I get this type of messages:
Test ignored.
Test method AccountAddressHelperTest.testInvalidBillingCountry was
never reported as completed. Trigger.AllOppLineItemTriggers: line 188,
column 31: Method does not exist or incorrect signature: void
updateMISROnOpportunity(Map<Id,OpportunityLineItem>,
Map<Id,OpportunityLineItem>) from the type OppLineItemHelper
You have compilation failures. What happens if you hit Setup -> Classes -> Compile all?
You or your colleague edited something, probably in file OppLineItemHelper. Or some other file this file reuses. And now not everything compiles, dependencies aren't met. So best thing SF can do is skip these tests.
You can edit like that in sandboxes, SF will not always block you. But compile errors will prevent deployment to prod even before any tests are run

Frama-c Assertion

Recently I have been working with frama-c and I have faced a problem which is a bit confusing.
I have written a very simple program in frama-c which is this:
void main(void)
{
int a = 3;
int b = 4;
/*# assert a == b;*/
}
I expect frama-c to say the assertion is not valid which in GUI this is shown by red bullet, but instead frama-c says the assertion is not valid according to value (under hypothesis), which is shown by orange-red bullet.
My question is why would frama-c say the assertion is not valid under hypothesis?
What are the possible hypotheses?
I am asking this because my program is very simple and I can't find any hypothesis or dependency in my program which is related to the assertion and I guess frama-c should just say the assertion is not valid.
If you have graphviz configured with your Frama-C installation (i.e. it was available when Frama-C was configured, either manually or via opam), you can double-click the property in the Properties panel, and a window should open with the following dependency graph for the property:
In it, we can see all the hypotheses used by a property, and so we see that the "under hypotheses" mentioned is that of the reachability of the assertion. Eva (value plug-in) computes an over-approximation of reachable states, so it cannot prove that a given state is reachable, only that it is unreachable.
Currently, the only plug-in which can definitely prove reachability statuses is PathCrawler. However, in practice this is rarely an issue.
An alternative way to see the dependencies of a property proven under hypotheses is to use the Report plugin, on the command-line:
$ frama-c -val c.c -then -report
[report] Computing properties status...
--------------------------------------------------------------------------------
--- Properties of Function 'main'
--------------------------------------------------------------------------------
[ Alarm ] Assertion (file c.c, line 5)
By Value, with pending:
- Unreachable program point (file c.c, line 5)
--------------------------------------------------------------------------------
--- Status Report Summary
--------------------------------------------------------------------------------
1 Alarm emitted
1 Total
--------------------------------------------------------------------------------
The pending information lists all the properties required to finish the proof. For statutes emitted by the Value/Eva plugin, the only dependences emitted will always be reachability ones.
(This is actually misleading: the status of the n th property actually depends on the statuses for the properties k with k < n. This would generate a dependency graph too big, so those dependencies are not tracked.)

Not able to set password in PAM module using pam_set_item()

I have created a custom PAM module to login to Linux using my custom authentication method.
After my module is done authenticating it receives the actual username and password (plaintext) of the Linux user account from a db.
Now I am trying to set the username and password using:
pam_set_item(pamh, PAM_USER, user) and pam_set_item(pamh, PAM_AUTHTOK, passwd), after doing pam_start("m_pamconf", user, &conv, &pamh).
The "m_pamconf" is my pam configuration file which contains:
auth pam_unix.so nullok_secure use_first_pass
The username is set successfully using this but the password doesn't seem to work, as I am getting a password prompt (which of course should not happen if it takes the password that i have supplied).
Any help is appreciated. Thanks.
I'm getting the password prompt when I use the try_first_pass flag,
if I instead use use_first_pass, the module simply fails and gives the following error in debug logs:
auth could not identify password for [username]
This is my /etc/pam.d/sudo :
#%PAM-1.0
# my pam test
auth requisite pam_test.so
session required pam_env.so readenv=1 user_readenv=0
session required pam_env.so readenv=1 envfile=/etc/default/locale user_readenv=0
#include common-auth
#include common-account
#include common-session-noninteractive
The first line uses the module that I have created and from which I am trying to authenticate the user by doing pam_start("mypamd", user, &conv, &pamh) and then pam_authenticate(pamh, 0) using the auth method of pam_unix.so as specified above in "m_pamconf".
You may need to set the module to sufficient. Having it set to requisite means that it is required to execute, and will fail the stack immediately if it returns false. It does not mean that it will make the stack succeed. According to the docks (http://www.linux-pam.org/Linux-PAM-html/sag-configuration-file.html)
For the simple (historical) syntax valid control values are:
required
failure of such a PAM will ultimately lead to the PAM-API returning failure but only after the remaining stacked modules (for
this service and type) have been invoked.
requisite
like required, however, in the case that such a module returns a failure, control is directly returned to the application or to the
superior PAM stack. The return value is that associated with the first
required or requisite module to fail. Note, this flag can be used to
protect against the possibility of a user getting the opportunity to
enter a password over an unsafe medium. It is conceivable that such
behavior might inform an attacker of valid accounts on a system. This
possibility should be weighed against the not insignificant concerns
of exposing a sensitive password in a hostile environment.
sufficient
if such a module succeeds and no prior required module has failed the PAM framework returns success to the application or to the
superior PAM stack immediately without calling any further modules in
the stack. A failure of a sufficient module is ignored and processing
of the PAM module stack continues unaffected.
optional
the success or failure of this module is only important if it is the only module in the stack associated with this service+type.
include
include all lines of given type from the configuration file specified as an argument to this control. substack
include all lines of given type from the configuration file specified as an argument to this control. This differs from include in
that evaluation of the done and die actions in a substack does not
cause skipping the rest of the complete module stack, but only of the
substack. Jumps in a substack also can not make evaluation jump out of
it, and the whole substack is counted as one module when the jump is
done in a parent stack. The reset action will reset the state of a
module stack to the state it was in as of beginning of the substack
evaluation.

Warning causing android build to fail

I have native android code that i bundle with my app. This has always been working for many months. But today, the same code is failing with warnings. I think the last successful build was two days ago:
--
Note: there were 5 references to unknown classes.
You should check your configuration for typos.
(http://proguard.sourceforge.net/manual/troubleshooting.html#unknownclass)
Note: there were 1927 unkept descriptor classes in kept class members.
You should consider explicitly keeping the mentioned classes
(using '-keep').
(http://proguard.sourceforge.net/manual/troubleshooting.html#descriptorclass)
Note: there were 2 unresolved dynamic references to classes or interfaces.
You should check if you need to specify additional program jars.
(http://proguard.sourceforge.net/manual/troubleshooting.html#dynamicalclass)
Note: there were 4 class casts of dynamically created class instances.
You might consider explicitly keeping the mentioned classes and/or
their implementations (using '-keep').
(http://proguard.sourceforge.net/manual/troubleshooting.html#dynamicalclasscast)
Warning: there were 23 unresolved references to program class members.
Your input classes appear to be inconsistent.
You may need to recompile the code.
(http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedprogramclassmember)
Exception while processing task
java.io.IOException: Please correct the above warnings first.
at proguard.Initializer.execute(Initializer.java:473)
at proguard.ProGuard.initialize(ProGuard.java:233)
at proguard.ProGuard.execute(ProGuard.java:98)
at proguard.gradle.ProGuardTask.proguard(ProGuardTask.java:1074)
at com.android.build.gradle.tasks.AndroidProGuardTask.doMinification(AndroidProGuardTask.java:139)
at com.android.build.gradle.tasks.AndroidProGuardTask$1.run(AndroidProGuardTask.java:115)
at com.android.builder.tasks.Job.runTask(Job.java:48)
at com.android.build.gradle.tasks.SimpleWorkQueue$EmptyThreadContext.runTask(SimpleWorkQueue.java:41)
at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:227)
at java.lang.Thread.run(Thread.java:745)
:proguardRelease (Thread[Daemon worker,5,main]) completed. Took 6.197 secs.
:dexRelease (Thread[Daemon worker,5,main]) started.
:dexRelease
Executing task ':dexRelease' (up-to-date check took 0.058 secs) due to:
---
So, i have found out, proguard task will halt execution if there are warnings. While searching the net reveals various ways of dealing with these,the bottom line is to make sure you fix the warnings.

Resources