-
Notifications
You must be signed in to change notification settings - Fork 142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Numba error: resolveAArch64Relocation: assertion "static_cast<int64_t>(Result) >= INT32_MIN && static_cast<int64_t>(Result) <= UINT32_MAX" failed #527
Comments
Does the problem also happen on the emulator? Can you share an example of a WAV file which reproduces the problem? And does this happen with all WAV files, or only some? Can you add some |
If this is still a problem, please provide the requested information and I'll reopen the issue. |
same issue on samsung a12 when trying to import (Only import) Also problem not occured on Pixed 5 emulator device. version: Code of py file
Kotlin code
|
will my info is enough? |
@DellyMore: Thanks for the information, but I still can't reproduce the problem. With Chaquopy 12.0.1, and the following
... I can import librosa on both a Nexus 5X and a Pixel 7, with no problems apart from the expected warning about "platform lacks a functioning sem_open implementation". Can you try your app on some other devices, and let me know which ones show this problem and which ones don't? |
Originally posted by @technophile-exe in #760 (comment) Chaquopy version
Python version
Devices or emulators where the issue
Relevant parts of your codePython script
Java code
Describe your issueI'm trying to use the python Logcat output
|
Originally posted by @technophile-exe in #760 (comment) Hey @mhsmith I modified the code a bit and am now running it on a separate thread (previously I was running it on the main thread). I tried it on an emulator and I did not face the above issue but the issue persists for my device although it seems to be appearing randomly and many times it gets executed with any problem.
Modified code private void reduceNoise(){
try {
String input_path = getFilename("");
Log.d("File path",input_path);
PyObject wavFile = py.getModule("scipy.io.wavfile");
PyObject noiseReduce = py.getModule("noisereduce");
Set<String> st = wavFile.keySet();
List<PyObject> res = wavFile.callAttr("read",input_path).asList();
PyObject rate = res.get(0);
PyObject data = res.get(1);
Log.d("Wav read","Read data");
PyObject reducedNoise = noiseReduce.callAttr("reduce_noise",new Kwarg("y",data),new Kwarg("sr",rate));
PyObject out_path = PyObject.fromJava(getFilename("reduced"));
wavFile.callAttr("write",out_path,rate,reducedNoise);
Log.d("write complete","reduced noise file saved");
} catch (Exception e) {
e.printStackTrace();
}
} |
@technophile-exe: If I simply list
And the following crash during import:
So I assume you must have added some additional requirements, such as |
I created
And added fish.wav from here to the same directory. Then, using the pkgtest app with Chaquopy 13.0.0, and the additional requirement @technophile-exe: Can you try your app on some other devices, and let me know which ones show this problem and which ones don't? |
Yes. Also i will paste my full defaultconfig for app
|
Originally posted by @HughHMLee in #21 (comment) Hi, I'm trying to use librosa in my Android application targeting Android 11 (API 30). The app is able to run smoothly on Android 12 (API 31) and later, but crashes on Android 11 (API 30) and before. The crash occurs when importing librosa:
I am warned that multiprocessing does not work, regardless of whether or not the app crashes. The app does not crash when independently importing numba or llvmlite. If the app does not initially crash when importing librosa, it is able to run librosa functions smoothly. Details of the environment:
Scenarios:
These scenarios occur both on the incomplete project I was given, as well as a new bare-bone project I created to test the issue. Help and support would be greatly appreciated. I have attached relevant files from the bare-bone project below (note that they are largely unmodified stock files). build.gradle:
MainActivity.java:
foo.py:
|
@HughHMLee: Thanks for the information, and sorry for the slow reply. Are your Windows and macOS machines x86-64 or ARM64? Do your emulator system images match the architecture of the machine they're running on? If you haven't already, please try reproducing the error on an x86-64 system image, and see if the error is exactly the same. |
i find out it work only in armv7 and python 3.8(python 2.7 must be invalid), right? |
As you can see from the repository, we currently only have Numba builds for Python 3.8, but we do support all 4 Android ABIs. If you're having problems, are you getting the same error message as in the title of this issue? If so, please answer the questions above. If not, please create a separate issue with full details. [EDIT: I've already created a separate issue for the comment you posted elsewhere: #1154] |
Chaquopy version16.0.0 Devices or emulators where the issue happensNothing Phone(1), SDK 35 (Android 15) Relevant parts of your codebuild.gradle
kotlin code:
python code:
I also have another similar python script, the call from android is similar to the one above:
"Especially any parts mentioned in the stack trace below" -> I have no idea where this happens exactly based on the stack trace below, if I had to guess I'd say it has something to do with Describe your issuethis thread crashes with this stack trace
I cannot replicate this issue, this is what Play Console shows me, and so far no user has reached me to explain how this crash happened. |
Thanks for the report. Unfortunately I don't have any solution at the moment, but please subscribe to #834 to be notified when we update Numba. |
No worries, thank you for your amazing work UPDATE: I found a solution for my case since in some instances I was able to import and use librosa without any problems: To address this, I used a separate service running on a different process from the main activity to run Chaquopy and extract the data I need. In this way we avoid dealing with multiple threads, making crashes less likely and less catastrophic since they would occur in a different process and not in the main one. I've done some tests and it seems to be working for now |
Chaquopy version
classpath "com.chaquo.python:gradle:9.1.0"
Devices or emulators where the issue happens
HTC Mobile Phones and samsung tablet
Relevant parts of your code
Android code:
Python code
Describe your issue
I want to call a function mfcc whitch is in my python code "mfcc.py"
but when I use PyObject obj1 = py.getModule("mfcc").callAttr("mfcc", path);
the app in my phone will quit unexpectedly.
I don't know how to fix it.
error message:
The text was updated successfully, but these errors were encountered: