Fullscreen Exclusive Unhandled Exception - java

I am currently implementing a fullscreen-exclusive mode in my Java2D-Application. While testing on several systems (all Windows 7/8.x) with most recent (18. February 2015) JRE, I can reproduce a application crash which does NOT throw an exception:
If you are in fullscreen-exclusive mode (yes: I check for supported display modes) and turn off the monitor which displays the application, the application crashes. No exception thrown. My guess is, that the vsync-component of Java2D crashes, but I lack the required experience in Java. Can someone help me out here on how I can handle this exception (by switching back to windowed-mode for example). Something like "isDisplayDeviceReady()" might also be helpful.
Thank you for your time.
This is what Windows shows me after application crash:
Problemsignatur:
Problemereignisname: APPCRASH
Anwendungsname: javaw.exe Anwendungsversion: 8.0.31.13
Anwendungszeitstempel: 54925fd3 Fehlermodulname: StackHash_915d
Fehlermodulversion: 6.1.7601.18247
Fehlermodulzeitstempel: 521ea8e7 Ausnahmecode: c0000374
Ausnahmeoffset: 000ce753
Betriebsystemversion: 6.1.7601.2.1.0.256.48 Gebietsschema-ID: 2055
Zusatzinformation 1: 915d
Zusatzinformation 2:
915d12e427f130d100a5a047f72f08c0
Zusatzinformation 3: 8dd4
Zusatzinformation 4: 8dd4ced129ecb79ce625a0ed8d82cee9

Related

How to know from which activity an error comes from my application in production?

My application is 2 months in production and I was checking the section that shows the play console crashing and I have been able to solve some problems, but there are some in which I do not know exactly what activity they come from, mi error is java.lang.IllegalStateException and when I press see more:
java.lang.IllegalStateException:
at androidx.work.impl.utils.ForceStopRunnable.run (ForceStopRunnable.java:115)
at androidx.work.impl.utils.SerialExecutor$Task.run (SerialExecutor.java:91)
at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641)
at java.lang.Thread.run (Thread.java:919)
Caused by: android.database.sqlite.SQLiteCantOpenDatabaseException:
at android.database.sqlite.SQLiteConnection.nativeOpen (Native Method)
at android.database.sqlite.SQLiteConnection.open (SQLiteConnection.java:300)
at android.database.sqlite.SQLiteConnection.open (SQLiteConnection.java:218)
at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked (SQLiteConnectionPool.java:737)
at android.database.sqlite.SQLiteConnectionPool.open (SQLiteConnectionPool.java:284)
at android.database.sqlite.SQLiteConnectionPool.open (SQLiteConnectionPool.java:251)
at android.database.sqlite.SQLiteDatabase.openInner (SQLiteDatabase.java:1386)
at android.database.sqlite.SQLiteDatabase.open (SQLiteDatabase.java:1331)
at android.database.sqlite.SQLiteDatabase.openDatabase (SQLiteDatabase.java:967)
at android.database.sqlite.SQLiteDatabase.openDatabase (SQLiteDatabase.java:955)
at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked (SQLiteOpenHelper.java:448)
at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase (SQLiteOpenHelper.java:391)
at androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper$OpenHelper.getWritableSupportDatabase (FrameworkSQLiteOpenHelper.java:145)
at androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper.getWritableDatabase (FrameworkSQLiteOpenHelper.java:106)
at androidx.room.RoomDatabase.beginTransaction (RoomDatabase.java:352)
at androidx.work.impl.utils.ForceStopRunnable.cleanUp (ForceStopRunnable.java:156)
at androidx.work.impl.utils.ForceStopRunnable.run (ForceStopRunnable.java:87)
Out of 750 users who have installed my application it happened to one 5 times, Should a bug that happened to a single user (of 750) be investigated or not?, And most importantly, how can I know exactly where the error came from?
When throwing an exception, put the user that is currently being accessed so you can track it down. Put as much info in the exception as possible that will help you figure out which item might be causing it.
https://stackify.com/best-practices-exceptions-java/
These are some good examples as well as good practices to follow. In those messages that are mentioned, add the user id or something that helps you identify what's going on. Learn to make custom exceptions and catch the most specific exceptions you can. Don't just catch Exception, its better to be specific about the exception your catching rather than casting a wide net.

error when opening a lucene index: java.io.IOException: Map failed

I have a problem which I think is the same as that described here:
Error when opening a lucene index: Map failed
However the solution does not apply in this case so I am providing more details and asking again.
The index is created using Solr 5.3
The line of code causing the exception is:
IndexReader indexReader = DirectoryReader.open(FSDirectory.open(Paths.get("the_path")));
The exception stacktrace is:
Exception in thread "main" java.io.IOException: Map failed: MMapIndexInput(path="/mnt/fastdata/ac1zz/JATE/solr-5.3.0/server/solr/jate/data_aclrd/index/_5t.tvd") [this may be caused by lack of enough unfragmented virtual address space or too restrictive virtual memory limits enforced by the operating system, preventing us to map a chunk of 434505698 bytes. Please review 'ulimit -v', 'ulimit -m' (both should return 'unlimited'), and 'sysctl vm.max_map_count'. More information: http://blog.thetaphi.de/2012/07/use-lucenes-mmapdirectory-on-64bit.html]
at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:907)
at org.apache.lucene.store.MMapDirectory.map(MMapDirectory.java:265)
at org.apache.lucene.store.MMapDirectory.openInput(MMapDirectory.java:239)
at org.apache.lucene.codecs.compressing.CompressingTermVectorsReader.<init>(CompressingTermVectorsReader.java:144)
at org.apache.lucene.codecs.compressing.CompressingTermVectorsFormat.vectorsReader(CompressingTermVectorsFormat.java:91)
at org.apache.lucene.index.SegmentCoreReaders.<init>(SegmentCoreReaders.java:120)
at org.apache.lucene.index.SegmentReader.<init>(SegmentReader.java:65)
at org.apache.lucene.index.StandardDirectoryReader$1.doBody(StandardDirectoryReader.java:58)
at org.apache.lucene.index.StandardDirectoryReader$1.doBody(StandardDirectoryReader.java:50)
at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:731)
at org.apache.lucene.index.StandardDirectoryReader.open(StandardDirectoryReader.java:50)
at org.apache.lucene.index.DirectoryReader.open(DirectoryReader.java:63)
at uk.ac.shef.dcs.jate.app.AppATTF.extract(AppATTF.java:39)
at uk.ac.shef.dcs.jate.app.AppATTF.main(AppATTF.java:33)
The suggested solutions as in the exception message do not work in this case because I am running the application on a server and I do not have permissions to change those.
Namely,
ulimit -v unlimited
prints: "-bash: ulimit: virtual memory: cannot modify limit: Operation not permitted"
and
sysctl -w vm.max_map_count=10000000
gives:"error: permission denied on key 'vm.max_map_count'"
Is there anyway I can solve this?
Thanks
I have found a solution and so I am answering myself.
If you really cannot set ulimit or vm.max_map_count, the only solution, according to http://blog.thetaphi.de/2012/07/use-lucenes-mmapdirectory-on-64bit.html, is to configure your solr (or if you work with Lucene api, choose explicitly) to use SimpleFSDirectory (if windows) or NIOFSDirectory, both are slower than the default.
For example
DirectoryReader.open(new NIOFSDirectory(Paths.get("path_to_index"), FSLockFactory.getDefault()))

SysUtils﹕ ApplicationContext is null in ApplicationStatus (WebView)

I can see something strange at WebView based app start. It doesn't affect the app at all but I'm curious why the error appears. Nothing crashes, everything seems to be ok, but the error...
Here is logcat
Loading com.google.android.webview version 42.0.2311.137 (code 2311137)
I/LibraryLoader﹕ Time to load native libraries: 2 ms (timestamps 3347-3349)
I/LibraryLoader﹕ Expected native library version number "",actual native library version number ""
V/WebViewChromiumFactoryProvider﹕ Binding Chromium to main looper Looper (main, tid 1) {2d3b4b2c}
I/LibraryLoader﹕ Expected native library version number "",actual native library version number ""
I/chromium﹕ [INFO:library_loader_hooks.cc(112)] Chromium logging enabled: level = 0, default verbosity = 0
I/BrowserStartupController﹕ Initializing chromium process, singleProcess=true
W/art﹕ Attempt to remove local handle scope entry from IRT, ignoring
E/SysUtils﹕ ApplicationContext is null in ApplicationStatus
W/chromium﹕ [WARNING:resource_bundle.cc(286)] locale_file_path.empty()
I/chromium﹕ [INFO:aw_browser_main_parts.cc(63)] Load from apk succesful, fd=34 off=6850672 len=3697
I/chromium﹕ [INFO:aw_browser_main_parts.cc(76)] Loading webviewchromium.pak from, fd:35 off:7953036 len:1161174
I/Adreno-EGL﹕ <qeglDrvAPI_eglInitialize:379>: QUALCOMM Build: 01/15/15, ab0075f, Id3510ff6dc
W/AudioManagerAndroid﹕ Requires BLUETOOTH permission
W/chromium﹕ [WARNING:data_reduction_proxy_config.cc(150)] SPDY proxy OFF at startup
W/art﹕ Attempt to remove local handle scope entry from IRT, ignoring
W/AwContents﹕ onDetachedFromWindow called when already detached. Ignoring
I/GAv4﹕ Google Analytics 4.5.0/7327 is starting up. To enable debug logging on a device run:
adb shell setprop log.tag.GAv4 DEBUG
adb logcat -s GAv4
I suppose the error comes from here:
https://chromium.googlesource.com/chromium/src/base/+/master/android/java/src/org/chromium/base/SysUtils.java
A few lines of WebView initialisation
...
// load url in webView
webView.loadUrl(webViewUrl);
webView.setWebViewClient(new MyAppWebViewClient());
// implement WebChromeClient inner class
// we will define openFileChooser for select file from camera
webView.setWebChromeClient(new WebChromeClient() {
...
What's going on?
What is happening here is:
The ApplicationStatus is not initialized yet, so the context cannot be obtained from it. This is a completely natural situation, so no error should be raised. Logging this as an error was an exaggeration from the coder.
However:
This does not cause any real problem, because the function tries to get a context object only to perform yet another check to assess the performance capabilities of the device. Since it sometimes fails to call the "isLowRamDevice()", it will just carry on performing the rest of the checks. So worst case scenario is not being able to detect a low-end phone at this point, and subsequent checks will be made.
Also it is completely normal that
"I see this error in a Lollipop device (Nexus 10) but not in a JellyBean device", because the function has an early return if it detects anything below KitKat. (// Any pre-KitKat device cannot be considered 'low-end')

com.fasterxml.jackson.core.util.InternCache.intern() deadlock under high load

Env:
Amazon
Centos
Apache-tomcat-7.0.53
Java 8
Jackson-core-2.2.3
Problem
When we test our servers with a load of ~7000CCU, we see several of the following when we profile our appservers using Yourkit.
http-apr-8080-exec-952 <--- Frozen for at least 17 sec
com.fasterxml.jackson.core.util.InternCache.intern(String) InternCache.java:43
com.fasterxml.jackson.core.sym.CharsToNameCanonicalizer.findSymbol(char[], int, int, int) CharsToNameCanonicalizer.java:506
com.fasterxml.jackson.core.json.ReaderBasedJsonParser._parseFieldName(int) ReaderBasedJsonParser.java:1182
com.fasterxml.jackson.core.json.ReaderBasedJsonParser.nextToken() ReaderBasedJsonParser.java:602
com.fasterxml.jackson.core.base.ParserMinimalBase.nextValue() ParserMinimalBase.java:128
What can we do to improve the performance of this library.
I found the reason, we were not closing the parser instance. By closing the parser instance in 'finally block' this issue has vanished.

Questions about native calltrace using Java

We're debugging an error that causing a crash in a Tomcat web application.
The application uses 2 3rd-party apps over jni, one of the 3rd-parties using SmartHeap (it is a memory management library for c/c++ applications), the other don't (it is webMethods broker version 5).
The strange thing is I see in the crash log that webMethods calls its native methods to initiate a connection to the broker server, but if I print the call trace of the thread where the crash happened using WinDbg (loading the minidump file created when the JVM crashed), it contains calls to SmartHeap functions. Now i feel I'm a bit lost... because I've checked, and found no references to this dll from the webMethods binaries.
(actually a memory allocation is called)
My question is how is it possible?
I mean anybody could describe how this part is working? Because I thought that the interpreted/compiled and native frames are called in a fixed order (it is logical).
maybe the call stack is invalid? (now we have many dump files with almost the same call trace)
or the call trace (the calling order of the native functions) is valid, only some of the functions have been reordered before calling (like a lazy object has to be generated before sending it to the webMethods broker, but i don't see any sign of this)
I'm querying the call trace on the dump file by calling ".ecxr" and "kv", the output is:
0:060> .ecxr
eax=4d330554 ebx=4d350010 ecx=4d330010 edx=00000000 esi=4d350010 edi=00000000
eip=4c912f15 esp=4bf1dad0 ebp=3574884d iopl=0 nv up ei pl nz na pe nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00010206
shsmp!shi_allocSmall2+0x195:
4c912f15 8b4d00 mov ecx,dword ptr [ebp] ss:0023:3574884d=????????
0:060> k
*** Stack trace for last set context - .thread/.cxr resets it
ChildEBP RetAddr
4bf1daec 4c912bbd shsmp!shi_allocSmall2+0x195
4bf1dafc 4c91b973 shsmp!MemAllocPtr+0x5d
*** WARNING: Unable to verify checksum for awssl50jn.dll
*** ERROR: Symbol file could not be found. Defaulted to export symbols for awssl50jn.dll -
4bf1db14 49abc38d shsmp!shi_malloc_dbg+0x23
WARNING: Stack unwind information not available. Following frames may be wrong.
4bf1db3c 49abeca2 awssl50jn!Java_COM_activesw_api_client_ssl_AwSSLNative_getSecurityInfo+0xa1cd
4bf1db48 49ab5e66 awssl50jn!Java_COM_activesw_api_client_ssl_AwSSLNative_getSecurityInfo+0xcae2
4bf1db4c 49ab5e55 awssl50jn!Java_COM_activesw_api_client_ssl_AwSSLNative_getSecurityInfo+0x3ca6
4bf1db60 49ab667d awssl50jn!Java_COM_activesw_api_client_ssl_AwSSLNative_getSecurityInfo+0x3c95
4bf1db80 49abdbbc awssl50jn!Java_COM_activesw_api_client_ssl_AwSSLNative_getSecurityInfo+0x44bd
4bf1dc20 4c912f4f awssl50jn!Java_COM_activesw_api_client_ssl_AwSSLNative_getSecurityInfo+0xb9fc
4bf1dc78 49abd607 shsmp!shi_allocSmall2+0x1cf
00000000 00000000 awssl50jn!Java_COM_activesw_api_client_ssl_AwSSLNative_getSecurityInfo+0xb447`
Any help would be appreciated!

Categories