rkd77 / elinks

Fork of elinks
Other
335 stars 35 forks source link

old issue. browser slowing down then locking up #277

Open johngalt01 opened 9 months ago

johngalt01 commented 9 months ago

this is kind of an old issue.

about 3 weeks ago i found out about ELINKS and was using version 0.13 from years ago.

the issue over my terminal at 9600Baud i would visit a few websites then the browser would start to slow down the menus would get less responsive and the webpage would start to lag and sometimes stop dead. it was not my terminal nor my wifi modem i'm using. elinks would spawn multiple sessions i could see from a separate VNC session i would try to kill jobs manually and everything would be unresponsive so i would kill the telnet session and then log back in.

newer versions 0.14, then 0.16 and 0.17 are much better i noticed it if i cleared the cache and killed any extra session via the menu F9 under file that it would kind of keep the issue from occurring too often.

i never experienced this over a fast direct connection only when on my terminal at 9600 baud.

i also needed to use 'alias elinks="elinks -no-connect -touch-files 1"' because those settings seemed to help the slowing down and locking up which happened every few minutes in 0.13

any thoughts on what i should do, or this is a known issue with this browser.

i am constantly using an external python script when opening image files.

thanks again for continuing to develop this browser.

rkd77 commented 9 months ago

It is a guess. ELinks does not keep up redrawing screen. You can minimize screen refreshes. For example disabling leds, status bar, title bar and avoid dialogs.

rkd77 commented 9 months ago

Could you describe how do you run this Python script, how it is "connected" with ELinks, and what this script does?

johngalt01 commented 9 months ago

It is on my git hub:

https://github.com/johngalt01/johngalt01.github.io https://github.com/johngalt01/johngalt01.github.io/blob/main/JPGTOFABGL.py

elinks conf:

set mime.extension.jpg="image/jpeg" set mime.extension.jpeg="image/jpeg" set mime.extension.png="image/png" set mime.extension.gif="image/gif" set mime.extension.bmp="image/bmp" set mime.extension.vt="image/vt"

set mime.handler.image_viewer.unix.ask = 0
set mime.handler.image_viewer.unix-xwin.ask = 0

set mime.handler.image_viewer.unix.block = 0
set mime.handler.image_viewer.unix-xwin.block = 0

set mime.handler.image_viewer.unix.program = "python jpgtofabgl % A N 0 0 100"
set mime.handler.image_viewer.unix-xwin.program = "python jpgtofabgl % A N 0 0 100"

set mime.handler.text_viewer.unix.ask = 0
set mime.handler.text_viewer.unix-xwin.ask = 0

set mime.handler.text_viewer.unix.block = 0
set mime.handler.text_viewer.unix-xwin.block = 0

set mime.handler.text_viewer.unix.program = "cat %"
set mime.handler.text_viewer.unix-xwin.program = "cat %"

set mime.type.image.jpg = "image_viewer"
set mime.type.image.jpeg = "image_viewer"
set mime.type.image.png = "image_viewer"
set mime.type.image.gif = "image_viewer"
set mime.type.image.bmp = "text_viewer"
set mime.type.image.vt = "text_viewer"
#set mime.type.application.vt="text_viewer"

a quick run down....

I'm creating content for vintage computers that use a terminal.

I'm using the FABGL VGA32 ANSI Terminal which is a emulated terminal with graphics capabilities.

I started out using CAT % i had specially made escape codes that would create a picture. example: https://github.com/johngalt01/johngalt01.github.io/blob/main/cat.bmp

I used the BMP file type because the Elinks 0.13 was having problems understanding what a VT file was and i gave up trying to make it work that way.

so originally the browser would see a BMP file hosted on my test website open the file and CAT % the file displaying the picture on the screen.

i then decided to take it further. i just learned Python and figured out how to pipe JPG files using my script above to turn an image into a FABGL escape code. i added dithering as well to match the 64 colors the terminal allows.

now i can go to any website with my terminal and view images on my Altair 8800.

the script is very customizable through elinks you can just give it arguments on the command line and set where you want the photo how big to make it, transparent or not. and there is a mode where you can tell the script to display 4 images with user intervention. the user intervention where you keypress elinks had the most issues with, it would work but sometimes locked up the browser. so manual and automatic work the best so far.

now when elinks sees a gif or a jpg it runs my script and i kept BMP to pipe in Ansi escape codes. like this. http://artscene.textfiles.com/vt100/

thumbnail_DSCN5994 (1)

DSCN5986

example of semi automatic mode. DSCN5983

the script can be adapted to other terminals that have similar capabilities including Tektronix.

rkd77 commented 9 months ago

% need to be replaced by %f since 0.15. You can also check with block=1.

set mime.handler.image_viewer.unix.program = "python jpgtofabgl %f A N 0 0 100"
set mime.handler.image_viewer.unix-xwin.program = "python jpgtofabgl %f A N 0 0 100"
johngalt01 commented 9 months ago

thank you making the changes.

I have block=0 to keep things more automated. i also updated the cat area to %f

johngalt01 commented 9 months ago

this is kind of interesting every 4th time i run my script the elinks browser grinds to a halt and i have to reset and log back in the last time this happened the COLUMNS setting in bash got stuck at 5 and refused to reset.

i did try putting % back in instead of %f just to confirm the same thing happening.

i've been playing with different things, so far nothing to report same issue.

johngalt01 commented 9 months ago

seem to have been luck with a smaller cache setting currently at 1M might try 0 to see what happens.

johngalt01 commented 9 months ago

setting the cache to zero seems to be working much better in my case.

johngalt01 commented 9 months ago

kept crashing, i cleared the cache and killed connections then it just crashed out.. .played with it for the few hours but kept having repeated lockup. now it would also lock up after a while just going to random websites. it would start to randomly lag then it would lock up and i would have to reset my connection and restart elinks. i messed around with a bunch of configuration settings nothing did anything productive.

rkd77 commented 9 months ago

Is this computer connected via wi-fi or cable to the net? Maybe elinks is not guilty here.

johngalt01 commented 9 months ago

its connected over wifi.

if i quit elinks and restart in the same telnet session then i can run my script again about 4 times.

now when elinks builds a list of the files i have already downloaded then i can keep viewing those. its only when i add more then 4 files that it locks up.

if my telnet session kept locking up then i would blame the wifi modem. but i think its something that has existed before elinks.

The links,links2, and elinks 0.13 browser all exhibit the same weirdness. in links or links2 if i keep going through new websites eventually it locks up as well. seems like a core memory leak somewhere in the original code base.

where i can tell a difference when i click on a new file i never viewed before 2 dialog boxes pop up one after the other. it shows a download box and percent then it goes to launch my script. if i have viewed a file before then only 1 diaglog box pops up and my script launches.

its the first when 2 dialog boxes pop up that causes the lock up at the 3rd or 4th file. if i stop on the 3rd quit and restart elinks then i can continue. this is why i playing around with the cache settings and playing around with any download options. i was also playing with flushing the cache, but that made it worse because it flushes the list of files i have already downloaded and causes 2 dialog boxes to pop up.

If i also go to bunch of different websites quickly that i have never been to after a few websites it also locks up.

is there a log i can turn on and view after the program locks up that might help?

its interesting.

rkd77 commented 9 months ago

It seems to me that in case of background viewers (block = 0) races occur. ELinks and viewer, both compete for stdin. It is not fixable IMO and results are unpredictable.

In contrib/proxy/README there is some information how to try to get reproducible "crashes", but it requires recompiling elinks and some configuration.

johngalt01 commented 9 months ago

if i set the block=1 to show the dialog box and just click each time manually do you think that will stop the lock up?

rkd77 commented 9 months ago

You can check, dialog can be skipped (ask=0), but I'm afraid that after exiting of viewer screen will be refreshed and all "changes" lost.

johngalt01 commented 9 months ago

does elinks create a new configuration file if you delete and start from scratch? or do you have a config file that i can try out and start from there?

i'm using the 0.13 one that i kept copying and i'm wondering what would have if i started fresh.

johngalt01 commented 9 months ago

i tried playing around changing the dialog boxes from asking or not asking(manual intervention), blocking the terminal or not, always ended up locking up after a 3-4 times loading the script.

it would also lock up after a while just going to different websites and not running any external scripts.

each time starts to lag slow down loading something then it just grinds to a halt and does nothing, i can't exit as the telnet session is just locked up. I exit to my modem software disconnect my modem(I.E. hangup software not a hardware reset) then redial my telnet session and restart elinks and continue from history where i last was.

A few times the telnet session was all screwy where it would show column=5 bizarrely, I would logout and log back in and it would finally reset the session. its like the telnet session is crashing remotely somehow with elinks just not working at all getting stuck and completely un-responsive. links and links2 does the same thing.

a few times i did have elinks just crash to the prompt no error message or warning. it would load a website then just bomb to the prompt.

rkd77 commented 9 months ago

Configuration location can be changed with runtime option -config-dir or env variable ELINKS_CONFDIR. Does it lock up also without images? How does w3m behave on this terminal? links and elinks write directly to the terminal, w3m via ncurses.

johngalt01 commented 8 months ago

Does it lock up also without images?

Yes. it will lock up after a little while if i keep going to new websites, it reacts the same way. it starts to slow down and lag as a page is loading then it locks up.

How does w3m behave on this terminal?

its been a long time since i used W3M i will test it out on the terminal again.

will report back.

also i will do a script test i will load up my directory with a bunch of image files and have it just pipe the screen and see if it locks up.

johngalt01 commented 8 months ago

I'm still testing and making changes.

W3M had no problems.

Now I've been testing elinks in the process i found some ways that i needed to improve my image viewer script.

I made some changes to my script it now exits cleaner. i will need more changes based on more testing.

I downloaded 0.17RC2 and install it. "-no-connect -touch-files 1" I'm using these settings as it seems to work better at the moment.

I increased my cache size.

I've had some lockups right on launch of elinks. I've also had it lock up loading pages. this is without using my script.

I updated my raspberry pi and double checked the firmware update. I want to get a pi 5 and see how that reacts as well.

I'm going to mess with this some more and report back with more experience and information.

rkd77 commented 8 months ago

I would also check links and elinks "inside" the screen terminal.

rkd77 commented 8 months ago

I mean run screen and then elinks.

johngalt01 commented 8 months ago

will do. i have a huge list of things to try.

what i do notice is when i have been to a website a few times and have run my script the image files seem to already be sitting in the cache or temp area. this allows me to to run my script and it pulls the files from the cache or temp area and then i can go for like an hour before a lock up crash occurs. i have been exploring more old web 1.0 websites for testing.

even with things locking up and crashing its still so much fun to see these old websites and images on my terminal.

and its improving my python script.

johngalt01 commented 8 months ago

there is not enough time in the day...

so links and links2 are actually worse. they lock up more often. they lock up when browsing websites without using my script.

the script i wrote works perfectly from the command line on its own in all modes.

when run inside of elinks. one mode of my script causes an python error to occur, it must have something to do with keyboard input control but easy to get around since my script has additional modes of operation. however after a few times usually 3 to 4 runs on a new website elinks will lock up. if i keep going back to the website and running my script i guess its pulling information from the temp files or something as i can load more and more pictures through my script before it locks up again.

you can see the lock up coming as it will start to either load a website or run my script then everything starts to lag and slow down and it locks up.

does not make a difference if i block the terminal or not, nor if i have confirmation dialog boxes or not.

blocking the terminal i wanted to play around with some more.

again not enough time in the day as it will take a few minutes to run per picture to display and you can eat up an hour just loading 4 files before a lock up happens.

when the lock up occurs i found i just faster to reset my wifi modem while still in my terminal communication software then redial my unix box and telnet back in and start elinks again. sometimes the terminal gets stuck even on reset where it thinks the columns is set to 5 even when the bash script has run. wha fixes that is a logout then log back in, it must be trying to connect to the old crashed sessions.

i have had elinks also just crash out with the terminal blocked. it would run my script and then my script has a input hold for a keypress before returning to elinks and then elinks will just bomb to the terminal prompt. i can restart.

clearing the cache actaully makes it worse as it like starting over and then run my script 4 times and i locks up verse if i have been to the site a few times i can reload items that must still be stored somewhere.

it might also be a download issue with elinks as when i load my script with a new picture i have not downloaded before i get 2 dialog boxes, one showing a download, verse something that might be from the cache just showing a single dialog box. the double dialog boxes means 3-4 times and i lock up, verse the other way i might load 10 images and it locks up.

well more playing around as i have time. i added some more input checks to my script but i stopped playing around with it for now.