Giter Club home page Giter Club logo

Comments (8)

green-green-avk avatar green-green-avk commented on May 26, 2024

What to blame

What happened

ART / Dalvik (I have no idea of your Android device) VM crash.

How does it work

The libusb wrapper library accesses LibUsbManager to:

  1. Receive the device list (and keep connection open to receive plug/unplug notifications).
  2. Receive any particular USB device descriptor in order to obtain its meta data / interact with it.
  3. When done, the client process just closes the descriptor without any interaction with LibUsbManager.

Where it could crash

Taking into account that you has an output about at least one device:

  1. If you have more than one device, LibUsbManager could fail with opening subsequent devices.
  2. If you have only one device, LibUsbManager fail on notification connection close is rather unlikely... 🤔 Did you experience any not USB related terminal crashes?

What to do

adb to the rescue

For Android 7 and later

Start collecting log:

adb <device-selection-options> shell 'logcat --pid=$(pidof -s <package-name>) "*:E"'

where:

  • <device-selection-options> - just see the adb manual and adb --help (may be omitted if only one device is attached (try adb devices)).
  • <package-name> - see your Another Term About screen because different flavors are named differently.

and try to reproduce the issue during it.

For earlier versions

Please, say me what version you have.

PS

I'm just curious, what process keeps holding the device descriptor after the VM crash (also Android 7 and later only):

adb <device-selection-options> shell 'ps -fu $(dumpsys package <package-name> | sed -nre "s/.*userId=([0-9]+)/\\1/p")'

from anotherterm.

green-green-avk avatar green-green-avk commented on May 26, 2024

Another possible cause or "Hello, Android 10"

fdsan: attempted to close file descriptor <CENSORED>, expected to be unowned, actually owned by ParcelFileDescriptor <CENSORED>

I need one more day to recheck.

from anotherterm.

spoelstraethan avatar spoelstraethan commented on May 26, 2024

The crashes were happening on Android 13 on a Pixel 7a, so definitely could be some newer platform changes causing issues.

MkIIIv80 green_green_avk.anotherterm was the first version I tried. I just tried MkIV-dev47 redist from GitHub to see if that makes a difference, but it crashes on lsusb or lsusb -v as well.

I was able to use MkIV-dev47 oldgood on an Android 10 device (Cosmo Communicator) to interact with the same USB device without crashing, but one of the functions of the management software wasn't working, possibly because the USB interface wasn't showing all the details it expected (the lsbusb output in the Debian bookworm PRoot under AnotherTerm is slightly different than on a native Linux system).

I can open a new issue for that so we can dig in a bit more without polluting this crash beyond "it mostly worked on Android 10".

from anotherterm.

green-green-avk avatar green-green-avk commented on May 26, 2024

Yes, please open a new one.

The fix for this one is almost there: green-green-avk/LibUsbManager@7a1c4f2

from anotherterm.

green-green-avk avatar green-green-avk commented on May 26, 2024

In review on Google Play now...

from anotherterm.

green-green-avk avatar green-green-avk commented on May 26, 2024

The fixed version should be available on Google Play now.

Please, check.

from anotherterm.

spoelstraethan avatar spoelstraethan commented on May 26, 2024

I tested the version from GitHub and it is working, I'll go check the Play Store one shortly but I'm pretty confident it should work as well as long as the Android 10 plugin is also installed.

from anotherterm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.