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 / hang when opening a big file without newline #73

Open
7 tasks done
Explorer09 opened this issue Oct 2, 2024 · 3 comments
Open
7 tasks done

Crash / hang when opening a big file without newline #73

Explorer09 opened this issue Oct 2, 2024 · 3 comments
Labels
ASAP Issue needs to be fixed as soon as possible. bug Something is not working

Comments

@Explorer09
Copy link

Explorer09 commented Oct 2, 2024

Checklist

  • I can reproduce the bug with the latest version given here.
  • I made sure that there are no existing issues - open or closed - to which I could contribute my information.
  • I made sure that there are no existing discussions - open or closed - to which I could contribute my information.
  • I have read the FAQs inside the app (Menu -> About -> FAQs) and my problem isn't listed.
  • I have taken the time to fill in all the required details. I understand that the bug report will be dismissed otherwise.
  • This issue contains only one bug.
  • I have read and understood the contribution guidelines.

Affected app version

1.1.0

Affected Android/Custom ROM version

Android 10

Affected device model

Samsung Galaxy Note 9

How did you install the app?

F-Droid / IzzyOnDroid

Steps to reproduce the bug

  1. Find a big file without newline to open...

The file I found that triggered the crash is the .json file produced by the "Export Notes" function of SimpleMobileTools Notes. (Yes, I tried opening it as a note rather than importing it into Fossify Notes.) The file was about 430000 bytes, without a single newline. Unfortunately for privacy reasons I cannot provide that file.

If you have Termux, you can generate such a file with a very long line, enough to reproduce a crash or hang:

for ((i=1; i<=4000; i++)); do printf '%100d' $((i * 100)); done | sed 's/ /-/g' >very-long-line.txt
for ((i=1; i<=4000; i++)); do printf '%99d\n' $((i * 100 - 1)); done | sed 's/ /-/g' >line-wrapped.txt
  1. In Fossify Notes, bring up the menu (the ellipsis icon in the upper right corner of the screen) → "Open file" function.
  2. Select and open the "very-long-line.txt" just generated within Termux.
  3. Select "Update the file itself at updating the note". (If you don't do this, you will be very difficult to escape the crash once reproduced.)
  4. "New note type: Text Note", then tap "OK".
  5. You should experience things slowing down by now.

Expected behavior

No crash at least. I can tolerate Fossify Notes not showing the whole line or not allowing to edit the file, but there should be no crash.

Actual behavior

Fossify Notes slows down significantly. After trying to bring up "Settings" or "About" from the menu, the app crashes.

Note that if you opened the "line-wrapped.txt" file instead of "very-long-line.txt", there would be no significant slowdown.

(Since Fossify Notes keeps the opened file when the app restarts, you might experience repeated hangs or crashes. To escape from that, delete the "very-long-line.txt" from within Termux.)

Screenshots/Screen recordings

No response

Additional information

No response

@Explorer09 Explorer09 added bug Something is not working needs triage Issue is not yet ready for PR authors to take up labels Oct 2, 2024
@Aga-C Aga-C removed the needs triage Issue is not yet ready for PR authors to take up label Oct 2, 2024
@Aga-C
Copy link
Member

Aga-C commented Nov 20, 2024

Actually, the file doesn't need to have no lines. Large multiline files (I've tested a 390 kB file with many lines on Android 14) also crash the app, especially if you already have some notes in the app.

@Aga-C Aga-C added the ASAP Issue needs to be fixed as soon as possible. label Nov 20, 2024
@naveensingh
Copy link
Member

@Aga-C does it throw TransactionTooLargeException?

@Aga-C
Copy link
Member

Aga-C commented Nov 20, 2024

@naveensingh I can't tell. My phone reports an exception in LogCat as java.lang.Throwable, and then there's a timeout on Fossify Notes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ASAP Issue needs to be fixed as soon as possible. bug Something is not working
Projects
None yet
Development

No branches or pull requests

3 participants