Should I call Cef.Shutdown() when shutdownOnProcessExit is set to true? - cefsharp

I'm initializing Cef as following
var cefSettings = new CefSettings {LogSeverity = LogSeverity.Disable};
Cef.Initialize(cefSettings, shutdownOnProcessExit: true);
I've noticed that if I don't explicitly call Cef.Shutdown() on my app exit it doesn't exit properly, and CefSharp.BrowserSuprocess.exe remains running.
Is this the expected behavior? Shouldn't Cef.Shutdown() be called implicitly in this case?
I'm using CefSharp build 45 (and about to upgrade to 47)

You need to explicitly call Cef.Shutdown() from the main thread(mostly UI) before you exit your application
https://github.com/cefsharp/CefSharp/issues/800#issuecomment-83198945
Cef runs as a sub-process, and has to be notified before you exit your application.
some tips on shutdown

Related

Error staging application: App staging failed in the buildpack compile phase in HWC Buildpack

I am trying to deploy my application built in ASP.Net 4.6.1. So I am using HWC Buildpack.
Below is my manifest.yml
---
applications:
- name: DRSN
random-route: true
memory: 128M
buildpack:
https://github.com/cloudfoundry/hwc-buildpack.git
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
The error that I am receiving is below.
Waiting for API to complete processing files...
Staging app and tracing logs...
Cell 0f7012eb-9e32-4fdf-ba92-85aee4639139 creating container for instance 34107c3c-1acb-4aa5-b435-b06516abcfcb
Cell 0f7012eb-9e32-4fdf-ba92-85aee4639139 successfully created container for instance 34107c3c-1acb-4aa5-b435-b06516abcfcb
Downloading app package...
Downloading build artifacts cache...
Downloaded build artifacts cache (231B)
Downloaded app package (19.5M)
Failed to compile droplet: Failed to compile droplet: fork/exec /tmp/buildpackdownloads/6c6dca8d638ac0d145d6581f9eb9a96a/bin/compile: permission denied
Exit status 223
Cell 0f7012eb-9e32-4fdf-ba92-85aee4639139 stopping instance 34107c3c-1acb-4aa5-b435-b06516abcfcb
Cell 0f7012eb-9e32-4fdf-ba92-85aee4639139 destroying container for instance 34107c3c-1acb-4aa5-b435-b06516abcfcb
Error staging application: App staging failed in the buildpack compile phase
Can anyone help me resolve this issue? Am I not correct in my manifest.yml? Or is it something else?
I believe that the problem is that you're telling the system to use the HWC buildpack, but at the same time you're not setting the Windows stack (at least based on what info I can see). That means it's going to default to the Linux stack, which I believe is why you're seeing the fork/exec /tmp/buildpackdownloads/... error.
Try adding stack: windows to your manifest.yml or -s windows to your cf push command (for future reference, when you need help always include the full cf push command you're running).
PS: you shouldn't use https://github.com/cloudfoundry/hwc-buildpack.git that is telling the system to grab the master branch in whatever state it's currently in. That's a.) not reproducible and b.) not guaranteed to be in a working state. You should either use the platform provided buildpack names (from cf buildpacks) or append #<branch_or_tag> to the end of the URL so it picks a specific branch. All CF Buildpacks have tags for each release. It's strongly recommended you use a tagged release.

Firestore update is crashing app

let dataRef = database.collection("stores").document(store.id).collection("data").document("storeData")
var storeData: [String:Any] = [:]
storeData["seq"] = store.seq + 1
storeData["shiftSeq"] = store.shiftSeq + 1
dataRef.updateData(storeData)
I am receiving the following error when executing the above code. It was working fine until I upgraded to the latest version of Firebase/Firestore
* Assertion failure in -[FSTWriteStream startWithDelegate:], third_party/firebase/ios/Source/Firestore/Source/Remote/FSTStream.m:244
2017-12-08 10:48:47.819586-0500 centroOne[1833:473631] * Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'FIRESTORE INTERNAL ASSERTION FAILED: Delegate must be nil'
I removed a rule set that was attached to this document and the problem went away. The ruleset referenced a value in another document to make sure it existed.
I've faced this problem in swift recently and solved my problem by checking if documentId exists. In above case, please check store.id exits in your Firestore db and then run update method.

using node-inspector with meteor on windows

I am trying to use node-inspector to help debug my meteor app on windows. As indicated here: https://docs.meteor.com/commandline.html#meteordebug
running meteor debug should start the node-inspector portal at http://localhost:8080/debug?port=5858 by default.
I can navigate to the url, but do not see any files under "Sources" (or anywhere for that matter)
I've tried setting the port manually, and tried installing node-inspector via npm as well in case it was needed, and tried running "meteor NODE_OPTIONS='--debug' ...but those don't seem to help (and the NODE_OPTIONS parameter doesn't even work...)
what am I missing/why don't the files show up? how can I debug this debuggng issue...?
PS - i do see Notifications permission has been blocked as the user has dismissed the permission prompt several times. See https://www.chromestatus.com/features/6443143280984064 for more information.
in the dev console on the debugger tab. Could this cause any issues? Not really sure what notification permissions I supposedly blocked.
UPDATE:
Also getting these 3 errors popping up in the console:
Runtime.js:358 Assertion failed: Unknown experiment canvasInspection
Runtime._assert # Runtime.js:358
21:53:06.599 Runtime.js:367 TypeError: Cannot read property 'createSetting' of undefined
at WebInspector.FilterBar.setName (:8080/ui/FilterBar.js:62)
at WebInspector.NetworkPanel (:8080/network/NetworkPanel.js:47)
at Function.WebInspector.NetworkPanel._instance (:8080/network/NetworkPanel.js:408)
at eval (:8080/node/network/NetworkPanel.js:13)
at eval (<anonymous>)
at evaluateScript (Runtime.js:153)
at scriptSourceLoaded (Runtime.js:136)
at <anonymous>
Runtime._reportError # Runtime.js:367
21:53:06.772 Runtime.js:367 TypeError: Cannot read property 'sources' of undefined
at WebInspector.SourcesOverrides._hideChromeSpecifics (:8080/node/sources/SourcesOverrides.js:12)
at WebInspector.SourcesOverrides (:8080/node/sources/SourcesOverrides.js:5)
at eval (:8080/node/sources/SourcesOverrides.js:63)
at eval (<anonymous>)
at evaluateScript (Runtime.js:153)
at scriptSourceLoaded (Runtime.js:136)
at <anonymous>
many thanks for any help.

Release does not run. This application failed to start

My application works when it built in debug mode. But it does not run in release.
This application failed to start because it could not find or load the
Qt platform plugin "windows".
Reinstalling the application may fix this problem.
I copied dlls which the application required. I copied also qwindows.dll, qoffscreen.dll and libEGL.dll.
But libEGL.dll located in C:\qt\5.3\msvc2013\bin and `C:Qt\ToolsQtCreator\bin'. I compiled my application by msvc-11.0(2012).
--
I put platforms folder to exe directory and now application runs but crashes immediately in ntdll.dll!771e56bc()
Now my problem is similar to this one Why is ntdll.dll crashing my c++ executable?.
Can I make debug working like release but save debug mode?
--
Here is Application Verifier result for release mode. It does not happen for debug.
=======================================
VERIFIER STOP 00000006: pid 0xDF0: Corrupted heap pointer or using wrong heap.
00161000 : Heap handle used in the call.
093F8FF8 : Heap block involved in the operation.
00000004 : Size of the heap block.
06441000 : Heap where block was originally allocated.
=======================================
This verifier stop is not continuable. Process will be terminated
when you use the `go' debugger command.
=======================================
MyApp.exe has triggered a breakpoint.
AVRF: Noncontinuable verifier stop 00000006 encountered. Terminating process ...
The thread 0x1724 has exited with code -1073740767 (0xc0000421).
The program '[3568] MyApp.exe' has exited with code -1073740767 (0xc0000421).
--
Here is a top of a call stack
vrfcore.dll!6ae43466() Unknown
[Frames below may be incorrect and/or missing, no symbols loaded for vrfcore.dll]
[External Code]
qwindows.dll!0f0642cb() Unknown
qwindows.dll!0f065f8a() Unknown
qwindows.dll!0f0662bb() Unknown
Qt5Gui.dll!0f774cf3() Unknown
Qt5Gui.dll!0f774e75() Unknown
Qt5Gui.dll!0f7778d5() Unknown
But libEGL.dll located in C:\qt\5.3\msvc2013\bin and `C:Qt\ToolsQtCreator\bin'
You must not take any DLLs from C:\Qt\Tools\QtCreator\ -- these are private DLLs for Qt Creator, and they are incompatible with your application.
Only take DLLs from C:\Qt\5.3\msvc2013\bin and C:\Qt\5.3\msvc2013\plugins. Here is the required folder structure:
(source: http://qt-project.org/wiki/Deploy_an_Application_on_Windows )
This sounds like either a DLL is missing or the application expects it in a different path.
a) Use the Dependency Walker on your release build executable to check whether all DLL dependencies can be resolved.
b) Make sure that your platform plugin files are at the right location. I think they need to be in a folder called "platforms" (not absolutely sure though).
c) There is a post in the Qt forum about a similar problem. Maybe this helps you to track it down.

How to make SBT task fail and hence build itself?

I wrote a SBT task to run cssLint for my project using rhino. cssLint returns exit code to my SBT task.
My question is how to make the task fail if the exit code is non-zero?
I don't want to throw any exceptions. I want my last line of the task result to show [Failed] instead of [success] and exit code of my SBT task to be non-zero.
SAMPLE
MyTask {
val exitcode = //rhino functions
//what to do??
}
The actual intent is to fail the build if css errors are present.
The way of failing the build without producing the stacktrace on the console is using the exceptions that are specifically handled:
for sbt.MessageOnlyException an error message is logged twice (without task name and then with task name) and the build is stopped
mix in sbt.FeedbackProvidedException or sbt.UnprintableException to implement custom exceptions for which sbt does not print a stacktrace. The string with task name and exception's toString is logged on the top level once and the build is stopped. It is expected that essential information for the user is already logged before throwing these.
Disclaimer: I've not seen this information in sbt manual. Extracted from the sources of sbt 0.13.16. sbt.FeedbackProvidedException is used this way by sbt compiler, sbt tests and by sbt-web and Play sbt plugins.
My understanding is that the success message is printed out always unless
showSuccess setting is set to false or
a task throws an exception.
In your particular case you want to report an error and so you should throw an exception or a value of the type of the result that might be considered a sort of exception like None or Failure.
Say, you've got the following task defined in build.sbt:
lazy val tsk = taskKey[Unit]("Task that always fails")
tsk := {
throw new IllegalStateException("a message")
}
When you execute the tsk task, the exception is printed out with no [success] afterwards.
[no-success]> tsk
[trace] Stack trace suppressed: run last *:tsk for the full output.
[error] (*:tsk) java.lang.IllegalStateException: a message
[error] Total time: 0 s, completed Feb 15, 2014 11:45:27 PM
I would rather prefer avoiding this style of programming and rely on Option as a way to report an issue with processing.
With the following tskO definition:
lazy val tskO = taskKey[Option[String]]("Task that reports failure as None")
tskO := None
you'd then check the result and if it's None you'd know it's a failure.

Resources