Quantcast
Channel: Active questions tagged crash - Stack Overflow
Viewing all 7128 articles
Browse latest View live

ViewCompat.enableAccessibleClickableSpanSupport(textview) is not working

$
0
0

I am giving ViewCompat.enableAccessibleClickableSpanSupport(textview) a try but spannable is crashing the app still. The way I have this is

// ViewCompat.enableAccessibleClickableSpanSupport(textview) 
val ss = SpannableString(someString)
ss.setSpan( bla bla bla) // i have a clickablespan with nocopyspan and imagespan
textview.text = ss
textview.movementMethod = LinkMovementMethod.getInstance()
ViewCompat.enableAccessibleClickableSpanSupport(textview)

I tried having the ViewCompact code at the top and at the bottom, one at the top or one at the bottom but still my app is still crashing on Accessibility or Talkback. I am running the app on Android 9 but I think it will crash in all devices anyway. ANyone has the similar experience and how do you approach this? I could have use html way but I need the part of the textview to be clickable and navigate to the next fragment.


How to fix internal error in Firestore crash

$
0
0

My app(HouseLog) is in production and I have been getting a Firebase Firestore crash that happens only on Android 5 and 6. The crash explains what is happening pretty well, but I have no clue how to actually fix it. I am assuming it is an issue with a Gradle file. The crash happens on the line FirebaseFirestore.getInstance().collection("Users")

Fatal Exception: java.lang.RuntimeException: Internal error in Firestore (19.0.0).
       at com.google.firebase.firestore.util.AsyncQueue.lambda$panic$5(AsyncQueue.java)
       at com.google.firebase.firestore.util.AsyncQueue$$Lambda$5.run(AsyncQueue.java)
       at android.os.Handler.handleCallback + 742(Handler.java:742)
       at android.os.Handler.dispatchMessage + 95(Handler.java:95)
       at android.os.Looper.loop + 157(Looper.java:157)
       at android.app.ActivityThread.main + 5601(ActivityThread.java:5601)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run + 774(ZygoteInit.java:774)
       at com.android.internal.os.ZygoteInit.main + 652(ZygoteInit.java:652)
Caused by java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/firebase/firestore/c/Ja;
       at com.google.firebase.firestore.local.SQLiteSchema.ensureSequenceNumbers(SQLiteSchema.java)
       at com.google.firebase.firestore.local.SQLiteSchema.addSequenceNumber(SQLiteSchema.java)
       at com.google.firebase.firestore.local.SQLiteSchema.addSequenceNumber(SQLiteSchema.java)
       at com.google.firebase.firestore.local.SQLitePersistence$OpenHelper.onCreate(SQLitePersistence.java)
       at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked + 251(SQLiteOpenHelper.java:251)
       at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase + 163(SQLiteOpenHelper.java:163)
       at com.google.firebase.firestore.local.SQLitePersistence.start(SQLitePersistence.java)
       at com.google.firebase.firestore.core.FirestoreClient.getDocumentsFromLocalCache(FirestoreClient.java)
       at com.google.firebase.firestore.core.FirestoreClient.getDocumentsFromLocalCache(FirestoreClient.java)
       at com.google.firebase.firestore.core.FirestoreClient$$Lambda$2.run(FirestoreClient.java)
       at com.google.firebase.firestore.util.AsyncQueue.lambda$enqueue$4(AsyncQueue.java)
       at com.google.firebase.firestore.util.AsyncQueue$$Lambda$4.call(AsyncQueue.java)
       at com.google.firebase.firestore.util.AsyncQueue.lambda$enqueue$3(AsyncQueue.java)
       at com.google.firebase.firestore.util.AsyncQueue$$Lambda$3.run(AsyncQueue.java)
       at java.util.concurrent.Executors$RunnableAdapter.call + 423(Executors.java:423)
       at java.util.concurrent.FutureTask.run + 237(FutureTask.java:237)
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201 + 154(ScheduledThreadPoolExecutor.java:154)
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run + 269(ScheduledThreadPoolExecutor.java:269)
       at java.util.concurrent.ThreadPoolExecutor.runWorker + 1113(ThreadPoolExecutor.java:1113)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run + 588(ThreadPoolExecutor.java:588)
       at com.google.firebase.firestore.util.AsyncQueue$DelayedStartFactory.run(AsyncQueue.java)
       at java.lang.Thread.run + 818(Thread.java:818)
Caused by java.lang.ClassNotFoundException: Didn't find class "com.google.firebase.firestore.c.Ja" on path: DexPathList[[zip file "/data/app/chenige.chkchk.wairz-1/base.apk", zip file "/data/app/chenige.chkchk.wairz-1/split_config.xhdpi.apk"],nativeLibraryDirectories=[/data/app/chenige.chkchk.wairz-1/lib/arm64, /vendor/lib64, /system/lib64]]
       at dalvik.system.BaseDexClassLoader.findClass + 56(BaseDexClassLoader.java:56)
       at java.lang.ClassLoader.loadClass + 511(ClassLoader.java:511)
       at java.lang.ClassLoader.loadClass + 469(ClassLoader.java:469)
       at com.google.firebase.firestore.local.SQLiteSchema.ensureSequenceNumbers(SQLiteSchema.java)
       at com.google.firebase.firestore.local.SQLiteSchema.addSequenceNumber(SQLiteSchema.java)
       at com.google.firebase.firestore.local.SQLiteSchema.addSequenceNumber(SQLiteSchema.java)
       at com.google.firebase.firestore.local.SQLitePersistence$OpenHelper.onCreate(SQLitePersistence.java)
       at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked + 251(SQLiteOpenHelper.java:251)
       at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase + 163(SQLiteOpenHelper.java:163)
       at com.google.firebase.firestore.local.SQLitePersistence.start(SQLitePersistence.java)
       at com.google.firebase.firestore.core.FirestoreClient.getDocumentsFromLocalCache(FirestoreClient.java)
       at com.google.firebase.firestore.core.FirestoreClient.getDocumentsFromLocalCache(FirestoreClient.java)
       at com.google.firebase.firestore.core.FirestoreClient$$Lambda$2.run(FirestoreClient.java)
       at com.google.firebase.firestore.util.AsyncQueue.lambda$enqueue$4(AsyncQueue.java)
       at com.google.firebase.firestore.util.AsyncQueue$$Lambda$4.call(AsyncQueue.java)
       at com.google.firebase.firestore.util.AsyncQueue.lambda$enqueue$3(AsyncQueue.java)
       at com.google.firebase.firestore.util.AsyncQueue$$Lambda$3.run(AsyncQueue.java)
       at java.util.concurrent.Executors$RunnableAdapter.call + 423(Executors.java:423)
       at java.util.concurrent.FutureTask.run + 237(FutureTask.java:237)
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201 + 154(ScheduledThreadPoolExecutor.java:154)
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run + 269(ScheduledThreadPoolExecutor.java:269)
       at java.util.concurrent.ThreadPoolExecutor.runWorker + 1113(ThreadPoolExecutor.java:1113)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run + 588(ThreadPoolExecutor.java:588)
       at com.google.firebase.firestore.util.AsyncQueue$DelayedStartFactory.run(AsyncQueue.java)
       at java.lang.Thread.run + 818(Thread.java:818)

This is my app's build.gradle.

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'io.fabric'

android {
compileSdkVersion 28
    defaultConfig {
        applicationId "chenige.chkchk.wairz"
        minSdkVersion 21
        targetSdkVersion 28
        versionCode 22
        versionName "1.4.1"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        signingConfig signingConfigs.releaseconfig
        resConfigs "en"
    }
    buildTypes {
        release {
            minifyEnabled true
            debuggable false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    productFlavors {
    }
    compileOptions {
        sourceCompatibility = '1.8'
        targetCompatibility = '1.8'
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'androidx.appcompat:appcompat:1.0.2'
    implementation 'androidx.recyclerview:recyclerview:1.0.0'
    implementation 'com.google.android.material:material:1.0.0'
    // FirebaseUI for Firebase Realtime Database
    implementation 'com.firebaseui:firebase-ui-database:5.1.0'
    // FirebaseUI for Cloud Firestore
    implementation 'com.firebaseui:firebase-ui-firestore:5.1.0'
    // FirebaseUI for Firebase Auth
    implementation 'com.firebaseui:firebase-ui-auth:5.1.0'
    // FirebaseUI for Cloud Storage
    implementation 'com.firebaseui:firebase-ui-storage:5.1.0'
    implementation 'com.google.firebase:firebase-analytics:17.0.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'com.google.gms:google-services:4.3.1'
    implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
    implementation 'com.github.AppIntro:AppIntro:5.1.0'
    testImplementation 'junit:junit:4.12'
    implementation 'com.github.bumptech.glide:glide:4.8.0'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.7.1'
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'uk.co.markormesher:android-fab:2.2.2'
    implementation 'de.hdodenhof:circleimageview:2.2.0'
    implementation 'com.squareup.picasso:picasso:2.71828'
    implementation 'com.github.faranjit:currency-edittext:1.0.1'
    implementation 'com.makeramen:roundedimageview:2.3.0'
    implementation 'com.opencsv:opencsv:4.5'
    implementation 'com.davemorrissey.labs:subsampling-scale-image-view:3.10.0'
    implementation 'com.elconfidencial.bubbleshowcase:bubbleshowcase:1.3.1'
    implementation "com.leinardi.android:speed-dial:3.0.0"
    implementation 'com.codemybrainsout.rating:ratingdialog:1.0.8'

}

configurations {
    all {
        exclude module: 'commons-logging'
    }
}

apply plugin: 'com.google.gms.google-services'

repositories {
    mavenCentral()
}

Here is my project's build.gradle

buildscript {
    ext.kotlin_version = '1.3.41'

    repositories {
        google()
        jcenter()

        maven {
            url 'https://maven.fabric.io/public'
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.4.2'
        // Add dependency
        classpath 'io.fabric.tools:gradle:1.30.0'  // Crashlytics plugin
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
        classpath 'com.google.gms:google-services:4.3.1'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        maven { url 'https://jitpack.io' }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

Weird EXC_BAD_ACCESS when initialising object

$
0
0

I have a weird EXC_BAD_ACCESS crash, I'm trying to initialise an object by using singleton like this :

@objc final class Toto: XSuperClass {

    /// Singleton
    @objc static var instance = Toto()


    /// Hide the creator to force using singleton
    @objc private init() {
        print("Initializer is called !")
        super.init(
            "xyz",
            serverHost: "",
            serverPath: ""
        )
    }

    @objc func update() {
        ...
    }

The XSuperClass extends from NSObject and contained in a pod.

In Appdelegate :

-(void)applicationDidBecomeActive:(UIApplication *)application
{
   [[Toto instance] update];
}

Sometimes it crashes at : @objc static var instance = Toto() Thread 1: EXC_BAD_ACCESS (code=1, address=0x9)

The thread 1 contains :

#11 0x0000000105a20004 in Toto.instance.unsafeMutableAddressor at /Users/.../Toto.swift
#10 0x00000001076196d9 in swift_once ()
#8  0x0000000107e5ad48 in _dispatch_client_callout ()
#7  0x0000000105a1ff90 in globalinit_33_0DC663E05309E94BD36536F7E931D58A_func0 at /Users/../Toto.swift
#6  0x0000000105a21028 in type metadata accessor for Toto ()
#0  0x0000000107602737 in swift_checkMetadataState ()

The XSuperClass :

/** This class is the base class that handles ... */
@objc open class XSuperClass: NSObject {

...

/// Main initializer
    public init(_ feature: String,
                ... dependencies that all have default values,
                serverHost: String?,
                serverPath: String?
    ) {
        self.feature = feature
        ...
        self.serverHost = serverHost
        self.serverPath = serverPath
    }

It seems that I'm trying to initialise a released object in memory, but I can't figure out how to fix this, I spent a lot of time investigating the problem with no luck, any ideas please ?

[EDIT] THIS CRASH OCCURS ONLY ON IOS 13

excel crashes between end with and for loop?

$
0
0

Whenever I try to add a row it randomly crashes. yes, randomly. sometimes it crashes at end withand sometimes it crashes at for rij = 4 to lastRow.

if I use the debugger in vba with a fast rate of going through the lines it crashes faster. and if i take pauses (30 seconds) between debugging a line it doesn't crash.

how can I fix this issue?

Edit: I have the exact same code in a different module and it does work there.

lastrow has the value 5 when I debug it, so the problem isn't that Rij > lastRow

code:

    Option Explicit
Dim lastRow As Long
Dim IngevuldeCellen As Integer
Dim Ingevuld As Integer
Dim Rij As Integer
Dim tbl As Object
Dim AantalRijen As Integer
Dim laatsteRij As Long
Private Sub WorkSheet_Change(ByVal Target As Range)
     'Als laatste rij 6 ingevulde velden heeft doe dit
    lastRow = Cells(Cells.Rows.Count, "B").End(xlUp).Row
    IngevuldeCellen = WorksheetFunction.CountA(Range("B"& lastRow & ":G"& lastRow))
    If IngevuldeCellen >= 4 Then
        Call Module3.AddRowToBottom
        Range("F1:F"& lastRow).Interior.Color = RGB(59, 148, 0)
        Range("A1:A"& lastRow).Interior.Color = RGB(59, 148, 0)

    ElseIf IngevuldeCellen < 4 Then
    Range("A"& lastRow).Interior.Color = RGB(255, 0, 0)
    Range("F"& lastRow).Interior.Color = RGB(255, 0, 0)
    End If


    Ingevuld = WorksheetFunction.CountA(Range("H6:O18"))
    If Ingevuld >= 10 Then
        With Sheets("Ruimtelijst")
            lastRow = .Cells(Cells.Rows.Count, "G").End(xlUp).Row
        End With
        For Rij = 4 To lastRow
            If Not Intersect(Target, Blad3.ListObjects("tbl_"& Rij - 3).Range) Is Nothing Then
                'Zoek de laatste rij van de tabel op
                Set tbl = Blad3.ListObjects("tbl_"& Rij - 3)
                AantalRijen = tbl.Range.Rows.Count
                laatsteRij = tbl.Range.Cells(AantalRijen, "E").Row
                'Roept module
                Call Module3.AddRow(laatsteRij)
            End If
        Next Rij
    End If
End Sub

0x88980406 SyncFlush() ...Is there a workaround?

$
0
0

I get this exception in my application. I have found links discussing it on the web but nothing indicating how to track it down and/or workaround it.

Please do not reply with links from the internet. Please reply with strategies of tracking the source. Please reply with workarounds if you found them.

Source: PresentationCore
Message: Exception from HRESULT: 0x88980406
Stack Trace:
   at System.Windows.Media.Composition.DUCE.Channel.SyncFlush()
   at System.Windows.Interop.HwndTarget.UpdateWindowSettings(Boolean enableRenderTarget, Nullable`1 channelSet)
   at System.Windows.Interop.HwndTarget.UpdateWindowPos(IntPtr lParam)
   at System.Windows.Interop.HwndTarget.HandleMessage(WindowMessage msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Interop.HwndSource.HwndTargetFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)

Can't Upload Images to Fire base

$
0
0

I am trying to allow new users to upload profile pictures but whenever I attempt to register, the app crashes. After debugging the app I found that it always occurs due to line 175 having an empty user ID. Line 175 is: DatabaseReference myRef = firebaseDatabase.getReference(firebaseAuth.getUid());

I have been following this YouTube tutorial ,https://www.youtube.com/watch?v=-v1O9rxienU, and he uploads images with no problems even though we have the same code. How do I fix this?

private EditText userName, userPassword, userEmail, userGrade;
private Button regButton;
private TextView userLogin;
private FirebaseAuth firebaseAuth;
private ImageView userProfilePic;
String email, name, grade, password;
private FirebaseStorage firebaseStorage;
private static int PICK_IMAGE = 123;
Uri imagePath;
private StorageReference storageReference;


@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    if(requestCode == PICK_IMAGE && resultCode == RESULT_OK && data.getData() != null){
        imagePath = data.getData();
        try {
            Bitmap bitmap = MediaStore.Images.Media.getBitmap(getContentResolver(), imagePath);
            userProfilePic.setImageBitmap(bitmap);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
    super.onActivityResult(requestCode, resultCode, data);
}



@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_register__form);
    setupUiViews();


    firebaseAuth = FirebaseAuth.getInstance();
    firebaseStorage = FirebaseStorage.getInstance();

    final StorageReference storageReference = firebaseStorage.getReference();


    userProfilePic.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            //  Intent galleryIntent = new Intent();
            //  galleryIntent.setAction(Intent.ACTION_GET_CONTENT);
            // galleryIntent.setType("image/*");
            // startActivityForResult(galleryIntent, Gallery_Pick);
            Intent intent = new Intent();
            intent.setType("image/*");
            intent.setAction(Intent.ACTION_GET_CONTENT);
            startActivityForResult(Intent.createChooser(intent, "Select Image"), PICK_IMAGE);


        }
    });



    regButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            if(validate()){
                //upload to database
                //StorageReference myRef1 = storageReference.child(firebaseAuth.getUid());
                String user_email = userEmail.getText().toString().trim();
                String user_password = userPassword.getText().toString().trim();

                firebaseAuth.createUserWithEmailAndPassword(user_email, user_password).addOnCompleteListener(new OnCompleteListener<AuthResult>() {
                    @Override
                    public void onComplete(@NonNull Task<AuthResult> task) {

                        if (task.isSuccessful()) {
                            sendUserData();
                            firebaseAuth.signOut();
                            Toast.makeText(Register_Form.this, "Registration Successful", Toast.LENGTH_SHORT).show();
                            startActivity(new Intent(Register_Form.this, login_screen.class));
                        }else{
                            Toast.makeText(Register_Form.this, "Registration Failed", Toast.LENGTH_SHORT).show();
                        }
                    }
                });
            }

        }
    });

    userLogin.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            startActivity(new Intent(Register_Form.this, login_screen.class ));
        }
    });



    }


private void setupUiViews(){
    userName = (EditText)findViewById(R.id.etName);
    userEmail = (EditText)findViewById(R.id.etEmail);
    userPassword = (EditText)findViewById(R.id.etPass);
    regButton = (Button)findViewById(R.id.btnRegister);
   // regButton.setOnClickListener();
    userLogin = (TextView)findViewById(R.id.tvSIgn_In);
    userGrade = (EditText)findViewById(R.id.etGrade);
    userProfilePic =(ImageView)findViewById(R.id.ivProfile);

}


private Boolean validate(){

    Boolean result = false;

     name = userName.getText().toString();
     password = userPassword.getText().toString();
     email = userEmail.getText().toString();
     grade = userGrade.getText().toString();

    if(name.isEmpty() || password.isEmpty() || email.isEmpty() || grade.isEmpty() || imagePath == null ) {
        Toast.makeText(this, "Please enter all details", Toast.LENGTH_SHORT).show();
    }else{
        result = true;
    }
    return result;
}

private void sendUserData(){

    FirebaseDatabase firebaseDatabase = FirebaseDatabase.getInstance();
    DatabaseReference myRef = firebaseDatabase.getReference(firebaseAuth.getUid());
   StorageReference imageReference = storageReference.child(firebaseAuth.getUid()).child("Images").child("Profile Pic");  //User id/Images/Profile Pic.jpg
   UploadTask uploadTask = imageReference.putFile(imagePath);
   uploadTask.addOnFailureListener(new OnFailureListener() {
       @Override
       public void onFailure(@NonNull Exception e) {
           Toast.makeText(Register_Form.this, "Upload failed!", Toast.LENGTH_SHORT).show();
       }
   }).addOnCompleteListener(new OnCompleteListener<UploadTask.TaskSnapshot>() {
        @Override
        public void onComplete(@NonNull Task<UploadTask.TaskSnapshot> task) {
            Toast.makeText(Register_Form.this, "Upload successful!", Toast.LENGTH_SHORT).show();
     }
    });
    UserProfile userProfile = new UserProfile(grade, email, name);
    myRef.setValue(userProfile);
}

}

Pygame crashing on mac using same code written in tutorials but wrote on windows command

$
0
0

So my pygame has been crashing saying not responding to my code, whether on Pycharm and idle both are not working(I'm using a mac). I just saw a question asked by another guy he is having the same issue and a guy responded him by revising some of his code and I used the code he revised and my python for the first time read and successfully ran my code(pygame). For me, I'm following a tutorial and this guy is using a window and coding on windows. we have the exact same code but it is not working on my mac because python is not responding. But for the other code my python responded. Is there a difference between windows and mac on coding pygame or python respond rules, I'm so confused. Here is the code from the tutorial, it is supposed to come out a screen and goes away, but my python can't respond.

"""

import pygame

pygame.init()

win = pygame.display.set_mode((500,500))

pygame.display.set_aption("First Game")

"""

Random crash issue or heap size issue in an Android app

$
0
0

I am facing random crash on my application developed for "GlassDesign"; the purpose is to showcase their glasses to their clients and to the agents as well.

The app size is 150MB size.

When I am walking through the application that takes 10 to 15 minutes to crash, this is not happening on any particular screen to understand the issue.

I have reed few post and made few changes to application as well.

  1. In manifest I done these changes

    android:largeHeap="true" // in application tag
    android:allowBackup="false" // for cache
    
  2. On every activity I cleared the existing cache (this also helped to increase the crash to two to three screens but not entire app)

    public boolean deleteDir(File dir) {
    if (dir != null && dir.isDirectory()) {
     String[] children = dir.list();
     for (int i = 0; i < children.length; i++) {
         if(!dir.getAbsolutePath().contains("/databases")){
            boolean success = deleteDir(new File(dir, children[i]));
            if (!success) {
               return false;
            }
         }else{
             return true;
         }
     }
    }
       return dir.delete();
    }
    
  3. For loading images I have used universal image loader (external jar file) for better performance.


onClick button PDF creation causing crash android

$
0
0

I'm using this git depo it's an application that allows you to capture or choose images from gallery and save them in a PDF format.

It work fine, but when I tried to integrate in my app module (new project) and clicked on the button to start the activity it crash. I haven't changed anything I added Logcat below

I'm not sure if it's related to the style I'm using

Any ideas ?

Note : I already added the activity in my manifest.

MainActivity

private static final int INTENT_REQUEST_GET_IMAGES = 13;
private static final String LOG_ACTIVITY = "MainActivity";

Activity activity;
Image image;
String path, filename;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    Button btn = findViewById(R.id.btn);
    activity = this;

    FileUtils.folderApp();

    filename=new Date().toString();

    btn.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {

            getImages();
        }
    });
}

private void getImages() {

    Config config = new Config();

    config.setToolbarTitleRes(R.string.str_bar_tool);
    //config.

    ImagePickerActivity.setConfig(config);

    Intent intent = new Intent(this, ImagePickerActivity.class);
    startActivityForResult(intent, INTENT_REQUEST_GET_IMAGES);

}

@Override
protected void onActivityResult(int requestCode, int resuleCode, Intent intent) {
    super.onActivityResult(requestCode, resuleCode, intent);

    if (requestCode == INTENT_REQUEST_GET_IMAGES && resuleCode == Activity.RESULT_OK) {

        ArrayList<Uri> image_uris = intent.getParcelableArrayListExtra(ImagePickerActivity.EXTRA_IMAGE_URIS);

        if(image_uris.size()!=0){

            ArrayList<String> tempUris = new ArrayList<>();

            for (Uri uri : image_uris) {

                tempUris.add(uri.getPath());
            }

            CallBackCreatePdf callBackCreatePdf = new CallBackCreatePdf() {
                @Override
                public void OnCallBackCreatePdf(String tPath) {

                    if(tPath!=""){

                     Toast.makeText(getBaseContext(),"Pdf Created",Toast.LENGTH_LONG).show();

                    }else{
                        Toast.makeText(getBaseContext(),"Error creating PDF",Toast.LENGTH_LONG).show();
                    }

                }
            };

            MaterialDialog.Builder builder = new MaterialDialog.Builder(activity)
                    .title("Creating PDF")
                    .content("one moment ...")
                    .cancelable(false)
                    .progress(true, 0);
            MaterialDialog dialog = builder.build();

            AsynCreatePdf asynCreatePdf = new AsynCreatePdf(activity,callBackCreatePdf,dialog,tempUris,"1",("pdf"+(new Date()).getSeconds()));

            asynCreatePdf.execute();
        }
        Log.d(LOG_ACTIVITY, "onActivityResult");
    }
}

stack trace

 2020-02-15 23:39:33.867 26002-26002/? E/age.capturedoc: Unknown bits set in runtime_flags: 0x8000
 2020-02-15 23:39:40.077 26002-26002/com.stage.capturedocf E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.stage.capturedocf, PID: 26002
java.lang.NoSuchMethodError: No virtual method load(Ljava/lang/String;)Lcom/bumptech/glide/DrawableTypeRequest; in class Lcom/bumptech/glide/RequestManager; or its super classes (declaration of 'com.bumptech.glide.RequestManager' appears in /data/app/com.stage.capturedocf-28QyGuuKtvjoKJnPtBbn8Q==/base.apk)
    at com.gun0912.tedpicker.GalleryFragment$ImageGalleryAdapter.getView(GalleryFragment.java:176)
    at android.widget.AbsListView.obtainView(AbsListView.java:2405)
    at android.widget.GridView.onMeasure(GridView.java:1085)
    at android.view.View.measure(View.java:24530)
    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6828)
    at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
    at android.view.View.measure(View.java:24530)
    at androidx.viewpager.widget.ViewPager.onMeasure(ViewPager.java:1638)
    at android.view.View.measure(View.java:24530)
    at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:735)
    at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:481)
    at android.view.View.measure(View.java:24530)
    at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:735)
    at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:481)
    at android.view.View.measure(View.java:24530)
    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6828)
    at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
    at androidx.appcompat.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:143)
    at android.view.View.measure(View.java:24530)
    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6828)
    at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1552)
    at android.widget.LinearLayout.measureVertical(LinearLayout.java:842)
    at android.widget.LinearLayout.onMeasure(LinearLayout.java:721)
    at android.view.View.measure(View.java:24530)
    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6828)
    at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
    at android.view.View.measure(View.java:24530)
    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6828)
    at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1552)
    at android.widget.LinearLayout.measureVertical(LinearLayout.java:842)
    at android.widget.LinearLayout.onMeasure(LinearLayout.java:721)
    at android.view.View.measure(View.java:24530)
    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6828)
    at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
    at com.android.internal.policy.DecorView.onMeasure(DecorView.java:742)
    at android.view.View.measure(View.java:24530)
    at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:3006)
    at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1833)
    at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2122)
    at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1721)
    at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7598)
    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:966)
    at android.view.Choreographer.doCallbacks(Choreographer.java:790)
    at android.view.Choreographer.doFrame(Choreographer.java:725)
    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:951)
    at android.os.Handler.handleCallback(Handler.java:883)
    at android.os.Handler.dispatchMessage(Handler.java:100)
    at android.os.Looper.loop(Looper.java:214)
    at android.app.ActivityThread.main(ActivityThread.java:7356)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)

How to investigate Xamarin/libmonosgen-2.0.so native crash?

$
0
0

Pre-release report is looking all green, but new crash clusters were detected overnight. App Center has none of these crashes, they only show up in Google Play.

When I open the crash cluster detail page in play, useful details appear to be lacking. For example:

Cluster:*

signal 11 (SIGSEGV), code 2 (SEGV_ACCERR)

split_config.arm64_v8a.apk!libmonosgen-2.0.so (offset 0xe5a000)

*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
pid: 0, tid: 0 >>> com.dailybits.foodjournal <<<

backtrace:
  #00  pc 00000000001acbfc  /data/app/com.dailybits.foodjournal-DovhgL9dggFUj0Z5kittiw==/split_config.arm64_v8a.apk!libmonosgen-2.0.so (offset 0xe5a000)

Build optionsAndroid build optionsOriginal build options, same problem (both build options appear to result in the same problem)

Version info

Microsoft Visual Studio Professional 2019
Version 16.4.2
VisualStudio.16.Release/16.4.2+29613.14
Microsoft .NET Framework
Version 4.8.03752

Xamarin   16.4.000.307 (d16-4@e031886)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android SDK   10.1.1.0 (d16-4/f2c9364)
Xamarin.Android Reference Assemblies and MSBuild support.
    Mono: bef1e63
    Java.Interop: xamarin/java.interop/d16-4@c4e569f
    ProGuard: xamarin/proguard/master@905836d
    SQLite: xamarin/sqlite/3.28.0@46204c4
    Xamarin.Android Tools: xamarin/xamarin-android-tools/master@9f4ed4b

Question:

How do I configure the application, or what other options are available to get more useful information in my crash logs, or how do I figure out what to change to solve these crashes?

Thanks!

Edit 2/14/2020

I have released a version based on old-fashioned apk files, and the same crashes appear in the crash page, so I'm ruling out aab as the primary suspect. @Pierre 's comment pointed me in promising direction though; opening the SDK tools screens show that the SDK needs to be "repaired". I have un-installed and re-installed SDK 29, rebooted the computer, deleted bin and obj and am now re-building.

SDK Needs Repair

Funky SDK manager with 2x version 29

Based on How to approach crashes with libmonosgen-2.0.so? I've also reviewed all referenced packages, and target frameworks. There were a couple targeting monoandroid81 rather than 10.0 for some reason...

Edit: 2/15/2020

No joy, crashes in libmonosgen-2.0.so still keep coming...

*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
pid: 0, tid: 0 >>> com.dailybits.foodjournal <<<

backtrace:
  #00  pc 00000000001acbfc  /data/app/com.dailybits.foodjournal-ogXHhEoACs5PzXtD4qFdoQ==/lib/arm64/libmonosgen-2.0.so

*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
pid: 0, tid: 0 >>> com.dailybits.foodjournal <<<

backtrace:
  #00  pc 0000000000174f3c  /data/app/com.dailybits.foodjournal-1-oGWsyDWcBwwvurmkgZOw==/lib/arm/libmonosgen-2.0.so

enter image description here

How do I investigate, and fix this issue?

Application crash when calling method 'FirebaseApp.configure()' in a real device

$
0
0

Recently, I decided to run the application on a real device and received a crash application and, looking for the reason, I found that it appears after the FirebaseApp.configure() method.

The application does not crash when launched in the simulator.

Crash:

dyld`__abort_with_payload:
    0x101b0b2a4 <+0>:  mov    x16, #0x209
    0x101b0b2a8 <+4>:  svc    #0x80
->  0x101b0b2ac <+8>:  b.lo   0x101b0b2c8               ; <+36>
    0x101b0b2b0 <+12>: stp    x29, x30, [sp, #-0x10]!
    0x101b0b2b4 <+16>: mov    x29, sp
    0x101b0b2b8 <+20>: bl     0x101b097d8               ; cerror_nocancel
    0x101b0b2bc <+24>: mov    sp, x29
    0x101b0b2c0 <+28>: ldp    x29, x30, [sp], #0x10
    0x101b0b2c4 <+32>: ret    
    0x101b0b2c8 <+36>: ret    

AppDelegate:

import UIKit
import Firebase

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        FirebaseApp.configure()
        return true
    }

    // MARK: UISceneSession Lifecycle

    func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
        // Called when a new scene session is being created.
        // Use this method to select a configuration to create the new scene with.
        return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
    }

    func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
        // Called when the user discards a scene session.
        // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
        // Use this method to release any resources that were specific to the discarded scenes, as they will not return.
    }
}

What I tried:

  1. I updated the GoogleService-Info.plist file in the root directory
  2. I updated all libraries in pod file
  3. I tried to solve the problem by disabling the Address Sanitizer in scheme
  4. I tried to add .plist file via "Add Files to..."
  5. I tried to run the method like this:

But nothing helped.

Can deleting a program file lead to a computer crash? [closed]

$
0
0

I'm dealing with a conceptual challenge. I wonder if delete file of code when this code executing will cause to crash (define "crash" as a situation when exception caused and the Kernel doesn't know what to do so reboots caused).

For my interest, let's suppose there is a computer with a single CPU with M bytes of physical memory (DRAM). The only storage device that connects to this computer is a disc (D bytes size).

Important clarification: I don't care if the code file is of kernel code or process code.

I would love to see an example of how this could happen.

Back Space Causes Crash in Calculator

$
0
0

When ever I press the Back Space button when there is no input, the Android Calculator app Crashes. This code is written in Kotlin and the IDE is Android Studio and the BackSpace is labeled tvBack in MainActivity.kt in the Code below.

What should i do to Handle this crash?

 tvBack.setOnClickListener{
                    val string =tvResult.text.toString()
                    val string2=tvExpression.text.toString()
                    if(string.isEmpty()){
                        tvExpression.text = string2.substring(0,string2.length-1)

                    }else if(string2.isNotEmpty()){

                        tvResult.text=""
                    }
}

How can I cause Python 3.5 to crash?

$
0
0

We are using embedded cpython as a scripting language in our app. We are modifying our sys.path at startup to make sure that we don't execute code from outside our app, but a user with a sitecustomize.py in their PYTHONPATH is causing code to execute before we have a chance to fix sys.path, and we believe their code has a hard crash (not an exception, which site.py will catch and handle gracefully).

I believe the correct fix is to simply clear the PYTHONPATH variable from the environment before we initialize python, but I can't test it properly because I can't recreate the problem.

The simplest way I've found is using ctypes to write to memory, such as:

import ctypes
p = (ctypes.c_char).from_address(0)
while True:
  p[0] = 0
  p = p + 1

But in Python 3.5, it doesn't allow me to write to c_char types, giving the error "TypeError: 'c_char' object does not support item assignment".

I've tried a few of the methods available in https://wiki.python.org/moin/CrashingPython to no avail.

Is there a reliable way to crash python 3.5 from pure Python code?

Apache server keeps crashing, "caught SIGTERM, shutting down"

$
0
0

This just started happening three weeks or so ago. The content of my website hasn't changed, it's just a phpBB forum using MySQL as a backend.

Nothing has changed in well over a year but recently, every two days or so, the server just shuts down and cannot be accessed at all, I have to notify my service provider to physically restart the machine.

It seems to be tied to these SIGTERM errors I find in the logs. Problem is I have no idea how to fix these kinds of things or find the root cause as my skills in this area are lacking.

Anyone have any ideas what could be going on?

Apache/2.2.3 (CentOS)

20051115

Linux 2.6.18-028stab057.4 #1 SMP Fri Aug 1 10:47:59 MSD 2008 x86_64

From the error log: [Sun Nov 01 15:18:53 2009] [notice] caught SIGTERM, shutting down

Not entirely sure that's what's causing me my problems but it doesn't sound like a good thing.

I can post more log information if needed

[Sun Nov 01 05:07:17 2009] [notice] Digest: generating secret for digest authentication ...
[Sun Nov 01 05:07:17 2009] [notice] Digest: done
[Sun Nov 01 05:07:19 2009] [notice] mod_python: Creating 4 session mutexes based on 10 max processes and 0 max threads.
[Sun Nov 01 05:07:19 2009] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Sun Nov 01 05:07:19 2009] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Sun Nov 01 05:07:19 2009] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Sun Nov 01 05:07:19 2009] [warn] Init: SSL server IP/port conflict: default-64-6-237-192:443 (/etc/httpd/conf.d/zz010_psa_httpd.conf:83) vs. webmail:443 (/etc/httpd/conf.d/zz010_psa_httpd.conf:159)
[Sun Nov 01 05:07:19 2009] [warn] Init: You should not use name-based virtual hosts in conjunction with SSL!!
[Sun Nov 01 05:07:19 2009] [warn] WARNING: Attempt to change ServerLimit ignored during restart
[Sun Nov 01 05:07:19 2009] [notice] Apache/2.2.3 (CentOS) configured -- resuming normal operations
[Sun Nov 01 15:16:11 2009] [error] [client 127.0.0.1] Invalid method in request get
[Sun Nov 01 15:18:53 2009] [notice] caught SIGTERM, shutting down
[Sun Nov 01 15:19:27 2009] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Sun Nov 01 15:19:27 2009] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Sun Nov 01 15:19:27 2009] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Sun Nov 01 15:19:27 2009] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Sun Nov 01 15:19:27 2009] [warn] Init: SSL server IP/port conflict: default-64-6-237-192:443 (/etc/httpd/conf.d/zz010_psa_httpd.conf:83) vs. webmail:443 (/etc/httpd/conf.d/zz010_psa_httpd.conf:159)
[Sun Nov 01 15:19:27 2009] [warn] Init: You should not use name-based virtual hosts in conjunction with SSL!!
[Sun Nov 01 15:19:27 2009] [notice] Digest: generating secret for digest authentication ...
[Sun Nov 01 15:19:27 2009] [notice] Digest: done
[Sun Nov 01 15:19:27 2009] [notice] mod_python: Creating 4 session mutexes based on 10 max processes and 0 max threads.
[Sun Nov 01 15:19:27 2009] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Sun Nov 01 15:19:27 2009] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Sun Nov 01 15:19:27 2009] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Sun Nov 01 15:19:27 2009] [warn] Init: SSL server IP/port conflict: default-64-6-237-192:443 (/etc/httpd/conf.d/zz010_psa_httpd.conf:83) vs. webmail:443 (/etc/httpd/conf.d/zz010_psa_httpd.conf:159)
[Sun Nov 01 15:19:27 2009] [warn] Init: You should not use name-based virtual hosts in conjunction with SSL!!
[Sun Nov 01 15:19:27 2009] [notice] Apache/2.2.3 (CentOS) configured -- resuming normal operations
[Sun Nov 01 16:42:31 2009] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
[Sun Nov 01 16:47:25 2009] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
[Sun Nov 01 16:59:22 2009] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
[Sun Nov 01 17:37:42 2009] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
[Sun Nov 01 17:44:54 2009] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
[Sun Nov 01 17:44:55 2009] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
[Sun Nov 01 17:44:56 2009] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
[Sun Nov 01 18:14:45 2009] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
[Sun Nov 01 18:40:30 2009] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
[Sun Nov 01 20:10:59 2009] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
[Sun Nov 01 20:35:10 2009] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
[Sun Nov 01 20:43:07 2009] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
[Sun Nov 01 20:43:46 2009] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
[Sun Nov 01 21:25:39 2009] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
[Sun Nov 01 21:26:03 2009] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
[Sun Nov 01 21:56:57 2009] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
[Sun Nov 01 22:21:02 2009] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
[Sun Nov 01 22:25:16 2009] [error] server reached MaxClients setting, consider raising the MaxClients setting
[Sun Nov 01 22:25:17 2009] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
[Sun Nov 01 22:25:18 2009] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
[Sun Nov 01 22:25:20 2009] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
[Sun Nov 01 22:25:21 2009] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
[Sun Nov 01 22:25:22 2009] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
[Sun Nov 01 22:46:47 2009] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
[Sun Nov 01 22:52:56 2009] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
[Sun Nov 01 22:56:07 2009] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
[Sun Nov 01 22:56:51 2009] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
[Sun Nov 01 22:56:58 2009] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
[Sun Nov 01 23:00:41 2009] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
[Sun Nov 01 23:09:59 2009] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
[Sun Nov 01 23:23:49 2009] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
[Sun Nov 01 23:27:14 2009] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
[Sun Nov 01 23:36:25 2009] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
[Sun Nov 01 23:54:06 2009] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
[Mon Nov 02 00:12:44 2009] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
[Mon Nov 02 00:12:50 2009] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
[Mon Nov 02 00:13:23 2009] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
[Mon Nov 02 00:39:06 2009] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
[Mon Nov 02 00:52:50 2009] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
[Mon Nov 02 00:53:02 2009] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
[Mon Nov 02 01:13:38 2009] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
[Mon Nov 02 01:13:39 2009] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
[Mon Nov 02 01:13:40 2009] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
[Mon Nov 02 01:23:01 2009] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
[Mon Nov 02 01:43:47 2009] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
[Mon Nov 02 01:45:51 2009] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
[Mon Nov 02 01:46:27 2009] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
[Mon Nov 02 01:47:25 2009] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
[Mon Nov 02 02:23:02 2009] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
[Mon Nov 02 02:25:37 2009] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
[Mon Nov 02 02:25:38 2009] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
[Mon Nov 02 02:52:29 2009] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
[Mon Nov 02 02:52:51 2009] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
[Mon Nov 02 03:49:29 2009] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
[Mon Nov 02 03:49:48 2009] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
[Mon Nov 02 04:35:33 2009] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
[Mon Nov 02 04:46:01 2009] [error] [client 66.96.201.63] File does not exist: /var/www/vhosts/default/htdocs/README
[Mon Nov 02 04:46:01 2009] [error] [client 66.96.201.63] File does not exist: /var/www/vhosts/default/htdocs/horde
[Mon Nov 02 04:46:01 2009] [error] [client 66.96.201.63] File does not exist: /var/www/vhosts/default/htdocs/horde2
[Mon Nov 02 04:46:01 2009] [error] [client 66.96.201.63] File does not exist: /var/www/vhosts/default/htdocs/horde3
[Mon Nov 02 04:46:01 2009] [error] [client 66.96.201.63] File does not exist: /var/www/vhosts/default/htdocs/horde-3.0.9
[Mon Nov 02 04:46:01 2009] [error] [client 66.96.201.63] File does not exist: /var/www/vhosts/default/htdocs/Horde
[Mon Nov 02 04:46:02 2009] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
[Mon Nov 02 05:01:06 2009] [error] [client 58.246.73.74] File does not exist: /var/www/vhosts/default/htdocs/README
[Mon Nov 02 05:01:06 2009] [error] [client 58.246.73.74] File does not exist: /var/www/vhosts/default/htdocs/horde
[Mon Nov 02 05:01:07 2009] [error] [client 58.246.73.74] File does not exist: /var/www/vhosts/default/htdocs/horde2
[Mon Nov 02 05:01:08 2009] [error] [client 58.246.73.74] File does not exist: /var/www/vhosts/default/htdocs/horde3
[Mon Nov 02 05:01:08 2009] [error] [client 58.246.73.74] File does not exist: /var/www/vhosts/default/htdocs/horde-3.0.9
[Mon Nov 02 05:01:09 2009] [error] [client 58.246.73.74] File does not exist: /var/www/vhosts/default/htdocs/Horde
[Mon Nov 02 05:01:09 2009] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
[Mon Nov 02 05:01:10 2009] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
[Mon Nov 02 05:01:11 2009] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
[Mon Nov 02 09:17:58 2009] [notice] caught SIGTERM, shutting down
[Mon Nov 02 09:18:58 2009] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Mon Nov 02 09:18:58 2009] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Mon Nov 02 09:18:58 2009] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Mon Nov 02 09:18:58 2009] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Mon Nov 02 09:18:58 2009] [warn] Init: SSL server IP/port conflict: default-64-6-237-192:443 (/etc/httpd/conf.d/zz010_psa_httpd.conf:83) vs. webmail:443 (/etc/httpd/conf.d/zz010_psa_httpd.conf:159)
[Mon Nov 02 09:18:58 2009] [warn] Init: You should not use name-based virtual hosts in conjunction with SSL!!
[Mon Nov 02 09:18:58 2009] [notice] Digest: generating secret for digest authentication ...
[Mon Nov 02 09:18:58 2009] [notice] Digest: done
[Mon Nov 02 09:18:58 2009] [notice] mod_python: Creating 4 session mutexes based on 10 max processes and 0 max threads.
[Mon Nov 02 09:18:58 2009] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Mon Nov 02 09:18:58 2009] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Mon Nov 02 09:18:58 2009] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Mon Nov 02 09:18:58 2009] [warn] Init: SSL server IP/port conflict: default-64-6-237-192:443 (/etc/httpd/conf.d/zz010_psa_httpd.conf:83) vs. webmail:443 (/etc/httpd/conf.d/zz010_psa_httpd.conf:159)
[Mon Nov 02 09:18:58 2009] [warn] Init: You should not use name-based virtual hosts in conjunction with SSL!!
[Mon Nov 02 09:18:58 2009] [notice] Apache/2.2.3 (CentOS) configured -- resuming normal operations
[Mon Nov 02 09:32:34 2009] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/

Asp.net unhandled exception in timer callback crashes w3wp and error not logged

$
0
0

I am experiencing some randomly happening unhandled exception causing w3wp to crash. I want to trace the cause of that exception. I already have a global Application_Error handler override in my MvcApplication class, so the crash must be caused by some out-of-http-context exception. In order to replicate the problem I genereate one myself in a timer callback, and try to trace it. Simplified code like

public static class MonitorTimers
{
    public static Timer _taskMonitorTimer = new Timer(state: null, dueTime: 1000, period: 1000, callback: (state) =>
    {
        throw new Exception("Ouch! Me dead.");
    });     
}

In my local development environment (iisexpress launched by VS2017) and test environment (IIS 8.5), when the app starts and then crashes, the following can be seen in event viewer:

enter image description here

The most useful Event 1325 and 1026 sourced from ASP.NET and .NET Runtime shows the stack trace - just the thing I need.

My problem is, in my production machine (also IIS 8.5) I can't find the useful event 1325. Only a crash report, bearing no more information than I know. So I don't know what caused the error. I could surround my timer callback with try...catch block but the error could well be caused by something else (unmanaged libraries, error in static class initialization) then I still can't trace.

So suggestions on why event 1325 is missing or some tools that can show the log and analyse the stack trace is greatly appreciated. Thank you.

enter image description here

unrecognized selector sent to instance obj c

$
0
0

2020-02-17 23:12:31.949254+0100 LoyaltyCardsApp[64133:7104122] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[OTPViewController OTPPinInserted:pin:]: unrecognized selector sent to instance 0x7fd00a127730'

    @protocol OTPViewControllerDelegate
- (void) OTPAbortedByUser;
- (void) OTPPinInserted: (NSString *) pan pin: (NSString *) pin;


@end

@interface OTPViewController : UIViewController<KeyboardDelegate>

@property (nonatomic, strong) id delegate;

@property (nonatomic, weak) IBOutlet UIButton *confirmButton;
@property (weak, nonatomic) IBOutlet InputTextView *insertOTP;
@property (nonatomic, strong) NSString* stringInserted;
@property (weak, nonatomic) IBOutlet CopyableTextView *result;

@property (nonatomic, weak) IBOutlet NSLayoutConstraint *marginTop;

- (IBAction) clickOnDoneButton:(id)sender;
@end


- (void) pinInserted:(NSString *) pin{

    [self.delegate OTPPinInserted:self.insertOTP.input.text pin:pin];

the crash occurs here:

    [self.delegate OTPPinInserted:self.insertOTP.input.text pin:pin];

other thing, I can't understand why in debug I can't go inside the if ..

if (self.delegate && [self.delegate respondsToSelector:@selector(OTPPinInserted:pin:)]){
    [self.delegate OTPPinInserted:self.insertOTP.input.text pin:pin];
}

App has stopped when opening a different layout

$
0
0

I'm creating an app for scheduling, and when I choose a date and press select for moving to the other layout for creating a task for this date, the app stops.

This is my main code, which is working great:

package com.example.calendarview;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.CalendarView;
import android.widget.TextView;

public class CalendarActivity extends AppCompatActivity {

    CalendarView calendarView;
    TextView dateSelected;
    Button selectButton;
    Intent scheduleActivityIntent;
    String date;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_calendar);

        selectButton = (Button) findViewById(R.id.selectButton);
        selectButton.setOnClickListener(new CalendarView.OnClickListener(){

            public void onClick(View v) {
                System.out.println("Button Clicked");

                scheduleActivityIntent = new Intent(getApplicationContext(), ScheduleActivity.class);
                startActivity(scheduleActivityIntent);
            }
        });

        calendarView = (CalendarView) findViewById(R.id.calendarView);
        dateSelected = (TextView) findViewById(R.id.dateSelected);
        calendarView.setOnDateChangeListener(new CalendarView.OnDateChangeListener() {
            @Override
            public void onSelectedDayChange(@androidx.annotation.NonNull CalendarView view, int year, 
int month, int dayOfMonth) {
                date = dayOfMonth + "/" + (month+1) + "/" + year;
                dateSelected.setText(date);
            }
        });

     }
}

This is my second activity, where I'm using a ListView for showing the current tasks, which I'm pretty sure is fine -

package com.example.calendarview;

import android.os.Bundle;
import android.util.Log;
import android.widget.ListView;
import java.util.ArrayList;

public class ScheduleActivity extends CalendarActivity {

    private static final String TAG = "ScheduleActivity";

    ListView taskList;
    Task haircut;
    Task work;
    ArrayList<Task> taskListAdapter;
    ScheduleAdapter adapter;

    String aTaskName = "Haircut";
    String aTaskDate = "21/01/2020";
    String aTaskTime = "14:00";
    int aTaskTimeFinish = 1;
    int aTaskUrgency = 2;
    String aTaskDescription = "Go get a haircut";

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_schedule);

        Log.d(TAG, "onCreate: Started");
        taskList = (ListView) findViewById(R.id.schedule);

        // Need to create object insert
        haircut = new Task(aTaskName, aTaskDate, aTaskTime, aTaskTimeFinish, aTaskUrgency, aTaskDescription);
        //Should be made as a function in order to insert user's tasks

        //Creating Array adapter
        taskListAdapter = new ArrayList<>();
        taskListAdapter.add(haircut);

        adapter = new ScheduleAdapter(getApplicationContext(), R.layout.activity_schedule, taskListAdapter);

        taskList.setAdapter(adapter);
    }
}

And this is my adapter for the ListView, where I'm pretty sure is problematic, but I don't really get the problem and how to solve it-

package com.example.calendarview;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;
import androidx.annotation.NonNull;
import java.util.ArrayList;

public class ScheduleAdapter extends ArrayAdapter <Task>
{
    private static final String TAG = "ScheduleAdapter";
    Context mContext;

    Task task;
    View cView;
    TextView tvName;
    TextView tvTime;
    TextView tvUrgency;
    LayoutInflater inflater;

    //Default constructor for the adapter

    public ScheduleAdapter(@NonNull Context context, int mResource, @NonNull ArrayList<Task> tasks) {
        super(context,0,  tasks);
    }

    @android.support.annotation.NonNull
    @Override
    public View getView(int position, @Nullable View convertView, @android.support.annotation.NonNull ViewGroup parent) {

        cView = convertView;
        inflater = LayoutInflater.from(mContext);

        task = getItem(position);
        if(cView == null) {
            cView = LayoutInflater.from(getContext()).inflate(R.layout.schedule_items, parent, false);
        }

        tvName = cView.findViewById(R.id.task_name);
        tvTime = cView.findViewById(R.id.task_time);
        tvUrgency = cView.findViewById(R.id.task_urgency);

        tvName.setText(task.getTaskName());
        tvTime.setText(task.getTaskTime());
        tvUrgency.setText(task.getTaskUrgency());

        return cView;
    }
}

Task is a basic object;

    private String taskName;
    private String taskDate;
    private String taskTime;
    private int taskTimeFinish;
    private int taskUrgency;
    private String taskDescription;

And I get this errors-

E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.example.calendarview, PID: 7247
    java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object android.content.Context.getSystemService(java.lang.String)' on a null object reference
        at android.view.LayoutInflater.from(LayoutInflater.java:229)
        at com.example.calendarview.ScheduleAdapter.getView(ScheduleAdapter.java:35)
        at android.widget.AbsListView.obtainView(AbsListView.java:2372)
        at android.widget.ListView.makeAndAddView(ListView.java:2052)
        at android.widget.ListView.fillDown(ListView.java:786)
        at android.widget.ListView.fillFromTop(ListView.java:847)
        at android.widget.ListView.layoutChildren(ListView.java:1826)
        at android.widget.AbsListView.onLayout(AbsListView.java:2171)
        at android.view.View.layout(View.java:19590)
        at android.view.ViewGroup.layout(ViewGroup.java:6053)
        at android.support.constraint.ConstraintLayout.onLayout(ConstraintLayout.java:1915)
        at android.view.View.layout(View.java:19590)
        at android.view.ViewGroup.layout(ViewGroup.java:6053)
        at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
        at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
        at android.view.View.layout(View.java:19590)
        at android.view.ViewGroup.layout(ViewGroup.java:6053)
        at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1791)
        at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1635)
        at android.widget.LinearLayout.onLayout(LinearLayout.java:1544)
        at android.view.View.layout(View.java:19590)
        at android.view.ViewGroup.layout(ViewGroup.java:6053)
        at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
        at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
        at android.view.View.layout(View.java:19590)
        at android.view.ViewGroup.layout(ViewGroup.java:6053)
        at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1791)
        at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1635)
        at android.widget.LinearLayout.onLayout(LinearLayout.java:1544)
        at android.view.View.layout(View.java:19590)
        at android.view.ViewGroup.layout(ViewGroup.java:6053)
        at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
        at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
        at com.android.internal.policy.DecorView.onLayout(DecorView.java:758)
        at android.view.View.layout(View.java:19590)
        at android.view.ViewGroup.layout(ViewGroup.java:6053)
        at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2484)
        at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2200)
        at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1386)
        at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6733)
        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:911)
        at android.view.Choreographer.doCallbacks(Choreographer.java:723)
        at android.view.Choreographer.doFrame(Choreographer.java:658)
        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:897)
        at android.os.Handler.handleCallback(Handler.java:789)
        at android.os.Handler.dispatchMessage(Handler.java:98)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6541)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
Process 7247 terminated.

Native crash of RenderThread with signal 6 (SIGABRT)

$
0
0

Updates!

See below

Situation

We're having a difficult to diagnose issue with our app. When we attempt to use an intent to have the camera app return a picture, we receive a low-level crash situation that we are unsure how to debug. This is occurring on Nexus 5x devices on bother Android 6.0 and Android 7.0.

Here is the stack trace from the monitor:

10-17 11:59:41.208 9925-9925/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
10-17 11:59:41.208 9925-9925/? A/DEBUG: Build fingerprint: 'google/bullhead/bullhead:7.0/NBD90W/3239497:user/release-keys'
10-17 11:59:41.208 9925-9925/? A/DEBUG: Revision: 'rev_1.0'
10-17 11:59:41.208 9925-9925/? A/DEBUG: ABI: 'arm64'
10-17 11:59:41.208 9925-9925/? A/DEBUG: pid: 5791, tid: 6054, name: RenderThread  >>> com.ourapp <<<
10-17 11:59:41.209 9925-9925/? A/DEBUG: signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
10-17 11:59:41.230 9925-9925/? A/DEBUG: Abort message: 'Leaked 2 GPU objects!'
10-17 11:59:41.230 9925-9925/? A/DEBUG:     x0   0000000000000000  x1   00000000000017a6  x2   0000000000000006  x3   0000000000000008
10-17 11:59:41.230 9925-9925/? A/DEBUG:     x4   00006e6174736e69  x5   0000000000000000  x6   0000007629a9f000  x7   0000000000000000
10-17 11:59:41.230 9925-9925/? A/DEBUG:     x8   0000000000000083  x9   ffffffffffffffdf  x10  0000000000000000  x11  0000000000000001
10-17 11:59:41.230 9925-9925/? A/DEBUG:     x12  0000000000000018  x13  0000000000000000  x14  0000000000000000  x15  000850a8eb6af8af
10-17 11:59:41.231 9925-9925/? A/DEBUG:     x16  000000762948eed0  x17  0000007629438a2c  x18  0000000000000400  x19  00000076093b84f8
10-17 11:59:41.231 9925-9925/? A/DEBUG:     x20  0000000000000006  x21  00000076093b8450  x22  000000000000000b  x23  000000762933c040
10-17 11:59:41.231 9925-9925/? A/DEBUG:     x24  00000000ffffffff  x25  00000075f9d71490  x26  7fffffffffffffff  x27  00000075f2c54060
10-17 11:59:41.231 9925-9925/? A/DEBUG:     x28  0000007625c83238  x29  00000076093b7ae0  x30  0000007629435e58
10-17 11:59:41.231 9925-9925/? A/DEBUG:     sp   00000076093b7ac0  pc   0000007629438a34  pstate 0000000060000000
10-17 11:59:41.237 3715-9157/? E/mm-camera-sensor: port_sensor_handle_aec_update:443miss aec update window, skip
10-17 11:59:41.253 9925-9925/? A/DEBUG: backtrace:
10-17 11:59:41.254 9925-9925/? A/DEBUG:     #00 pc 000000000006ba34  /system/lib64/libc.so (tgkill+8)
10-17 11:59:41.254 9925-9925/? A/DEBUG:     #01 pc 0000000000068e54  /system/lib64/libc.so (pthread_kill+64)
10-17 11:59:41.254 9925-9925/? A/DEBUG:     #02 pc 0000000000023ed8  /system/lib64/libc.so (raise+24)
10-17 11:59:41.254 9925-9925/? A/DEBUG:     #03 pc 000000000001c790  /system/lib64/libc.so (abort+52)
10-17 11:59:41.254 9925-9925/? A/DEBUG:     #04 pc 00000000000107f4  /system/lib64/libcutils.so (__android_log_assert+224)
10-17 11:59:41.254 9925-9925/? A/DEBUG:     #05 pc 0000000000054cc0  /system/lib64/libhwui.so
10-17 11:59:41.254 9925-9925/? A/DEBUG:     #06 pc 00000000000350f8  /system/lib64/libhwui.so
10-17 11:59:41.254 9925-9925/? A/DEBUG:     #07 pc 00000000000328c8  /system/lib64/libhwui.so
10-17 11:59:41.254 9925-9925/? A/DEBUG:     #08 pc 0000000000037348  /system/lib64/libhwui.so
10-17 11:59:41.254 9925-9925/? A/DEBUG:     #09 pc 0000000000038434  /system/lib64/libhwui.so
10-17 11:59:41.254 9925-9925/? A/DEBUG:     #10 pc 0000000000039890  /system/lib64/libhwui.so (_ZN7android10uirenderer12renderthread12RenderThread10threadLoopEv+152)
10-17 11:59:41.254 9925-9925/? A/DEBUG:     #11 pc 0000000000012460  /system/lib64/libutils.so (_ZN7android6Thread11_threadLoopEPv+272)
10-17 11:59:41.254 9925-9925/? A/DEBUG:     #12 pc 000000000009bc4c  /system/lib64/libandroid_runtime.so (_ZN7android14AndroidRuntime15javaThreadShellEPv+116)
10-17 11:59:41.254 9925-9925/? A/DEBUG:     #13 pc 000000000006863c  /system/lib64/libc.so (_ZL15__pthread_startPv+208)
10-17 11:59:41.254 9925-9925/? A/DEBUG:     #14 pc 000000000001d9fc  /system/lib64/libc.so (__start_thread+16)

We can reliably trigger this when we use an intent to call up the camera app to retrieve a picture with the following code:

Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);

if (intent.resolveActivity(fragmentContext.getPackageManager()) == null) {
   return;
}

try {
   File photoFile = FileUtils.createImageFile(fragmentContext);

   data.addFileUpload(photoFile.getAbsolutePath());
   Uri photoUri = FileProvider.getUriForFile(fragmentContext, OurApplication.FILE_PROVIDER, photoFile);

   intent.putExtra(MediaStore.EXTRA_OUTPUT, photoUri);

   startActivityForResult(intent, REQUEST_TAKE_PHOTO);
} catch (IOException ignored) {
}

As shown, there isn't anything usual here.

Environment

We are able to trigger this on our test devices which are Nexus 5x. One device is Android 6 and the other is Android 7. They both produce similar stack traces (the one shown is from Android 7.0).

Triggering Context

It seems that we are able to trigger this event given either of the following two situations:

  1. The Google Maps is loaded in the activity that starts the camera
  2. A low memory situation (which we triggered with Chrome loaded with a tab or two of cnn.com)

What we've tried

We've tried to piece-wise remove functionality from the app until we could not longer trigger this crash but we've always been able to trigger it given a low memory situation.

Questions

  • Has anyone run in to this before and found a way to solve it?
  • Suggestions on how to further debug this issue?
  • Any links for hints?

Updates

2016/11/02 - There is an open bug report as noted in the comments. Different device/builds (Nexus 5x, 6P and Pixel with Android 6, 7.0 and 7.1) are reporting the same problem with various different types of situations as well. I'll continue to post updates with more information. The situation has been classified as a defect with priority of small. I would consider staring that bug and raising your concerns there.

2016/12/14 - I'm personally still having this issue even with the various security updates that have been applied. There isn't any more information other than other people reporting the same issues across various devices. Please check out the linked bug report, star and comment there. If I find anything that works, I'll post here!

2017/07/31 - For people that are still experiencing this issue, one user has attempted doing staged roll outs to their user base and removing various features to attempt to diagnose what the issue is. In their situation, by removing com.google.android.gms:play-services-maps:11.0.1, their situation has appeared to have been resolved. Unfortunately, maps are a core component of our applications; thus, this is not acceptable in our situation. In my opinion, this still appears to have to do with consumption of ram in various situations that causes the issue when resuming the activity.

2017/12/05 - No changes or real acknowledgement from Google. From what I've found, this issue appears to have been resolved in Android 8.0 and on some devices running various updates to Android 7.x

Java 6 Update 25 VM crash: insufficient memory

$
0
0

For an update of this question - see below.

I experience a (reproducible, at least for me) JVM crash (not an OutOfMemoryError) (The application which crashes is eclipse 3.6.2). However, looking at the crash log makes me wonder:

#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (malloc) failed to allocate 65544 bytes for Chunk::new
# Possible reasons:
#   The system is out of physical RAM or swap space
#   In 32-bit mode, the process size limit was hit
# Possible solutions:
#   Reduce memory load on the system
#   Increase physical memory or swap space
#   Check if swap backing store is full
#   Use 64 bit Java on a 64 bit OS
#   Decrease Java heap size (-Xmx/-Xms)
#   Decrease number of Java threads
#   Decrease Java thread stack sizes (-Xss)
#   Set larger code cache with -XX:ReservedCodeCacheSize=
# This output file may be truncated or incomplete.

Current thread (0x531d6000):  JavaThread "C2 CompilerThread1" daemon 
[_thread_in_native, id=7812, stack(0x53af0000,0x53bf0000)]

Stack: [0x53af0000,0x53bf0000],  sp=0x53bee860,  free space=1018k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [jvm.dll+0x1484aa]
V  [jvm.dll+0x1434fc]
V  [jvm.dll+0x5e6fc]
V  [jvm.dll+0x5e993]
V  [jvm.dll+0x27a571]
V  [jvm.dll+0x258672]
V  [jvm.dll+0x25ed93]
V  [jvm.dll+0x260072]
V  [jvm.dll+0x24e59a]
V  [jvm.dll+0x47edd]
V  [jvm.dll+0x48a6f]
V  [jvm.dll+0x12dcd4]
V  [jvm.dll+0x155a0c]
C  [MSVCR71.dll+0xb381]
C  [kernel32.dll+0xb729]

I am using Windows XP 32-bit SP3. I have 4GB RAM. Before starting the application I had 2 GB free according to the task manager (+ 1 GB system cache which might be freed as well.). I am definitely having enough free RAM.

From the start till the crash I logged the JVM memory statistics using visualvm and jconsole. I acquired the memory consumption statistics until the last moments before the crash.

The statistics shows the following allocated memory sizes:

  • HeapSize: 751 MB (used 248 MB)
  • Non-HeapSize(PermGen & CodeCache): 150 MB (used 95 MB)
  • Size of memory management areas (Edenspace, Old-gen etc.): 350 MB
  • Thread stack sizes: 17 MB (according to oracle and due the fact that 51 threads are running)

I am running the application (jre 6 update 25, server vm) using the parameters:

-XX:PermSize=128m
-XX:MaxPermSize=192m
-XX:ReservedCodeCacheSize=96m
-Xms500m
-Xmx1124m

Question:

  • Why does the JVM crash when there's obviously enough memory on the VM and OS?
    With the above settings I think that I cannot hit the 2GB 32-bit limit (1124MB+192MB+96MB+thread stacks < 2GB). In any other case (too much heap allocation), I would rather expect an OutOfMemoryError than a JVM crash

Who can help me to figure out what is going wrong here?

(Note: I upgraded recently to Eclipse 3.6.2 from Eclipse 3.4.2 and from Java 5 to Java 6. I suspect that there's a connection between the crashes and these changes because I haven't seen these before)

UPDATE

It seems to be a JVM bug introduced in Java 6 Update 25 and has something to do with the new jit compiler. See also this blog entry. According to the blog, the fix of this bug should be part of the next java 6 updates. In the meanwhile, I got a native stack trace during a crash. I've updated the above crash log.

The proposed workaround, using the VM argument -XX:-DoEscapeAnalysis works (at least it notably lowers the probability of a crash)

Viewing all 7128 articles
Browse latest View live