Android: Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1) in getOutputStream
Thanks @ChrisStratton for pointing me. Here is working code.
Now I don't understand how it worked earlier.
OkHttpClient okHttpClient = new OkHttpClient();
try {
SSLContext sslContext = SSLContext.getInstance("TLS");
sslContext.init(null, null, null);
okHttpClient.setSslSocketFactory(sslContext.getSocketFactory());
} catch (GeneralSecurityException ignored) {
}
// open a URL connection to the Servlet
fileInputStream = mImagePath.getContentStream();
URL url = new URL(Api.url(Api.Methods.UPLOAD_IMAGE));
conn = okHttpClient.open(url); // FIX!!!
conn.setDoInput(true);
conn.setDoOutput(true);
conn.setUseCaches(false);
conn.setRequestMethod("POST");
Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 6049 (WebViewCoreThre)
You're hitting a null pointer dereference. Judging by the code and the PC, I'd guess jNativePointer
is zero. Add a log message at the top of the function to confirm.
java.lang.Error: signal 11 (SIGSEGV), code 10 (?), fault addr 006e006f
There are following reason to face this issue:
- The error is because of some sort of memory issue
- Segment Violations can occur due to a wide range of problems (usually
bad pointer or array over/under flows) and is not systemic to any one
type of software or product. - If you have programming (or are using) a plugin that in turn uses
native C/C++ code through the NDK, this may indicate a bug in that
native code. Otherwise, this is a bug in the firmware of the device
or emulator you are testing upon. - If you can reproduce this in an emulator, on a Nexus device with the
original ROM, or on a variety of devices from different
manufacturers, it is probably a bug in Android itself. In that case,
please create a sample project that can reproduce the error, and post
it along with the entire stack trace to http://b.android.com, the
Android OS issue tracker. - If you are only encountering this on one device or one third-party
ROM, it is probably a more specific bug -- your best bet is to
contact the device manufacturer or ROM publisher with your symptoms. - And one more thing i want to acknoledge regarding this issue is that
the most of samsung device has memory allocation issuees due to some
sort of customize OS.
Related Topics
Pausing/Stopping and Starting/Resuming Java Timertask Continuously
Detecting State Changes Made to the Bluetoothadapter
Inside Onclicklistener I Cannot Access a Lot of Things - How to Approach
Android Data Binding Using Include Tag
Change Position of Google Maps API's "My Location" Button
Android - Preventing Webview Reload on Rotate
Show Only Two Digit After Decimal
Android Studio Error: "Manifest Merger Failed: Apps Targeting Android 12"
Is Custom Enum Serializable Too
How to Use Weakreference in Java and Android Development
How to Avoid Garbage Collection Delays in Java Games? (Best Practices)
Intellij Fat One Jar Artifact Does Not Generate a Working Output
Dynamically Get Drawables by Id
How to Implement "CSS Versioning" (To Solve Cache Issues) Using Jsf 2 H:Outputstylesheet