Skip to content
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

crash caused by backslash #5638

Closed
HairyPhil opened this issue Nov 24, 2019 · 6 comments
Closed

crash caused by backslash #5638

HairyPhil opened this issue Nov 24, 2019 · 6 comments
Labels
Bug Help Wanted Requesting Pull Requests from volunteers Needs Triage Priority-High

Comments

@HairyPhil
Copy link

Reproduction Steps
  1. Enter the following 6 characters of text in any card field: \
  2. Save the card. Anki crashes.
  3. Reopen Anki.
  4. Open the card browser. Anki crashes again, as soon as it attempts to display the card text.
Expected Result

Anki should display the literal text in the card browser, and a backslash symbol when reviewing the card.

Actual Result

Anki crashes every time it reads the card info. This makes it impossible to edit the card to fix the problem. To remove the corrupt card, the current database has to be overwritten with a backup.

I didn't try other backslash codes (https://www.toptal.com/designers/htmlarrows/punctuation/backslash/), but they may produce the same effect.

Debug info

AnkiDroid version 2.9.1 on Android 10 on Pixel 3.

Research

[ x ] I have read the support page and am reporting a bug or enhancement request specific to AnkiDroid

[ x ] I have checked the manual and the FAQ and could not find a solution to my issue

[ x ] I have searched for similar existing issues here and on the user forum

@mikehardy
Copy link
Member

Well that's not expected! Nice catch and thanks for reporting it. I do not think this will affect your issue in any way, but in prep for a fix you might join the alpha group both to verify it is still reproducible from most current code, and to have access to the next future build that would fix it https://docs.ankidroid.org/manual.html#betaTesting

@mikehardy mikehardy added Bug Help Wanted Requesting Pull Requests from volunteers Needs Triage Priority-High labels Nov 24, 2019
@imchenmin
Copy link

imchenmin commented Dec 23, 2019

Other backslash symbo start with '&' also show this question. \,\\

@imchenmin
Copy link

Other backslash symbol also show this question.
&bsol,\&#92
How about simply add code below to com.ichi2.libanki.Utils.java:entsToTxt()?

        html = html.replace("\", "\\");
        html = html.replace("\", "\\");
        html = html.replace("\", "\\");

@mikehardy
Copy link
Member

@chenminken that might very well be the solution - and thanks for testing out other combos so any future fix is more thorough. If you could make a PR here with that fix it would help us a lot in getting it done - we're pretty lean on developer power right now, and especially with the holidays

we have a guide that steps through how to get development going for AnkiDroid and I can help shepherd the PR through https://github.com/ankidroid/Anki-Android/wiki/Development-Guide

I won't have time to get to it personally (even though yes, it is small) for a couple weeks at minimum because of guests over the holidays

@pablode
Copy link
Contributor

pablode commented Dec 23, 2019

I've looked into this issue and fixed it in PR #5670.

@mikehardy
Copy link
Member

@pablode champion! I'll look at that and try to get it to release quickly

Apochens added a commit to Apochens/Anki-Android that referenced this issue Sep 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Help Wanted Requesting Pull Requests from volunteers Needs Triage Priority-High
Projects
None yet
Development

No branches or pull requests

4 participants