View previous topic :: View next topic |
Author |
Message |
xanderal Tux's lil' helper
Joined: 06 Mar 2019 Posts: 133 Location: Germany
|
Posted: Fri Aug 02, 2019 8:42 pm Post subject: [SOLVED] ranger freezes system by creating temp files |
|
|
Hi,
I have a problem with ranger: I have a directory on my ssd with a 4.8 GB movie. When I navigate to that file with ranger (so that normally ranger would display info on that file) I just get the rotating bar and someone (probably ranger) fills up my whole system partition (about 38 GB left before doing this)
Here is a part of my lsblk: Code: | nvme0n1
├─vg1-swap 253:1 0 17G 0 lvm [SWAP]
├─vg1-root 253:2 0 60G 0 lvm /
└─vg1-home 253:3 0 379.4G 0 lvm /home
|
vg1-root gets completely filled up within a couple seconds, my cpu goes 100 % on all eight cores and my computer almost freezes.
It obviously has something to do with the file being that big but I'm not sure what to do about this.
When I open that file with another file manager or via terminal everything is fine, also watching the movie in vlc is no problem.
Does ranger do something weird when trying to analyze files?
Thanks in advance.
Last edited by xanderal on Tue Aug 13, 2019 10:46 am; edited 4 times in total |
|
Back to top |
|
|
Dr.Willy Guru
Joined: 15 Jul 2007 Posts: 547 Location: NRW, Germany
|
Posted: Sat Aug 03, 2019 7:17 am Post subject: |
|
|
It does create previews of the files.
Do you have a ~/.config/ranger/scope.sh ? |
|
Back to top |
|
|
xanderal Tux's lil' helper
Joined: 06 Mar 2019 Posts: 133 Location: Germany
|
Posted: Sat Aug 03, 2019 11:39 am Post subject: |
|
|
Dr.Willy wrote: | It does create previews of the files. | But writing 38 GB of files as a preview for a 4.8 GB file seems a bit much...
Dr.Willy wrote: | Do you have a ~/.config/ranger/scope.sh ? | Yes, I didn't change anything, so it should be the default: https://bpaste.net/show/DQ3I
EDIT: Maybe I should add that these files are indeed temporary, so a simple restart fixes the problem.
Also, the only thing I ever changed in the ranger config is that I set the preview of images to true in .config/ranger/rc.conf: https://bpaste.net/show/a71e |
|
Back to top |
|
|
xanderal Tux's lil' helper
Joined: 06 Mar 2019 Posts: 133 Location: Germany
|
Posted: Fri Aug 09, 2019 1:16 pm Post subject: |
|
|
Hi,
does anyone have an idea what I can do?
Just now this problem caused my i7 to go 100 % on all eight cores, filled 16 GB of ram, 3 GB of swap and froze my system...
Now a minimalist file manager like ranger should not do that imo...
EDIT: I found that the files in question are in /tmp/ and are called "magick-" and then some id - deleting them doesn't seem to be a problem but I would prefer them not even to get written. |
|
Back to top |
|
|
Anon-E-moose Watchman
Joined: 23 May 2008 Posts: 6098 Location: Dallas area
|
Posted: Fri Aug 09, 2019 3:28 pm Post subject: |
|
|
sounds like it's making images/thumbnails from every frame from the movie.
Code: | Independently of the preview script, there is a feature to preview images by drawing them directly into the terminal. To enable this feature, set the option preview_images to true and enable one of the image preview modes: |
xanderal wrote: | Also, the only thing I ever changed in the ranger config is that I set the preview of images to true in .config/ranger/rc.conf |
Edit to add: this is just a guess on my part, and as to why it would do that for a movie, I don't know, that would be a question for the ranger developer.
ETA2: the next time you run it and it produces tmp files, stop it so it doesn't fill up your disk and pick several of they tmp files and do "file /tmp/<tmpfilename>" what does it return. _________________ PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland |
|
Back to top |
|
|
xanderal Tux's lil' helper
Joined: 06 Mar 2019 Posts: 133 Location: Germany
|
Posted: Sat Aug 10, 2019 10:43 am Post subject: |
|
|
Anon-E-moose wrote: | sounds like it's making images/thumbnails from every frame from the movie.
Code: | Independently of the preview script, there is a feature to preview images by drawing them directly into the terminal. To enable this feature, set the option preview_images to true and enable one of the image preview modes: |
xanderal wrote: | Also, the only thing I ever changed in the ranger config is that I set the preview of images to true in .config/ranger/rc.conf |
| Thanks, you're right, sounds like it - but wouldn't it do that to other movies, too? Anon-E-moose wrote: | ETA2: the next time you run it and it produces tmp files, stop it so it doesn't fill up your disk and pick several of they tmp files and do "file /tmp/<tmpfilename>" what does it return. | Ok, just forced it and it created 2 types of files: Code: | /tmp/magick-54930No3orfeuXrs.pam: Netpbm PAM image file
/tmp/magick-58586P0l0e8LQlfe: symbolic link to /path/to/movie/moviename.mpg | The stuff after "magick-" is of course different for every file.
Could the problem be in the movie being a .mpg - I tried to convert it to check but stopped after it took my load average up to 10 - might try again after finding out how to limit the resources ffmpeg can use... |
|
Back to top |
|
|
Anon-E-moose Watchman
Joined: 23 May 2008 Posts: 6098 Location: Dallas area
|
Posted: Sat Aug 10, 2019 10:55 am Post subject: |
|
|
Not sure why it would do that, maybe something to do with mime types and how it figures out what a file type is.
I guess you could change the name temporarily (change .mpg to .mpeg) and see if the behavior still exists. _________________ PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland |
|
Back to top |
|
|
xanderal Tux's lil' helper
Joined: 06 Mar 2019 Posts: 133 Location: Germany
|
Posted: Sat Aug 10, 2019 8:39 pm Post subject: |
|
|
Anon-E-moose wrote: | Not sure why it would do that, maybe something to do with mime types and how it figures out what a file type is.
I guess you could change the name temporarily (change .mpg to .mpeg) and see if the behavior still exists. | I tried that, unfortunately same result. |
|
Back to top |
|
|
Anon-E-moose Watchman
Joined: 23 May 2008 Posts: 6098 Location: Dallas area
|
Posted: Sat Aug 10, 2019 8:50 pm Post subject: |
|
|
what does file --mime-type <mpg file> return _________________ PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland |
|
Back to top |
|
|
xanderal Tux's lil' helper
Joined: 06 Mar 2019 Posts: 133 Location: Germany
|
Posted: Sat Aug 10, 2019 9:17 pm Post subject: |
|
|
Anon-E-moose wrote: | what does file --mime-type <mpg file> return | The output is image/x-tga - so I guess it tries to render a preview of a 4.8 GB .tga file out of a .mpg?
EDIT: And I just finished converting the thing to a .mp4 (with correct mime-type) and it doesn't create any problems.
EDIT2: Is there a way to change the mime-type to double-check whether that is the problem? |
|
Back to top |
|
|
Anon-E-moose Watchman
Joined: 23 May 2008 Posts: 6098 Location: Dallas area
|
Posted: Sat Aug 10, 2019 9:48 pm Post subject: |
|
|
what does ls -l /usr/share/applications/mimeinfo.cache show
and ls -l ~/.local/share/applications/mimeinfo.cache show _________________ PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland |
|
Back to top |
|
|
xanderal Tux's lil' helper
Joined: 06 Mar 2019 Posts: 133 Location: Germany
|
Posted: Sun Aug 11, 2019 1:04 pm Post subject: |
|
|
Anon-E-moose wrote: | what does ls -l /usr/share/applications/mimeinfo.cache show | -rw-r--r-- 1 root root 17460 Jul 30 17:48 /usr/share/applications/mimeinfo.cache Anon-E-moose wrote: | and ls -l ~/.local/share/applications/mimeinfo.cache show | -rw-r--r-- 1 xanderal xanderal 13 Jun 14 22:36 /home/xanderal/.local/share/applications/mimeinfo.cache |
|
Back to top |
|
|
Anon-E-moose Watchman
Joined: 23 May 2008 Posts: 6098 Location: Dallas area
|
Posted: Sun Aug 11, 2019 1:38 pm Post subject: |
|
|
xanderal wrote: | EDIT2: Is there a way to change the mime-type to double-check whether that is the problem? |
Yes, but changing types is a little complicated, I had to do much googling to figure out a little, and I still don't want to attempt it.
you could look in .local/share/applications and mime (if that dir exists) for mpg
By default it should be set properly video/mpeg not x-tga.
Your /usr/share/applications/mimeinfo.cache looks pretty recent but so does .local/share/applications/mimeinfo.cache (don't know what creates the local one), I just deleted mine and use the default system one. _________________ PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland |
|
Back to top |
|
|
xanderal Tux's lil' helper
Joined: 06 Mar 2019 Posts: 133 Location: Germany
|
Posted: Tue Aug 13, 2019 10:45 am Post subject: |
|
|
Anon-E-moose wrote: | xanderal wrote: | EDIT2: Is there a way to change the mime-type to double-check whether that is the problem? |
Yes, but changing types is a little complicated, I had to do much googling to figure out a little, and I still don't want to attempt it. | Yes, that was my experience, too :/ Anon-E-moose wrote: | you could look in .local/share/applications and mime (if that dir exists) for mpg
By default it should be set properly video/mpeg not x-tga.
Your /usr/share/applications/mimeinfo.cache looks pretty recent but so does .local/share/applications/mimeinfo.cache (don't know what creates the local one), I just deleted mine and use the default system one. | I have the directories but there are no useful entries - just stuff like which application should open files of which mime-type by default and .xml files referencing http://www.freedesktop.org/standards/shared-mime-info
~/.local/share/applications/mimeinfo.cache is basically empty.
Anyway, thank you very much @Anon-E-moose. I'm going to mark this as solved now and pay more attention to mime-types in the future
EDIT: I just located every other .mpg file I have and checked their mime-type. They were all correct (video/mpeg) - except for the one that created this issue and another one I hadn't thought of before. But since these two files came from the same source I suspect that person screwed something up when creating the files. |
|
Back to top |
|
|
Anon-E-moose Watchman
Joined: 23 May 2008 Posts: 6098 Location: Dallas area
|
Posted: Tue Aug 13, 2019 11:10 am Post subject: |
|
|
xanderal wrote: | EDIT: I just located every other .mpg file I have and checked their mime-type. They were all correct (video/mpeg) - except for the one that created this issue and another one I hadn't thought of before. But since these two files came from the same source I suspect that person screwed something up when creating the files. |
That's possible, it could be that something in the very first part of the mpg was saying it was a tga file instead. Most video players don't care about that identifying stuff at the beginning, but will find the stuff past that, that lets it know it's an mpeg file and can be played. _________________ PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland |
|
Back to top |
|
|
xanderal Tux's lil' helper
Joined: 06 Mar 2019 Posts: 133 Location: Germany
|
Posted: Fri Aug 16, 2019 10:11 am Post subject: |
|
|
Anon-E-moose wrote: | xanderal wrote: | EDIT: I just located every other .mpg file I have and checked their mime-type. They were all correct (video/mpeg) - except for the one that created this issue and another one I hadn't thought of before. But since these two files came from the same source I suspect that person screwed something up when creating the files. |
That's possible, it could be that something in the very first part of the mpg was saying it was a tga file instead. Most video players don't care about that identifying stuff at the beginning, but will find the stuff past that, that lets it know it's an mpeg file and can be played. | Unfortunately I didn't wait for your response and deleted the files after converting them to .mp4
But I can probably get these files again from the same person and then I will check the header and necropost the results in a couple of weeks/months |
|
Back to top |
|
|
|