Toast.makeText ANR - android

I'm getting an ANR that seems to be from Toast.makeText:
DALVIK THREADS: (mutexes: tll=0 tsl=0 tscl=0 ghl=0 hwl=0 hwll=0)
"main" prio=5 tid=1 SUSPENDED | group="main" sCount=1 dsCount=0
obj=0x40163600 self=0x12620 | sysTid=4197 nice=0 sched=0/0
cgrp=default handle=-1345338264 | schedstat=( 149532214000 43042125000
324000 ) utm=13923 stm=1030 core=0 at
android.graphics.Matrix.native_create(Native Method) at
android.graphics.Matrix.(Matrix.java:49) at
android.view.View.(View.java:1852) at
android.view.View.(View.java:2411) at
android.view.ViewGroup.(ViewGroup.java:365) at
android.widget.LinearLayout.(LinearLayout.java:156) at
android.widget.LinearLayout.(LinearLayout.java:152) at
java.lang.reflect.Constructor.constructNative(Native Method) at
java.lang.reflect.Constructor.newInstance(Constructor.java:416) at
android.view.LayoutInflater.createView(LayoutInflater.java:576) at
com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
at android.view.LayoutInflater.onCreateView(LayoutInflater.java:644)
at
android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:669)
at android.view.LayoutInflater.inflate(LayoutInflater.java:457) at
android.view.LayoutInflater.inflate(LayoutInflater.java:391) at
android.view.LayoutInflater.inflate(LayoutInflater.java:347) at
android.widget.Toast.makeText(Toast.java:230) at
android.widget.Toast.makeText(Toast.java:253) at
com.anthonymandra.framework.ViewerActivity.onActivityResult(ViewerActivity.java:802)
at android.app.Activity.dispatchActivityResult(Activity.java:4581) at
android.app.ActivityThread.deliverResults(ActivityThread.java:2814) at
android.app.ActivityThread.handleSendResult(ActivityThread.java:2861)
at android.app.ActivityThread.access$1000(ActivityThread.java:122) at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1054)
at android.os.Handler.dispatchMessage(Handler.java:99) at
android.os.Looper.loop(Looper.java:132) at
android.app.ActivityThread.main(ActivityThread.java:4123) at
java.lang.reflect.Method.invokeNative(Native Method) at
java.lang.reflect.Method.invoke(Method.java:491) at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599) at
dalvik.system.NativeStart.main(Native Method)
This is the line of code called from within onActivityResult:
Toast.makeText(this, R.string.save_success, Toast.LENGTH_SHORT).show();
Anyone know why a Toast might cause an ANR, or what might really be wrong if I'm misreading this? Thanks!

Instead of using direct call to R.string, you should use getResources() and then like below
String strSuccess = getString(R.string.save_success);
Toast.makeText(this, strSuccess, Toast.LENGTH_SHORT).show();
or
Toast.makeText(this, getString(R.string.save_success),Toast.LENGTH_SHORT).show();
Read more

Related

openCV cvSaveImage and cvCvtColor crash on android

I'm working on android with version 2.3.5 and 4.0.4 both version crash on the execution of the same code.
I have been trying to get a frame from a video, save it, and then convert it to HSV.
(I posted this same question on the opencv website here)
This is my code and the error I get.
public void process(){
IplImage orgImg = this.getFrame(2);
cvSaveImage(Environment.getExternalStorageDirectory().toString() + "/openCV/orgimg.jpg", orgImg);
IplImage hsv = hsv(orgImg);
}
private IplImage getFrame(int id){
File testfile = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + videoFile);
if(testfile.canRead()){
FFmpegFrameGrabber grabber = new FFmpegFrameGrabber(testfile);
try {
grabber.start();
grabber.setFrameNumber(id);
final int height=grabber.getImageHeight();
final int width=grabber.getImageWidth();
IplImage frame = IplImage.create(width, height, 8, 4);
frame = grabber.grab();
//grabber.stop();
return frame;
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
return null;
}
private IplImage hsv(IplImage orgImg) {
// 8-bit, 3- color =(RGB)
IplImage imgHSV = cvCreateImage(cvGetSize(orgImg), 8, 3);
Log.e(TAG,"hsvThreshold - Image size" + cvGetSize(orgImg));
cvCvtColor(orgImg, imgHSV, CV_BGR2HSV);
return imgHSV;
}
Here is the logcat I get when cvSaveImage or cvCvtColor is executed on the device running 4.0.4
08-07 12:26:25.974: I/dalvikvm(6719): "main" prio=5 tid=1 NATIVE
08-07 12:26:25.974: I/dalvikvm(6719): | group="main" sCount=0 dsCount=0 obj=0x40bf1460 self=0x101aca8
08-07 12:26:25.974: I/dalvikvm(6719): | sysTid=6719 nice=0 sched=0/0 cgrp=default handle=1074673032
08-07 12:26:25.974: I/dalvikvm(6719): | schedstat=( 0 0 0 ) utm=710 stm=34 core=0
08-07 12:26:25.974: I/dalvikvm(6719): at java.lang.Runtime.nativeLoad(Native Method)
08-07 12:26:25.974: I/dalvikvm(6719): at java.lang.Runtime.nativeLoad(Native Method)
08-07 12:26:25.974: I/dalvikvm(6719): at java.lang.Runtime.loadLibrary(Runtime.java:368)
08-07 12:26:25.974: I/dalvikvm(6719): at java.lang.System.loadLibrary(System.java:535)
08-07 12:26:25.974: I/dalvikvm(6719): at com.googlecode.javacpp.Loader.loadLibrary(Loader.java:593)
08-07 12:26:25.974: I/dalvikvm(6719): at com.googlecode.javacpp.Loader.load(Loader.java:489)
08-07 12:26:25.974: I/dalvikvm(6719): at com.googlecode.javacpp.Loader.load(Loader.java:431)
08-07 12:26:25.974: I/dalvikvm(6719): at com.googlecode.javacv.cpp.opencv_imgproc.<clinit>(opencv_imgproc.java:97)
08-07 12:26:25.974: I/dalvikvm(6719): at java.lang.Class.classForName(Native Method)
08-07 12:26:25.974: I/dalvikvm(6719): at java.lang.Class.forName(Class.java:217)
08-07 12:26:25.974: I/dalvikvm(6719): at com.googlecode.javacpp.Loader.load(Loader.java:453)
08-07 12:26:25.974: I/dalvikvm(6719): at com.googlecode.javacv.cpp.opencv_highgui.<clinit>(opencv_highgui.java:85)
08-07 12:26:25.974: I/dalvikvm(6719): at ch.golfer.TrackSpot.process(TrackSpot.java:-1)
08-07 12:26:25.974: I/dalvikvm(6719): at ch.golfer.FullscreenActivity$7.onClick(FullscreenActivity.java:196)
08-07 12:26:25.974: I/dalvikvm(6719): at android.view.View.performClick(View.java:3627)
08-07 12:26:25.974: I/dalvikvm(6719): at android.view.View$PerformClick.run(View.java:14305)
08-07 12:26:25.974: I/dalvikvm(6719): at android.os.Handler.handleCallback(Handler.java:605)
08-07 12:26:25.974: I/dalvikvm(6719): at android.os.Handler.dispatchMessage(Handler.java:92)
08-07 12:26:25.974: I/dalvikvm(6719): at android.os.Looper.loop(Looper.java:137)
08-07 12:26:25.974: I/dalvikvm(6719): at android.app.ActivityThread.main(ActivityThread.java:4511)
08-07 12:26:25.974: I/dalvikvm(6719): at java.lang.reflect.Method.invokeNative(Native Method)
08-07 12:26:25.974: I/dalvikvm(6719): at java.lang.reflect.Method.invoke(Method.java:511)
08-07 12:26:25.974: I/dalvikvm(6719): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:976)
08-07 12:26:25.974: I/dalvikvm(6719): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:743)
08-07 12:26:25.974: I/dalvikvm(6719): at dalvik.system.NativeStart.main(Native Method)
08-07 12:26:25.974: E/dalvikvm(6719): VM aborting
08-07 12:26:25.974: A/libc(6719): Fatal signal 11 (SIGSEGV) at 0xdeadd00d (code=1)
And this is the logcat of the 2.3.5 device:
08-07 12:32:05.503: E/javacpp(995): Error loading class com/googlecode/javacpp/Pointer.
08-07 12:32:09.620: I/dalvikvm(995): threadid=4: reacting to signal 3
08-07 12:32:10.620: W/dalvikvm(995): threadid=4: spin on suspend #1 threadid=1 (pcf=0)
08-07 12:32:11.370: W/dalvikvm(995): threadid=4: spin on suspend #2 threadid=1 (pcf=0)
08-07 12:32:11.370: I/dalvikvm(995): "Signal Catcher" daemon prio=5 tid=4 RUNNABLE
08-07 12:32:11.370: I/dalvikvm(995): | group="system" sCount=0 dsCount=0 obj=0x4050e148 self=0x288d08
08-07 12:32:11.370: I/dalvikvm(995): | sysTid=999 nice=0 sched=0/0 cgrp=default handle=2078152
08-07 12:32:11.370: I/dalvikvm(995): at dalvik.system.NativeStart.run(Native Method)
08-07 12:32:11.370: I/dalvikvm(995): "main" prio=5 tid=1 RUNNABLE
08-07 12:32:11.370: I/dalvikvm(995): | group="main" sCount=1 dsCount=0 obj=0x4001f190 self=0xce60
08-07 12:32:11.370: I/dalvikvm(995): | sysTid=995 nice=0 sched=0/0 cgrp=default handle=-1345006496
08-07 12:32:11.456: I/dalvikvm(995): at java.lang.Runtime.nativeLoad(Native Method)
08-07 12:32:11.472: I/dalvikvm(995): at java.lang.Runtime.nativeLoad(Native Method)
08-07 12:32:11.476: I/dalvikvm(995): at java.lang.Runtime.loadLibrary(Runtime.java:432)
08-07 12:32:11.488: I/dalvikvm(995): at java.lang.System.loadLibrary(System.java:554)
08-07 12:32:11.507: I/dalvikvm(995): at com.googlecode.javacpp.Loader.loadLibrary(Loader.java:593)
08-07 12:32:11.511: I/dalvikvm(995): at com.googlecode.javacpp.Loader.load(Loader.java:489)
08-07 12:32:11.519: I/dalvikvm(995): at com.googlecode.javacpp.Loader.load(Loader.java:431)
08-07 12:32:11.527: I/dalvikvm(995): at com.googlecode.javacv.cpp.opencv_imgproc.<clinit>(opencv_imgproc.java:97)
08-07 12:32:11.530: I/dalvikvm(995): at java.lang.Class.classForName(Native Method)
08-07 12:32:11.534: I/dalvikvm(995): at java.lang.Class.forName(Class.java:234)
08-07 12:32:11.542: I/dalvikvm(995): at com.googlecode.javacpp.Loader.load(Loader.java:453)
08-07 12:32:11.550: I/dalvikvm(995): at com.googlecode.javacv.cpp.opencv_highgui.<clinit>(opencv_highgui.java:85)
08-07 12:32:11.554: I/dalvikvm(995): at ch.golfer.TrackSpot.process(TrackSpot.java:-1)
08-07 12:32:11.562: I/dalvikvm(995): at ch.golfer.FullscreenActivity$7.onClick(FullscreenActivity.java:196)
08-07 12:32:11.570: I/dalvikvm(995): at android.view.View.performClick(View.java:2538)
08-07 12:32:11.581: I/dalvikvm(995): at android.view.View$PerformClick.run(View.java:9152)
08-07 12:32:11.589: I/dalvikvm(995): at android.os.Handler.handleCallback(Handler.java:587)
08-07 12:32:11.593: I/dalvikvm(995): at android.os.Handler.dispatchMessage(Handler.java:92)
08-07 12:32:11.605: I/dalvikvm(995): at android.os.Looper.loop(Looper.java:130)
08-07 12:32:11.616: I/dalvikvm(995): at android.app.ActivityThread.main(ActivityThread.java:3688)
08-07 12:32:11.620: I/dalvikvm(995): at java.lang.reflect.Method.invokeNative(Native Method)
08-07 12:32:11.624: I/dalvikvm(995): at java.lang.reflect.Method.invoke(Method.java:507)
08-07 12:32:11.632: I/dalvikvm(995): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
08-07 12:32:11.640: I/dalvikvm(995): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
08-07 12:32:11.648: I/dalvikvm(995): at dalvik.system.NativeStart.main(Native Method)
08-07 12:32:12.405: W/dalvikvm(995): threadid=4: spin on suspend #3 threadid=1 (pcf=0)
08-07 12:32:12.405: I/dalvikvm(995): "Signal Catcher" daemon prio=5 tid=4 RUNNABLE
08-07 12:32:12.405: I/dalvikvm(995): | group="system" sCount=0 dsCount=0 obj=0x4050e148 self=0x288d08
08-07 12:32:12.405: I/dalvikvm(995): | sysTid=999 nice=0 sched=0/0 cgrp=default handle=2078152
08-07 12:32:12.405: I/dalvikvm(995): at dalvik.system.NativeStart.run(Native Method)
08-07 12:32:12.405: I/dalvikvm(995): "main" prio=5 tid=1 RUNNABLE
08-07 12:32:12.405: I/dalvikvm(995): | group="main" sCount=1 dsCount=0 obj=0x4001f190 self=0xce60
08-07 12:32:12.405: I/dalvikvm(995): | sysTid=995 nice=0 sched=0/0 cgrp=default handle=-1345006496
08-07 12:32:12.460: I/dalvikvm(995): at java.lang.Runtime.nativeLoad(Native Method)
08-07 12:32:12.472: I/dalvikvm(995): at java.lang.Runtime.nativeLoad(Native Method)
08-07 12:32:12.480: I/dalvikvm(995): at java.lang.Runtime.loadLibrary(Runtime.java:432)
08-07 12:32:12.484: I/dalvikvm(995): at java.lang.System.loadLibrary(System.java:554)
08-07 12:32:12.488: I/dalvikvm(995): at com.googlecode.javacpp.Loader.loadLibrary(Loader.java:593)
08-07 12:32:12.488: I/dalvikvm(995): at com.googlecode.javacpp.Loader.load(Loader.java:489)
08-07 12:32:12.488: I/dalvikvm(995): at com.googlecode.javacpp.Loader.load(Loader.java:431)
08-07 12:32:12.488: I/dalvikvm(995): at com.googlecode.javacv.cpp.opencv_imgproc.<clinit>(opencv_imgproc.java:97)
08-07 12:32:12.488: I/dalvikvm(995): at java.lang.Class.classForName(Native Method)
08-07 12:32:12.488: I/dalvikvm(995): at java.lang.Class.forName(Class.java:234)
08-07 12:32:12.488: I/dalvikvm(995): at com.googlecode.javacpp.Loader.load(Loader.java:453)
08-07 12:32:12.488: I/dalvikvm(995): at com.googlecode.javacv.cpp.opencv_highgui.<clinit>(opencv_highgui.java:85)
08-07 12:32:12.488: I/dalvikvm(995): at ch.golfer.TrackSpot.process(TrackSpot.java:-1)
08-07 12:32:12.488: I/dalvikvm(995): at ch.golfer.FullscreenActivity$7.onClick(FullscreenActivity.java:196)
08-07 12:32:12.488: I/dalvikvm(995): at android.view.View.performClick(View.java:2538)
08-07 12:32:12.488: I/dalvikvm(995): at android.view.View$PerformClick.run(View.java:9152)
08-07 12:32:12.488: I/dalvikvm(995): at android.os.Handler.handleCallback(Handler.java:587)
08-07 12:32:12.488: I/dalvikvm(995): at android.os.Handler.dispatchMessage(Handler.java:92)
08-07 12:32:12.488: I/dalvikvm(995): at android.os.Looper.loop(Looper.java:130)
08-07 12:32:12.488: I/dalvikvm(995): at android.app.ActivityThread.main(ActivityThread.java:3688)
08-07 12:32:12.488: I/dalvikvm(995): at java.lang.reflect.Method.invokeNative(Native Method)
08-07 12:32:12.488: I/dalvikvm(995): at java.lang.reflect.Method.invoke(Method.java:507)
08-07 12:32:12.488: I/dalvikvm(995): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
08-07 12:32:12.488: I/dalvikvm(995): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
08-07 12:32:12.488: I/dalvikvm(995): at dalvik.system.NativeStart.main(Native Method)
08-07 12:32:13.241: W/dalvikvm(995): threadid=4: spin on suspend #4 threadid=1 (pcf=0)
08-07 12:32:13.241: I/dalvikvm(995): "Signal Catcher" daemon prio=5 tid=4 RUNNABLE
08-07 12:32:13.241: I/dalvikvm(995): | group="system" sCount=0 dsCount=0 obj=0x4050e148 self=0x288d08
08-07 12:32:13.241: I/dalvikvm(995): | sysTid=999 nice=0 sched=0/0 cgrp=default handle=2078152
08-07 12:32:13.241: I/dalvikvm(995): at dalvik.system.NativeStart.run(Native Method)
08-07 12:32:13.241: I/dalvikvm(995): "main" prio=5 tid=1 RUNNABLE
08-07 12:32:13.241: I/dalvikvm(995): | group="main" sCount=1 dsCount=0 obj=0x4001f190 self=0xce60
08-07 12:32:13.241: I/dalvikvm(995): | sysTid=995 nice=0 sched=0/0 cgrp=default handle=-1345006496
08-07 12:32:13.280: I/dalvikvm(995): at java.lang.Runtime.nativeLoad(Native Method)
08-07 12:32:13.292: I/dalvikvm(995): at java.lang.Runtime.nativeLoad(Native Method)
08-07 12:32:13.292: I/dalvikvm(995): at java.lang.Runtime.loadLibrary(Runtime.java:432)
08-07 12:32:13.292: I/dalvikvm(995): at java.lang.System.loadLibrary(System.java:554)
08-07 12:32:13.292: I/dalvikvm(995): at com.googlecode.javacpp.Loader.loadLibrary(Loader.java:593)
08-07 12:32:13.292: I/dalvikvm(995): at com.googlecode.javacpp.Loader.load(Loader.java:489)
08-07 12:32:13.292: I/dalvikvm(995): at com.googlecode.javacpp.Loader.load(Loader.java:431)
08-07 12:32:13.292: I/dalvikvm(995): at com.googlecode.javacv.cpp.opencv_imgproc.<clinit>(opencv_imgproc.java:97)
08-07 12:32:13.292: I/dalvikvm(995): at java.lang.Class.classForName(Native Method)
08-07 12:32:13.292: I/dalvikvm(995): at java.lang.Class.forName(Class.java:234)
08-07 12:32:13.292: I/dalvikvm(995): at com.googlecode.javacpp.Loader.load(Loader.java:453)
08-07 12:32:13.292: I/dalvikvm(995): at com.googlecode.javacv.cpp.opencv_highgui.<clinit>(opencv_highgui.java:85)
08-07 12:32:13.296: I/dalvikvm(995): at ch.golfer.TrackSpot.process(TrackSpot.java:-1)
08-07 12:32:13.296: I/dalvikvm(995): at ch.golfer.FullscreenActivity$7.onClick(FullscreenActivity.java:196)
08-07 12:32:13.296: I/dalvikvm(995): at android.view.View.performClick(View.java:2538)
08-07 12:32:13.296: I/dalvikvm(995): at android.view.View$PerformClick.run(View.java:9152)
08-07 12:32:13.296: I/dalvikvm(995): at android.os.Handler.handleCallback(Handler.java:587)
08-07 12:32:13.296: I/dalvikvm(995): at android.os.Handler.dispatchMessage(Handler.java:92)
08-07 12:32:13.296: I/dalvikvm(995): at android.os.Looper.loop(Looper.java:130)
08-07 12:32:13.296: I/dalvikvm(995): at android.app.ActivityThread.main(ActivityThread.java:3688)
08-07 12:32:13.296: I/dalvikvm(995): at java.lang.reflect.Method.invokeNative(Native Method)
08-07 12:32:13.296: I/dalvikvm(995): at java.lang.reflect.Method.invoke(Method.java:507)
08-07 12:32:13.296: I/dalvikvm(995): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
08-07 12:32:13.296: I/dalvikvm(995): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
08-07 12:32:13.296: I/dalvikvm(995): at dalvik.system.NativeStart.main(Native Method)
08-07 12:32:14.046: W/dalvikvm(995): threadid=4: spin on suspend #5 threadid=1 (pcf=0)
08-07 12:32:14.050: I/dalvikvm(995): "Signal Catcher" daemon prio=5 tid=4 RUNNABLE
08-07 12:32:14.050: I/dalvikvm(995): | group="system" sCount=0 dsCount=0 obj=0x4050e148 self=0x288d08
08-07 12:32:14.050: I/dalvikvm(995): | sysTid=999 nice=0 sched=0/0 cgrp=default handle=2078152
08-07 12:32:14.050: I/dalvikvm(995): at dalvik.system.NativeStart.run(Native Method)
08-07 12:32:14.050: I/dalvikvm(995): "main" prio=5 tid=1 RUNNABLE
08-07 12:32:14.050: I/dalvikvm(995): | group="main" sCount=1 dsCount=0 obj=0x4001f190 self=0xce60
08-07 12:32:14.050: I/dalvikvm(995): | sysTid=995 nice=0 sched=0/0 cgrp=default handle=-1345006496
08-07 12:32:14.062: I/dalvikvm(995): at java.lang.Runtime.nativeLoad(Native Method)
08-07 12:32:14.062: I/dalvikvm(995): at java.lang.Runtime.nativeLoad(Native Method)
08-07 12:32:14.062: I/dalvikvm(995): at java.lang.Runtime.loadLibrary(Runtime.java:432)
08-07 12:32:14.066: I/dalvikvm(995): at java.lang.System.loadLibrary(System.java:554)
08-07 12:32:14.070: I/dalvikvm(995): at com.googlecode.javacpp.Loader.loadLibrary(Loader.java:593)
08-07 12:32:14.073: I/dalvikvm(995): at com.googlecode.javacpp.Loader.load(Loader.java:489)
08-07 12:32:14.073: I/dalvikvm(995): at com.googlecode.javacpp.Loader.load(Loader.java:431)
08-07 12:32:14.077: I/dalvikvm(995): at com.googlecode.javacv.cpp.opencv_imgproc.<clinit>(opencv_imgproc.java:97)
08-07 12:32:14.077: I/dalvikvm(995): at java.lang.Class.classForName(Native Method)
08-07 12:32:14.077: I/dalvikvm(995): at java.lang.Class.forName(Class.java:234)
08-07 12:32:14.077: I/dalvikvm(995): at com.googlecode.javacpp.Loader.load(Loader.java:453)
08-07 12:32:14.077: I/dalvikvm(995): at com.googlecode.javacv.cpp.opencv_highgui.<clinit>(opencv_highgui.java:85)
08-07 12:32:14.077: I/dalvikvm(995): at ch.golfer.TrackSpot.process(TrackSpot.java:-1)
08-07 12:32:14.077: I/dalvikvm(995): at ch.golfer.FullscreenActivity$7.onClick(FullscreenActivity.java:196)
08-07 12:32:14.077: I/dalvikvm(995): at android.view.View.performClick(View.java:2538)
08-07 12:32:14.077: I/dalvikvm(995): at android.view.View$PerformClick.run(View.java:9152)
08-07 12:32:14.077: I/dalvikvm(995): at android.os.Handler.handleCallback(Handler.java:587)
08-07 12:32:14.077: I/dalvikvm(995): at android.os.Handler.dispatchMessage(Handler.java:92)
08-07 12:32:14.077: I/dalvikvm(995): at android.os.Looper.loop(Looper.java:130)
08-07 12:32:14.077: I/dalvikvm(995): at android.app.ActivityThread.main(ActivityThread.java:3688)
08-07 12:32:14.077: I/dalvikvm(995): at java.lang.reflect.Method.invokeNative(Native Method)
08-07 12:32:14.077: I/dalvikvm(995): at java.lang.reflect.Method.invoke(Method.java:507)
08-07 12:32:14.077: I/dalvikvm(995): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
08-07 12:32:14.085: I/dalvikvm(995): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
08-07 12:32:14.085: I/dalvikvm(995): at dalvik.system.NativeStart.main(Native Method)
Thanks in advance for any help.
I found the issue, this is my theory:
This code is running through JNI; therefore, when I grab the image and set it equal to another image, it just passes the pointer. Additionally, because I start my grabber in the getFrame function, the grabber gets destroyed when the image is returned, and for a weird reason the memory gets flushed and the passed pointer becomes useless.
The solution to the issue is to either set the grabber as a global variable, to pass the grabber as an argument to the getFrame function, or (weirdly) to execute an opencv operation that touches the memory before returning the image (i.e. call cvCvSaveimage or cvCvtColor on something random does not even have to be related to the image).
I hope my explanation makes sense, and I do not know if it should be reported as a bug though ?

ActiveAndroid seems not to initialize

I configured ActiveAndroid at AndroidManifest.xml as described below:
<application
android:name="com.xxx.xxxx.XXXApplication"
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
<meta-data
android:name="AA_DB_NAME"
android:value="MyDB.db" />
<meta-data
android:name="AA_DB_VERSION"
android:value="2" />
...
</application>
Application class:
public class XXXApplication extends Application {
#Override
public void onCreate() {
super.onCreate();
ActiveAndroid.initialize(this);
}
}
Mode class is:
#Table(name = "Routes")
public class Route extends Model {
...
public static List<Routes> all(){
return new Select().from(Route.class).execute();
}
}
Ps: I follow the documentation:
https://github.com/pardom/ActiveAndroid/wiki/Getting-started
When call Routes.all() I got this error:
tried to execute code in unprepared class 'Lbr/com/xxx/xxx/xxxx/models/Route;'
Full stack is:
03-08 16:41:56.505: E/dalvikvm(23688): ERROR: tried to execute code in unprepared class 'Lbr/com/xxx/xxx/xxxx/models/Route;' (5)
03-08 16:41:56.505: I/dalvikvm(23688): "main" prio=5 tid=1 RUNNABLE
03-08 16:41:56.505: I/dalvikvm(23688): | group="main" sCount=0 dsCount=0 obj=0x41800508 self=0x417efce0
03-08 16:41:56.505: I/dalvikvm(23688): | sysTid=23688 nice=0 sched=0/0 cgrp=apps handle=1075560240
03-08 16:41:56.505: I/dalvikvm(23688): | schedstat=( 1596851683 269907401 1132 ) utm=148 stm=11 core=0
03-08 16:41:56.505: I/dalvikvm(23688): at com.xxxx.models.Route.all(Route.java:-1)
03-08 16:41:56.505: I/dalvikvm(23688): at com.xxxx.activities.SavedRoutesActivity.onCreate(SavedRoutesActivity.java:-1)
03-08 16:41:56.505: I/dalvikvm(23688): at com.xxxx.activities.SavedRoutesActivity_.onCreate(SavedRoutesActivity_.java:24)
03-08 16:41:56.505: I/dalvikvm(23688): at android.app.Activity.performCreate(Activity.java:5206)
03-08 16:41:56.505: I/dalvikvm(23688): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1083)
03-08 16:41:56.505: I/dalvikvm(23688): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2064)
03-08 16:41:56.505: I/dalvikvm(23688): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2125)
03-08 16:41:56.505: I/dalvikvm(23688): at android.app.ActivityThread.access$600(ActivityThread.java:140)
03-08 16:41:56.505: I/dalvikvm(23688): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1227)
03-08 16:41:56.505: I/dalvikvm(23688): at android.os.Handler.dispatchMessage(Handler.java:99)
03-08 16:41:56.505: I/dalvikvm(23688): at android.os.Looper.loop(Looper.java:137)
03-08 16:41:56.505: I/dalvikvm(23688): at android.app.ActivityThread.main(ActivityThread.java:4898)
03-08 16:41:56.505: I/dalvikvm(23688): at java.lang.reflect.Method.invokeNative(Native Method)
03-08 16:41:56.505: I/dalvikvm(23688): at java.lang.reflect.Method.invoke(Method.java:511)
03-08 16:41:56.505: I/dalvikvm(23688): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1006)
03-08 16:41:56.505: I/dalvikvm(23688): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773)
03-08 16:41:56.505: I/dalvikvm(23688): at dalvik.system.NativeStart.main(Native Method)
03-08 16:41:56.505: E/dalvikvm(23688): VM aborting
03-08 16:41:56.505: A/libc(23688): Fatal signal 11 (SIGSEGV) at 0xdeadd00d (code=1), thread 23688 (o.mobile.xxxx)
This is late but could help someone else who faces the same problem.
This problem only occurs in debug mode, To solve it :
remove any watched expressions (In Debug View) that involve that unprepared class.
If you don't use that class in your code just remove it (which solve the first point too).
Hope it helps.
Did you remember to write a standard constructor for Route? E. g.
public Route(){
super();
}
And if you have your own Application class, it must be derived from com.activeandroid.app.Application:
public class Application extends com.activeandroid.app.Application {
…
}
If that doesn’t help, please post the signature of Route.

Android PackageManger -- Exception

When getting the list of packages which is running in devices, i am getting the execption proxy stub exception from my logcat
This the code i used
List packages = pm.getInstalledApplications(PackageManager.GET_META_DATA);
This the exception which im am getting
(mutexes: tll=0 tsl=0 tscl=0 ghl=0)
"main" prio=5 tid=1 NATIVE
| group="main" sCount=1 dsCount=0 obj=0x40ab1478 self=0x112f910
| sysTid=1801 nice=0 sched=0/0 cgrp=default handle=1074439528
| schedstat=( 0 0 0 ) utm=465 stm=85 core=1
at android.os.BinderProxy.transact(Native Method)
at android.content.pm.IPackageManager$Stub$Proxy.getInstalledApplications(IPackageManager.java:1930)
at android.app.ApplicationPackageManager.getInstalledApplications(ApplicationPackageManager.java:414)
at com.informate.smnpd.DataUsageAppManager.processData1(DataUsageAppManager.java:237)
at com.informate.smnpd.DataUsageAppManager.processData(DataUsageAppManager.java:114)
at com.informate.smnpd.BackgroundService.getData(BackgroundService.java:667)
at com.informate.smnpd.ManualUpdate.onClick(ManualUpdate.java:221)
at android.view.View.performClick(View.java:3526)
at android.view.View$PerformClick.run(View.java:14133)
at android.os.Handler.handleCallback(Handler.java:605)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4697)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:787)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:554)
at dalvik.system.NativeStart.main(Native Method)
Can anyone please guide me on why this exception will occures at the time of getting installed package name. Thanks in advance

out of memory on every other run, on Android

my app runs fine the first run, but if i restart it crashes and makes me force close. after i hit the force close button then i can start the app again. if i then try to restart after hitting the back button i have to force close. i lets me run it without error every other attempt. i thought android was supposed to take care of returning memory to the computer so we dont have to do that housekeeping: i do have a somewhat large array:
int worldgrid= new int[640][480][3];
in my constructor, i may have to shorten it. i does work the first attempt though. log cat messages:
05-08 19:09:46.035: E/dalvikvm-heap(420): Out of memory on a 28-byte
allocation.
05-08 19:09:46.195: I/dalvikvm(420): | group="main" sCount=0
dsCount=0 s=N obj=0x4001d8e0 self=0xccb0 05-08 19:09:46.195:
I/dalvikvm(420): | sysTid=420 nice=0 sched=0/0 cgrp=default
handle=-1345026008 05-08 19:09:46.205: I/dalvikvm(420): |
schedstat=( 52616400652 22917249866 1196 ) 05-08 19:09:46.205:
I/dalvikvm(420): at java.lang.reflect.Array.createMultiArray(Native
Method) 05-08 19:09:46.205: I/dalvikvm(420): at
java.lang.reflect.Array.newInstance(Array.java:444) 05-08
19:09:46.455: I/dalvikvm(420): at
com.gravedigger.MainGamePanel.(MainGamePanel.java:215) 05-08
19:09:46.455: I/dalvikvm(420): at
com.digger.DiggerActivity.onCreate(GravediggerActivity.java:116) 05-08
19:09:46.615: I/dalvikvm(420): at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
05-08 19:09:46.625: I/dalvikvm(420): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
05-08 19:09:46.765: I/dalvikvm(420): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
05-08 19:09:46.765: I/dalvikvm(420): at
android.app.ActivityThread.access$2300(ActivityThread.java:125) 05-08
19:09:46.775: I/dalvikvm(420): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
05-08 19:09:46.775: I/dalvikvm(420): at
android.os.Handler.dispatchMessage(Handler.java:99) 05-08
19:09:46.785: I/dalvikvm(420): at
android.os.Looper.loop(Looper.java:123) 05-08 19:09:46.785:
I/dalvikvm(420): at
android.app.ActivityThread.main(ActivityThread.java:4627) 05-08
19:09:46.895: I/dalvikvm(420): at
java.lang.reflect.Method.invokeNative(Native Method) 05-08
19:09:46.895: I/dalvikvm(420): at
java.lang.reflect.Method.invoke(Method.java:521) 05-08 19:09:46.895:
I/dalvikvm(420): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
05-08 19:09:46.895: I/dalvikvm(420): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) 05-08
19:09:46.905: I/dalvikvm(420): at
dalvik.system.NativeStart.main(Native Method) 05-08 19:09:47.038:
E/dalvikvm(420): HeapWorker is wedged: 11152ms spent inside
Lcom/android/internal/os/BinderInternal$GcWatcher;.finalize()V 05-08
19:09:47.038: I/dalvikvm(420): DALVIK THREADS: 05-08 19:09:47.045:
I/dalvikvm(420): "main" prio=5 tid=1 VMWAIT
05-08 19:09:47.045: I/dalvikvm(420): | group="main" sCount=1
dsCount=0 s=N obj=0x4001d8e0 self=0xccb0 05-08 19:09:47.045:
I/dalvikvm(420): | sysTid=420 nice=0 sched=0/0 cgrp=default
handle=-1345026008 05-08 19:09:47.045: I/dalvikvm(420): |
schedstat=( 52980087202 23270903160 1219 ) 05-08 19:09:47.045:
I/dalvikvm(420): at java.lang.reflect.Array.createMultiArray(Native
Method) 05-08 19:09:47.045: I/dalvikvm(420): at
java.lang.reflect.Array.newInstance(Array.java:444) 05-08
19:09:47.045: I/dalvikvm(420): at
com.digger.MainGamePanel.(MainGamePanel.java:215) 05-08
19:09:47.045: I/dalvikvm(420): at
com.digger.DiggerActivity.onCreate(GravediggerActivity.java:116) 05-08
19:09:47.045: I/dalvikvm(420): at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
05-08 19:09:47.185: I/dalvikvm(420): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
05-08 19:09:47.185: I/dalvikvm(420): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
05-08 19:09:47.195: I/dalvikvm(420): at
android.app.ActivityThread.access$2300(ActivityThread.java:125) 05-08
19:09:47.195: I/dalvikvm(420): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
05-08 19:09:47.195: I/dalvikvm(420): at
android.os.Handler.dispatchMessage(Handler.java:99) 05-08
19:09:47.195: I/dalvikvm(420): at
android.os.Looper.loop(Looper.java:123) 05-08 19:09:47.195:
I/dalvikvm(420): at
android.app.ActivityThread.main(ActivityThread.java:4627) 05-08
19:09:47.195: I/dalvikvm(420): at
java.lang.reflect.Method.invokeNative(Native Method) 05-08
19:09:47.195: I/dalvikvm(420): at
java.lang.reflect.Method.invoke(Method.java:521) 05-08 19:09:47.195:
I/dalvikvm(420): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
05-08 19:09:47.195: I/dalvikvm(420): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) 05-08
19:09:47.195: I/dalvikvm(420): at
dalvik.system.NativeStart.main(Native Method) 05-08 19:09:47.195:
I/dalvikvm(420): "Binder Thread #2" prio=5 tid=6 NATIVE 05-08
19:09:47.195: I/dalvikvm(420): | group="main" sCount=1 dsCount=0 s=N
obj=0x44f366b8 self=0x11d230 05-08 19:09:47.195: I/dalvikvm(420): |
sysTid=425 nice=0 sched=0/0 cgrp=default handle=1297528 05-08
19:09:47.195: I/dalvikvm(420): | schedstat=( 118912719 416670422 51
) 05-08 19:09:47.195: I/dalvikvm(420): at
dalvik.system.NativeStart.run(Native Method) 05-08 19:09:47.195:
I/dalvikvm(420): "Binder Thread #1" prio=5 tid=5 NATIVE 05-08
19:09:47.195: I/dalvikvm(420): | group="main" sCount=1 dsCount=0 s=N
obj=0x44f36480 self=0x11fd80 05-08 19:09:47.750: I/dalvikvm(420): |
sysTid=424 nice=0 sched=0/0 cgrp=default handle=1269616 05-08
19:09:47.750: I/dalvikvm(420): | schedstat=( 114332827 305656917 35
) 05-08 19:09:47.750: I/dalvikvm(420): at
dalvik.system.NativeStart.run(Native Method) 05-08 19:09:47.755:
I/dalvikvm(420): "JDWP" daemon prio=5 tid=4 VMWAIT 05-08 19:09:47.755:
I/dalvikvm(420): | group="system" sCount=1 dsCount=0 s=N
obj=0x44f352a0 self=0x135ad0 05-08 19:09:47.755: I/dalvikvm(420): |
sysTid=423 nice=0 sched=0/0 cgrp=default handle=1196352 05-08
19:09:47.765: I/dalvikvm(420): | schedstat=( 59551849 158373474 18 )
05-08 19:09:47.765: I/dalvikvm(420): at
dalvik.system.NativeStart.run(Native Method) 05-08 19:09:47.775:
I/dalvikvm(420): "Signal Catcher" daemon prio=5 tid=3 VMWAIT 05-08
19:09:47.886: I/dalvikvm(420): | group="system" sCount=1 dsCount=0
s=N obj=0x44f351e8 self=0x125550 05-08 19:09:47.886: I/dalvikvm(420):
| sysTid=422 nice=0 sched=0/0 cgrp=default handle=1240608 05-08
19:09:47.886: I/dalvikvm(420): | schedstat=( 2639901 40055709 3 )
05-08 19:09:47.886: I/dalvikvm(420): at
dalvik.system.NativeStart.run(Native Method) 05-08 19:09:47.886:
I/dalvikvm(420): "HeapWorker" daemon prio=5 tid=2 RUNNABLE 05-08
19:09:47.886: I/dalvikvm(420): | group="system" sCount=0 dsCount=0
s=N obj=0x438b8e50 self=0x12ece0 05-08 19:09:47.886: I/dalvikvm(420):
| sysTid=421 nice=0 sched=0/0 cgrp=default handle=1195896 05-08
19:09:47.906: I/dalvikvm(420): | schedstat=( 4477669539 2785983510
211 ) 05-08 19:09:47.906: I/dalvikvm(420): at
com.android.internal.os.BinderInternal$GcWatcher.finalize(BinderInternal.java:~48)
05-08 19:09:47.906: I/dalvikvm(420): at
dalvik.system.NativeStart.run(Native Method) 05-08 19:09:47.906:
D/dalvikvm(420): threadid=2: sending two SIGSTKFLTs to threadid=2
(tid=421) to cause debuggerd dump 05-08 19:09:57.895: D/dalvikvm(420):
Sent, pausing to let debuggerd run 05-08 19:10:05.956:
D/dalvikvm(420): Continuing 05-08 19:10:05.956: E/dalvikvm(420): VM
aborting
Probably, not good to have so pretty big arrays in memory.
But anyway, you can decrease memory usage by refactoring your array this way:
int worldgrid = new int[3][480][640];
This trick will reduce memory usage in several times. It's related with java memory overhead for arrays and each item, details can be found here.
http://www.javamex.com/tutorials/memory/array_memory_usage.shtml
Also check, that you don't keep any link to array, it will prevent removing it from memory. Also garbage collector doesn't remove from memory right after removing all links. So, if you don't make link to array equal to null, it's kept in memory and when you restart your app (there is no guaranty that activity was killed fully), and try to create array in onCreate (as I see from log) the old array can be not yet removed.
I can't tell you why you are getting the error every other time without seeing the rest of your code. Do you have static variables you are using?
However I can give you advice on lessening your memory consumption by a factor of 3. It looks like you are attempting to store an rgb image. The problem is each red, green, or blue pixel only needs one byte, but you are giving it an int which is 4 bytes. A better approach is to encode the red, green, and blue into a single int using: int color = Color.rgb(red, geen, blue)That way you only need to initialize your array to int[] worldgrid= new int[640][480] and you cut down the memory usage by a factor of 3.
In addition, you should probably not even store it as a multi-dimensional array at all, and just do int[] worldgrid = new int[640*480];and when indexing into array, just do: int result = worldgrid[row + col*640];

What is the difference between a crash and freeze?

I took a look in the developer's console and saw for the first time a freeze report rather than a crash. A crash is easy to define the breaking point from the stack trace. It normally led to a class/method being incorrectly defined or implemented.
However I have never encountered a freeze. Since Google made the effort to make the distinction in the dev console, what is the distinction?
From a general point of view obviously a crash is a force close. But does a freeze simply slow down the user experience without a force close? What are the technical differences? Is there a different method to address a freeze when compared to a crash?
Edit: added example stack traces.
Here is an example of a Crash The stack trace is very specific pointing to a line of failure.
android.view.InflateException: Binary XML file line #21: Error inflating class android.widget.ZoomControls
at android.view.LayoutInflater.createView(LayoutInflater.java:518)
at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:568)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:623)
at android.view.LayoutInflater.inflate(LayoutInflater.java:383)
at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
at android.widget.ZoomButtonsController.createContainer(ZoomButtonsController.java:262)
at android.widget.ZoomButtonsController.<init>(ZoomButtonsController.java:211)
at android.webkit.WebView.getZoomButtonsController(WebView.java:6313)
at android.webkit.WebView.startDrag(WebView.java:5700)
at android.webkit.WebView.onTouchEvent(WebView.java:5428)
at android.view.View.dispatchTouchEvent(View.java:3885)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:903)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)
Here is an example Freeze the stack trace is less specific not pointing to a direct line or activity at fault.
DALVIK THREADS:
(mutexes: tll=0 tsl=0 tscl=0 ghl=0 hwl=0 hwll=0)
"main" prio=5 tid=1 NATIVE
| group="main" sCount=1 dsCount=0 obj=0x40027550 self=0xcfc0
| sysTid=2076 nice=0 sched=0/0 cgrp=bg_non_interactive handle=-1345006240
| schedstat=( 30958526727 7780212297 24174 )
at android.graphics.Bitmap.nativeCreateScaledBitmap(Native Method)
at android.graphics.Bitmap.createScaledBitmap(Bitmap.java:556)
at android.graphics.BitmapFactory.finishDecode(BitmapFactory.java:722)
at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:478)
at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:697)
at android.content.res.Resources.loadDrawable(Resources.java:1727)
at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
at android.view.View.<init>(View.java:1998)
at android.widget.TextView.<init>(TextView.java:389)
at android.widget.Button.<init>(Button.java:108)
at android.widget.Button.<init>(Button.java:104)
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:415)
at android.view.LayoutInflater.createView(LayoutInflater.java:505)
at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:568)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:623)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
at android.view.LayoutInflater.inflate(LayoutInflater.java:408)
at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:224)
at android.app.Activity.setContentView(Activity.java:1702)
at com.e3h.usmcknowledge.MainActivity.onCreate(MainActivity.java:37)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1093)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1780)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1837)
at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3242)
at android.app.ActivityThread.access$1600(ActivityThread.java:132)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1037)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:143)
at android.app.ActivityThread.main(ActivityThread.java:4196)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
at dalvik.system.NativeStart.main(Native Method)
There's really no formal definition. But broadly speaking, a crash occur when an uncontrolled error happens. Freeze is when an application stops to respond to any event (for example an infinite loop) but no actual error happens (no exception thrown).
In general, a crash is an unexpected, abnormal exit. A freeze or hang occurs when the program (or the entire system) stops responding entirely.

Categories

Resources