Android :: How Can I Catch SIGSEGV - Get A Stack Trace Under JNI On Phone?
Jul 4, 2009
I'm moving a project to the new Android Native Development Kit (i.e. JNI) and I'd like to catch SIGSEGV, should it occur (possibly also SIGILL, SIGABRT, SIGFPE) in order to present a nice crash reporting dialog, instead of (or before) what currently happens: the immediate unceremonious death of the process and possibly some attempt by the OS to restart it. (Edit: The JVM/Dalvik VM catches the signal and logs a stack trace and other useful information; I just want to offer the user the option to email that info to me really.)
The situation is: a large body of C code which I didn't write does most of the work in this application (all the game logic) and although it's well-tested on numerous other platforms, it's entirely possible that I, in my Android port, will feed it garbage and cause a crash in native code, so I want the crash dumps (both native and Java) that currently show up in the Android log (I guess it would be stderr in a non-Android situation). I'm free to modify both C and Java code arbitrarily, although the callbacks (both going in and coming out of JNI) number about 40 and obviously, bonus points for small diffs.
I've heard of the signal chaining library in J2SE, libjsig.so, and if I could safely install a signal handler like that on Android, that would solve the catching part of my question, but I see no such library for Android/Dalvik.
View 3 Replies
Jul 6, 2010
Even explicitly writing e.printStackTrace() it doesn't print to the console, why?
View 3 Replies
View Related
Apr 23, 2010
I tried using the MapActivity as given in the following link. http://developer.android.com/guide/tutorials/views/hello-mapview.HTML
I get the error in LogCat : DalvikVm: unable to open stack trace file android '/data/anr/traces.txt' Permission Denied. May I know why this happens. However, after making some changes in the code as shown below, I get the map view perfectly.code...
View 2 Replies
View Related
Sep 20, 2010
My game is crashing on the HTC Hero and I have managed to get a user to send me their log. I don't see a Java stack trace at all. It looks like it's crashing in the OpenGL driver. I was wondering how I could go about trying to determine the problem. I was thinking of adding that acra project that sends crash reports to a server but I am thinking it will just send the same that is in this log. I have error checking everywhere so I am really at a lose where to go from here. I even went out and bought a HTC Hero but Canada only has 1.5 for the OS. Code...
View 10 Replies
View Related
Dec 16, 2009
So I have an app on the market with >10k active users. I have recieved maybe 50 complaints from Droid-user that the program crashes arbitrarily. I have not been able to replicate the error with my own droid, but I got one of the to send me this crash log. However, it does not reference the application. Do you have any suggestions on how to track down this error? I stand baffled.
11-25 16:18:03.730 D/AndroidRuntime( 2964): Shutting down VM 11-25 16:18:03.730 W/dalvikvm( 2964): threadid=3: thread exiting with uncaught exception (group=0x4001b180) 11-25 16:18:03.730 E/AndroidRuntime( 2964): Uncaught handler: thread main exiting due to uncaught exception 11-25 16:18:03.761 E/AndroidRuntime( 2964): java.lang. Code...
View 3 Replies
View Related
Jun 8, 2010
How do I fix a bug that doesn't point to any of my code? I got the stack trace below from the Marketplace crash reports, but I have no clue how to fix it since it points to none of my own code.
java.lang.NullPointerException:at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:487)at android.view.View.measure(View.java:7964)at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3023) at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)at android.view.View.measure(View.java:7964)at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3023)at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)at android.view.View.measure(View.java:7964)at android.view.ViewRoot.performTraversals(ViewRoot.java:763)at android.view.ViewRoot.handleMessage(ViewRoot.java:1633)at android.os.Handler.dispatchMessage(Handler.java:99)at android.os.Looper.loop(Looper.java:123) at android.app.ActivityThread.main(ActivityThread.java:4363)at java.lang.reflect.Method.invokeNative(Method.java:-2)at java.lang.reflect.Method.invoke(Method.java:521)at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)at dalvik.system.NativeStart.main(NativeStart.java:-2)
I'm not seeing any issues on any emulators or devices.
View 4 Replies
View Related
Apr 7, 2010
I'm currently working on an android app that pulls a list of forums from a JSON feed. I'm trying to parse the feed and immediately upon calling getJSONArray a JSON exception is being thrown with no stack trace. The JSON being returned is stored in an JSONObject jobj with the format as follows: However when running the following code, I get an immediate exception without a stack trace: Code...
View 1 Replies
View Related
Aug 17, 2010
Got a trace like this:
java.lang.StackOverflowError
at android.widget.TextView.onMeasure(TextView.java:5160)
at android.view.View.measure(View.java:8172)
at android.widget.TableRow.getColumnsWidths(TableRow.java:308)
at android.widget.TableLayout.findLargestCells(TableLayout.java:497)
at android.widget.TableLayout.measureVertical(TableLayout.java:462)
at android.widget.TableLayout.onMeasure(TableLayout.java:428)
at android.view.View.measure(View.java:8172)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3140)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1012)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:381)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:304)
at android.view.View.measure(View.java:8172)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3140)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1012)
at android.widget.LinearLayout.measureHorizontal(LinearLayout.java:696)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:306)
at android.view.View.measure(View.java:8172)
at android.widget.ListView.measureScrapChild(ListView.java:1135)
at android.widget.ListView.measureHeightOfChildren(ListView.java:1200)
at android.widget.ListView.onMeasure(ListView.java:1109)
at android.view.View.measure(View.java:8172)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3140)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1012)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:381)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:304)
at android.view.View.measure(View.java:8172)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3140)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)
at android.view.View.measure(View.java:8172)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:526)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:304)
at android.view.View.measure(View.java:8172)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3140)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)
at android.view.View.measure(View.java:8172)
at android.view.ViewRoot.performTraversals(ViewRoot.java:805)
at android.view.ViewRoot.handleMessage(ViewRoot.java:1744)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:144)
at android.app.ActivityThread.main(ActivityThread.java:4937)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
at dalvik.system.NativeStart.main(Native Method) Is there anything that can be done here? I'm getting reports of blank screens and force closes.
View 1 Replies
View Related
Apr 29, 2010
Is there a way to achieve the following in Android?
1. generate a Java stack trace in Android. In J2SE, we use to use something like this - send a signal to the Java Virtual Machine; the Java Virtual Machine generates a stack trace for you; or we can also use debugging tools or Java API calls.
You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
View 4 Replies
View Related
Feb 12, 2009
Here my application "com.android.hello" calls a core library "libvt.so" through JNI call. There is a segmentation fault in "libvt.so". When executed I get the following log What I see is some Hex value followed by a library name. #00 pc afe0d24c /system/lib/libc.so
Also there is a Stack section 01-01 00:02:57.800: INFO/DEBUG(1600): stack: 01-01 00:02:57.800: INFO/DEBUG(1600):bef2e570 bef2e604 [stack] 01-01 00:02:57.810: INFO/DEBUG(1600):bef2e574 afe0a333 /system/ lib/libc.so
This too gives similar information. I am looking for little more informations rather than Hex values. Like the backtrace feature where the stack hex values is mapped to the function names and function names are visible.
Please provide information how to see the function names in stack rather than Hex values. Is ther any compiler options needs to be updated? Any makefile to be updated to enable backtrace?
View 7 Replies
View Related
Apr 11, 2010
My android app is getting an "Out of memory" error without a useful stack trace. It occurs after I have repeatedly re-invoked its main logic through a menu interaction, which leads me to believe that there's a memory leak somewhere.
I say that the stack trace isn't useful because it doesn't include references to any of my own code. There are no references to my own code in the logcat output, either.
I'm wondering if any of you can help me figure out where my memory leak might be occurring, given my stack trace and my logcat output.
Here's the stack trace: Code...
Could my error be related to the "Window already focused ..." warnings? If so, how can I find out what is causing these? I know that I could sprinkle my code with lots of calls to Log.v() in order to zero in on where my problem might be occurring, but I'm wondering if there is a better way to get more meaningful information about the cause of my memory leak.
View 5 Replies
View Related
Oct 27, 2009
Why this can happen? ...........
View 4 Replies
View Related
Feb 1, 2010
I am trying to follow the instructions on this page to create a trace file. I can see the file in File Explorer in DDMS and can pull it onto my PC but it is zero bytes long.
Any suggestions as to what I might be doing wrong, please?
View 1 Replies
View Related
Jan 10, 2010
Im getting this error caused by VM( logcat below from emulator, it also happens on the device) This is a know bug filed at least 3 times with different issues. I am getting it if I close my app and then open it a few times(it happens too often), you can close the app by "back button". I also have a service running in the background which updates my widget( i stop the service when it finishes), which launches an activity through a PendingIntent. Is there any workaround for this error, if I know what causes this exactly i may be able to prevent it, something must be triggering this....................
View 3 Replies
View Related
Nov 10, 2009
We are getting a SIGSEGV 11 when launching our OpenGL activity. Here is the logcat. It appears to happen on Droid Hardware, but not the 2.0 Emulator. We are trying to do some testing to see if we can slowly build up some code to cause a crash.
CODE:....................
View 3 Replies
View Related
Feb 14, 2010
How can I catch a phone keypress with the android SDK? I've been looking around for hours without finding anything.For example:
In some cases, I want to catch the message when a user presses the "hang up" button on the phone, and then discard the message before it reaches the OS.
View 1 Replies
View Related
Jul 7, 2010
Anyone could compile some SIP Stack in C/C++ along with Android source code? Note: i am referring not to compile the Sip Stack with ndk, but compile with all the code of the Android platform.
View 4 Replies
View Related
May 23, 2010
My first computer was a hand-me-down from my father. It had a Pentium II, 200ish mhz. I think it had 64 MB ram and a 2 gig hard drive. I'm pretty sure that my Eris is faster and better than this computer in every respect except for screen size, but I wonder, how does the Eris's processor compare to other x86 processors out there? Has anybody benchmarked arm based CPUs against old pentium CPUs? Does anybody know how our phone processors stack up against computer processors?
View 7 Replies
View Related
Sep 12, 2010
This person has been texting me none stop for 3 days I've even involved the police who didn't even bother since its a cricket wireless # they can't trace. This person seems obsessed and at times honestly scares me. They've sent over a hundred texts in less than an hour. Pls I've tried googling but come up with year old posts that lead to nothing. Market searches lead to only bad reviews.
View 5 Replies
View Related
Sep 30, 2009
Had a few days of use without issues, go to make a call yesterday and it takes ages to connect, but instead of connecting I get a beep and then it returns me to my contact list. Tried putting the phone in and out of flight mode by holding down the power button and selecting the flight mode option, the option turns grey after I press it, won't allow me to press it again and seemingly does nothing. Press the off option and turn the phone back on and it's fine. Now I reckon I had suffered this with earlier firmwares.
View 26 Replies
View Related
Jul 22, 2009
How to trace the HTTP requests/responses e.g. by using Wireshark? I am using soap web services i want tocheck wheather the soap request from the web service sis going properly.I neee the Xml response from the server but non xml format i am getting how to check this request and response using Wireahark or any other process.
View 2 Replies
View Related
Jun 16, 2010
I'm currently trying to debug an issue with my application and I wanted to see if my internal proxy is sending the data in the proper order. Is there any way to essentially sniff my proxy pipe?
View 3 Replies
View Related
Jul 23, 2009
I have a problem with creating a trace file containing logs on my app. I use Debug.startMethodTracing("tracing"); and in my onDestroy() method i stop the methodTracing. Everything is going fine, like my file is created on my phone BUT it is empty, and i don't get why because it worked once and since i can't get it working. Here is the log ive got, and it says that it is writting on the file, so this is acting a bit weird. Code...
View 3 Replies
View Related
Jul 14, 2010
Does anybody know how can I get the build-in function call trace on Android phone?
View 7 Replies
View Related
May 21, 2010
I created sdcard and mounted it on my emulator , after closing my app , when i try to pull to copy the files (using command:adb pull /sdcard/calc.trace /tmp)i get this error:"remote object /sdcard/calc.trace does not exist".I am listin gdown the commands in sequence.
1)f:>mksdcard 1024 ./myimage
2)f:>emulator -sdcard ./myimage -avd 1
3)(After running my app and exiting the app)adb pull /sdcard/calc.trace /tmp
In my activity i have start/stop method tracing with fiename calc.trace. i am running windows.
View 1 Replies
View Related
May 17, 2010
How to trace the Memory Leaks in Android Development? I am working on eclipse IDE to develop the application. i cant find out how to rectify the memory or window Leaks Exceptions? Any Idea.
Mainly the Window Leaked error raises the Illegal Argument Exception? how to rectify both og this.
View 1 Replies
View Related
Sep 25, 2009
Sometimes in LogCat I'll see Wrote stack trace to '/data/anr/traces.txt'
But when using the DDMS perspective, "File Explorer" View, I can't see anything in the "data" directory, I'm assuming because permission denied. Is there a way (short of rooting my ion device) to read what's in that text file?
Is there perhaps an android app for developers that will show the contents of the file? It would seem there would have to be some way of reading the file without rooting the device, otherwise why does the o.s. write it out? How can I read this file?
View 3 Replies
View Related
Mar 16, 2010
I am now reading contentProvider.java( under the base/core/java/android/content)
Ln 127 looks following:
CODE:..........
I'm really confused about that contentProvider invoke this.query()
CODE:.................
where is it implement? How can i find it? anyone can tell me?
View 3 Replies
View Related
Nov 2, 2009
There is a stack of activity i want to call the activity from that stack , My question is that is it possible to check from that stack and call that intent.When i press home button and again when i press the executable it should start the activity where i have left .Is it possible?Any example related to the same would be great help
View 3 Replies
View Related
Jul 26, 2010
Here you go! Ripped straight from my article: How To: Remove AT&T From Captivate.
Instructions; WARNING: I am not responsible for any bricked, messed up, ruined devices. You modify your phone at your own risk. These processes are not necessarily safe for your Samsung Captivate or any other device.
Root the Samsung Captivate
First things first. You'll need to root your device to continue with many of the modifications listed below. For our How to Root the Samsung Captivate¯ guide, click here. Its very very easy. Even a total noobie can do it! If you have questions, post a comment and well get back to you A.S.A.P. Look below if you get the idea, check out our How to Root the Samsung Captivate¯ guide if you donte.
Download Update.zip
Plug in your Captivate to your computer. When the phone notifies you that the USB has been plugged in, scroll down your notifications bar and click on USB connected: Select to copy files to/from your computer.¯
Click Mount¯
Now, you'll probably see a popup telling you a new USB drive has been inserted, open it up on your computer. In Windows, click Open folder to view files.¯
Drag Update.zip into the Captivate USB drive (on the top level do not navigate into folders)
Turn off the Captivate (Power Off)
Hold down the Volume Up/Down rocker and the power button until you see some action. Your phone is now booting into recovery.
Use the volume down button to scroll down to Reinstall package
Click the power button to select that option
Enable App Sideloading, AT&T has some weird reservations against app sideloading. That means, AT&T Android users can not use any apps not downloaded on the Android Market. Have no fear! You can remove this restriction easily. Check below for the basic instructions, or click to go to our Enable Captivate App Sideloading¯ guide. Code...
View 23 Replies
View Related