-
-
Notifications
You must be signed in to change notification settings - Fork 207
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
ax::backend::CommandBufferGL::drawArrays 中的glDrawArrays崩溃BUG #2240
Comments
@cxcxiaochuan Edited your post to add the code tags to format the logs so that they are easier to read. Please do not forget to add the tags when you post code or logs. |
void CommandBufferGL::drawArrays(PrimitiveType primitiveType, std::size_t start, std::size_t count, bool wireframe) |
It's clear from the logs that the crash is happening when that method is called, but that doesn't necessarily mean it is the cause of the crash. It is most likely something else that is causing this crash, and perhaps even the crashes in the other issues you posted today. If you have a test project that reproduces the issue, then please post it. |
I can't reproduce this error now, but I have collected a lot of this error through the Google Store. We are also analyzing the source code, but have not solved this problem. |
Please check issue #1211 It seems similar, so check if anything in there helps. |
Is there any way to prevent glDrawArrays from crashing when there is an error? For example, can I use try *** catch *** to catch the error, catch the exception and handle it, so as to avoid the program crashing? |
No. It doesn't throw an exception, so try/catch won't work. You need to find the source of the error.
In
to
See if this change helps to reproduce the crash. Also, please test it by putting the app into the background, load up other apps, then bring it back to the foreground etc.. |
We found that frequent calls to the onEditorAction function in the TextInputWrapper.java function may cause CommandBufferGL::drawElements to crash when calling glDrawElements. Our tests found that the following code will call the loop exponentially. The more text is entered, the more calls will be made as long as the number of changes is made. Frequent calls may cause program problems.
It is recommended to change for (int i = this.mOriginText.length(); i > 0; i--) { |
@cxcxiaochuan Could you please show how you are using the More specifically, have you implemented
I wasn't aware of the call to If the functionality is changed to what you are suggesting, then it would not be possible to trigger an effect on each character. One thing I did notice is that if the "Select All" functionality of the virtual keyboard is used, and then the delete button is pressed on it, the This will not stop the problem of someone tapping the backspace button very quickly to delete the content, and I'm not actually sure if anything can be done about that specific scenario. |
Below is the code for our application using text input. Our application does not override the onTextFieldDeleteBackward method.
|
@cxcxiaochuan Is the crash happening when tapping backspace manually, deleting one character at a time, or when using select-all text and then backspace (which deletes all text)? |
We tested and there were two crashes. The input text was too much, and repeated addition and deletion of characters triggered the crash. One time, the Khmer language was selected. In addition, we also found that the character content displayed in the Khmer TTF text was incorrect. The Khmer TTF text content was displayed very strangely, and the character pattern displayed by the program did not match the original text pattern of the input TTF. |
Thanks for the clarification.
That is unrelated to the current issue, and if you are certain that it may be a problem in Axmol, then it is best to log a separate issue for this. |
We are also confused and don't know how to fix this problem. According to logical reasoning, it is obviously unreasonable that adding or deleting a character will call the deleteBackward function exponentially. It is very annoying to copy a page of text content at one time and then add or change the text content. In this way, deleteBackward will be called a large number of times for each change, which will also cause the program to freeze for a short time, because the call of JNI function consumes a lot of performance and will cause the interface to freeze. |
ok |
Here are two BUG examples collected by our program through the Google Store. These two programs crashed after calling org.axmol.lib.AxmolRenderer.nativeDeleteBackward. I don’t know if it can help you analyze the problem. `` 崩溃版本:axmol-2.1.2 `` |
When you state "copy a page of text content", do you mean that the user is not just typing one character at a time, but copying and pasting large amounts of text into a text field? If that is the case, then on average, how much text would be copied into the text field? |
What I mean is that users can copy a lot of text content, paste it into the text box, and then modify it. The amount of content copied depends on the user, and we can't measure it. Whether the user enters characters one by one depends on the user's needs, and we can't judge it. But for example, when entering special characters such as emoji, sometimes it is difficult to input on the phone, so copying the special characters on the web page and using them is also a way. |
I understand. Now, we need to clarify the cases that cause the crash, so please indicate which of the following scenarios is causing a crash for you: 1 - Typing one character at a time Cases 1 and 2 should not cause any crashes at all, but there is a possibility that case 4 would. I'm not sure about case 3. |
We can't judge it either. We don't have such detailed records of the problem points. Sorry, we can't give detailed suggestions. |
I'm going to submit a PR with a possible solution to case 3, so selecting a large amount of text, then deleting it, will no longer cause multiple calls to |
Thanks for the optimization. Hope this fixes the problem. |
Please try the changes in #2248 to see if it fixes the issue |
@cxcxiaochuan Does #2248 solve the problem for you? |
崩溃版本:axmol-2.1.2
崩溃堆栈A:
崩溃手机:Infinix Infinix-X6515 (Infinix SMART 7)
崩溃系统:Android 12 (SDK 31)
崩溃堆栈:
崩溃堆栈B:
崩溃手机:OPPO OP4F97 (CPH2269)
崩溃系统:Android 11 (SDK 30)
崩溃堆栈:
崩溃堆栈C:
崩溃手机:OPPO OP56F5 (A17k)
崩溃系统:Android 12 (SDK 31)
崩溃堆栈:
崩溃堆栈D:
崩溃手机:Itel itel-A667L (itel A50)
崩溃系统:Android 14 (SDK 34)
崩溃堆栈:
崩溃堆栈E:
崩溃手机:samsung a10s (Galaxy A10s)
崩溃系统:Android 11 (SDK 30)
崩溃堆栈:
崩溃堆栈F:
崩溃手机:OPPO OP56F5 (A17k)
崩溃系统:Android 12 (SDK 31)
崩溃堆栈:
崩溃版本:axmol-2.1.2
崩溃手机:OPPO OP56F5 (A17k)
崩溃系统:Android 12 (SDK 31)
崩溃堆栈:
The text was updated successfully, but these errors were encountered: