afonsotrepa / PocketGopher

Gopher browser for android written in java
The Unlicense
47 stars 9 forks source link

Large text files cause crash #14

Open softgenix opened 5 years ago

softgenix commented 5 years ago

When a gopher returns a large amount of text, I see message, "PocketGopher has stopped."

This happens from time to time on news aggregator holes, and when searching an encyclopedia. I have visited the same gopher holes with Burrow addon for Chrome on Windows (works ok), and from that I have been able to estimate that about 30k of text that will cause a crash.

jnlon commented 5 years ago

Hi, do you mind posting specific url(s) you find crashes on? I am not a maintainer but I am investigating crashes on my own fork with plans to PR fixes in the future. Thanks!

softgenix commented 5 years ago

Go to gopher://magical.fish/1/cia-world-factbook

In the search box enter, Canada

The length of the returned text file will cause a crash.

Try the search again, this time for Antarctica

This shorter article does not cause a crash.

From: jnlon notifications@github.com Sent: Saturday, August 24, 2019 5:45 PM To: afonsotrepa/PocketGopher PocketGopher@noreply.github.com Cc: SoftGenix Project dsleno@gmail.com; Author author@noreply.github.com Subject: Re: [afonsotrepa/PocketGopher] Large text files cause crash (#14)

Hi, do you mind posting specific url(s) you find crashes on? I am not a maintainer but I am investigating crashes on my own fork with plans to PR fixes in the future. Thanks!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/afonsotrepa/PocketGopher/issues/14?email_source=notifications&email_token=AB63QT5FDYZ5GSIQ2XFBPMDQGG2YHA5CNFSM4IO277R2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5CIYGA#issuecomment-524586008 , or mute the thread https://github.com/notifications/unsubscribe-auth/AB63QT3IH642PIWRGJXYML3QGG2YHANCNFSM4IO277RQ . https://github.com/notifications/beacon/AB63QT3JW5PCAHZGUG2VTT3QGG2YHA5CNFSM4IO277R2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5CIYGA.gif

jnlon commented 5 years ago

Thanks for the links! I looked into the crash and found 2 bugs involved, one in PocketGopher and one on the page itself. It turns out a bad menu entry on line 151 of the Canada page is missing the type character (it's just a space where it should be 'i'). Currently PocketGopher doesn't handle malformed menu entries correctly so it crashes when parsing that line.

Luckily one of the PR's I submitted recently fixes this. On my fork the page doesn't crash but shows an "Unknown" icon beside the problematic line. Hopefully there will be a new release with this fix merged soon. Cheers!