(Solved) VeraCrypt Problem

Questions about applications and software
Forum rules
Before you post please read how to get help
felemur
Level 4
Level 4
Posts: 378
Joined: Sun Sep 20, 2015 2:22 pm

(Solved) VeraCrypt Problem

Postby felemur » Sat Oct 14, 2017 11:07 am

Lately when using VeraCrypt, my system starts to respond very slowly with long delays after a click, and memory usage goes to max (16Gb), and swap is maxed out as well (according to System Manager).

This happens when transferring files to VeraCrypt containers, not out of them.

Transfer speed into containers is also very slow compared to what it was before this issue started.

I'm wondering if there are settings I can change in VeraCrypt that will correct this. The only way to resolve the problem when it happens is to restart Linux. It has even locked up to the point where I was forced to go nuclear (Raising Elephants Is So Utterly Boring).

There is no other program that causes any issues, so I feel fairly confident this is a VeraCrypt settings issue, possibly a bug, or some unusual situation with my particular setup.

Happy to answer any questions.

Dell Optiplex 7010, Intel i7, 16Gb Ram
Linux Mint 18.2 Cinnamon
VeraCrypt 1.21 (latest)

(This question has been posted in the VeraCrypt forum as well)
Last edited by felemur on Tue Nov 07, 2017 9:55 am, edited 1 time in total.

User avatar
pbear
Level 4
Level 4
Posts: 237
Joined: Wed Jun 21, 2017 12:25 pm
Location: San Francisco

Re: VeraCrypt Problem

Postby pbear » Sun Oct 15, 2017 11:54 am

That's one hell of a bug! Frankly, makes me glad I stuck with TrueCrypt (my security needs are modest, only worried about casual snoopers).

Anyhoo, I notice the last VeraCrypt update was in early July. Hard to imagine it's been more than three months and you're the only one to notice the issue. Makes me wonder whether some other update has created a conflict. No idea what that might be.

Do please cross-post here if you get a solution on the VC forum.
Time flies like an arrow. Fruit flies like a banana.
Running Mint 18.2 Mate 64 bit

felemur
Level 4
Level 4
Posts: 378
Joined: Sun Sep 20, 2015 2:22 pm

Re: VeraCrypt Problem

Postby felemur » Sun Oct 15, 2017 12:36 pm

Yes, I will cross post here with any info from the VeraCrypt forum.

I'm actually surprised that nobody so far has even commented yet on the VeraCrypt forum. I agree I can't be the only one, but you never know.

There are settings in VeraCrypt that I don't understand enough to want to mess with. Two are the "Do not use kernel cryptographic services" option, and the other is the "Do not accelerate AES encryption/decryption by using the AES instructions of the processor" option. Neither are checked by default, and I am worried I could scramble my files if I do check either to see if they help. When this problem is happening, the memory & swap is maxed out, but the i7 is running about 15% on all 8 cores, so its not like the processor is getting stuck into some weird loop. I'm not sure if this is a memory leak issue, but from my little knowledge, it sounds like one.

I've tried shutting off every other program other than "Files" and VeraCrypt to see if that helps, but no.

I've tried other kernels, the latest of the 4.8, 4.10 and 4.11 series, but no change. I even removed VeraCrypt 1.21 and put in an old VeraCrypt 1.18 - but no luck - same problem.

The thing I personally find odd, is this issue just appeared a month or two ago on its own. Before that, VeraCrypt worked flawlessly. I haven't added any software that I can think of in that time frame. I did my latest fresh install when Mint 18.0 came out whenever that was, and have just been doing the suggested updates via the update manager.

PS - I first saw "Time flies like an arrow. Fruit flies like a banana." in a late 1970's OMNI magazine - a sort of science & science fiction magazine. It won some kind of contest for the best funny science word play that was sent in. Most submissions were based around the planet Uranus.

fungus
Level 4
Level 4
Posts: 324
Joined: Mon Sep 07, 2015 6:09 am

Re: VeraCrypt Problem

Postby fungus » Sun Oct 15, 2017 2:01 pm

@felemur: Kernel cryptographic services are crypto routines built into the kernel, read more here: https://kernel.readthedocs.io/en/sphinx ... o-API.html Some CPU's have a special AES instruction set which may accelerate encryption quite a lot (sort of a GPU for encryption). Disabling kernel crypto and AES instructions is not a problem, VeraCrypt must have has build in support for encryption to use as a fall back option. If your problem is caused by kernel regression, disabling kernel crypto may help. If your CPU is dying, disabling AES instructions may help. Good luck! :)
Linux Mint 17.3 64bit KDE @ Asus B150M-A, i3 6100, Crucial 16GB DDR4, Crucial BX100
One bit says: YES, the other answers: NO.. Guess who's he and who's she..! ;)

User avatar
majpooper
Level 4
Level 4
Posts: 375
Joined: Thu May 09, 2013 1:56 pm
Location: North Carolina, USA

Re: VeraCrypt Problem

Postby majpooper » Sun Oct 15, 2017 3:37 pm

I am using Veracrypt with a very similar rig i7 16G of RAM and have tried to create your issue but nothing seems slow.
Could it be the kernel - I am running Cinnamon 18 with kernel 4.4.0-97. The other thing that is different I have turned SWAP off.

felemur
Level 4
Level 4
Posts: 378
Joined: Sun Sep 20, 2015 2:22 pm

Re: VeraCrypt Problem

Postby felemur » Mon Oct 16, 2017 6:04 pm

Sorry for the late reply to your post.

Our rigs do sound similar. We are even running the same kernel, however I have tried others with no help.

It seems that whatever is going wrong with my setup, Veracrypt is going to take up the full amount of memory and swap regardless of what amount that is. I've watched it happen with the System Monitor program that comes with Mint Cinnamon. From using about 2Gb from when I first start transferring the file into the Veracrypt container to full 16Gb used in about 1 minute or less, then moves to swap, and fills that just as fast. After both are full, the entire system basically starts grinding to a halt.

I don't think I made this clear previously: even after I dismount the Veracrypt container, shut down VeraCrypt, the memory usage does not drop. The system will not return to normal until after a restart.

I'm starting to get the feeling the only way I'm going to resolve this is do a fresh install. There must be something I've done along the way that is causing this, as I seem to be the only one with the problem - not a single reply or similar post on the VeraCrypt forum. I sure hope a fresh install works.

User avatar
MintBean
Level 8
Level 8
Posts: 2428
Joined: Fri Aug 07, 2015 6:54 am
Location: Blighty

Re: VeraCrypt Problem

Postby MintBean » Mon Oct 16, 2017 6:12 pm

felemur wrote:I don't think I made this clear previously: even after I dismount the Veracrypt container, shut down VeraCrypt, the memory usage does not drop. The system will not return to normal until after a restart.
That's unusual because my understanding was that the OS reclaimed the allocated memory on program exit irrespective of whether the code performed the relevant deallocations. Presumably VC either leaks memory through an independent system process it interacts with or it spawned a process that is somehow no destroyed on exit.

Is the missing memory listed against a process after VC exits?

felemur
Level 4
Level 4
Posts: 378
Joined: Sun Sep 20, 2015 2:22 pm

Re: VeraCrypt Problem

Postby felemur » Mon Oct 16, 2017 6:14 pm

That is a good question - I've looked into that.

According to the "processes" tab on System Monitor, there is nothing using that memory.

felemur
Level 4
Level 4
Posts: 378
Joined: Sun Sep 20, 2015 2:22 pm

Re: VeraCrypt Problem

Postby felemur » Mon Oct 16, 2017 7:27 pm

fungus wrote:@felemur: Kernel cryptographic services are crypto routines built into the kernel, read more here: https://kernel.readthedocs.io/en/sphinx ... o-API.html Some CPU's have a special AES instruction set which may accelerate encryption quite a lot (sort of a GPU for encryption). Disabling kernel crypto and AES instructions is not a problem, VeraCrypt must have has build in support for encryption to use as a fall back option. If your problem is caused by kernel regression, disabling kernel crypto may help. If your CPU is dying, disabling AES instructions may help. Good luck! :)


Thanks, will try both and report on what happens.

Edit: Tried both options checked. No difference except - CPU usage went from about 15% when they were unchecked to about 30% when checked. (This is when transferring files into VeraCrypt container.)
Last edited by felemur on Mon Oct 16, 2017 7:44 pm, edited 1 time in total.

User avatar
pbear
Level 4
Level 4
Posts: 237
Joined: Wed Jun 21, 2017 12:25 pm
Location: San Francisco

Re: VeraCrypt Problem

Postby pbear » Mon Oct 16, 2017 7:35 pm

felemur wrote:PS - I first saw "Time flies like an arrow. Fruit flies like a banana." in a late 1970's OMNI magazine - a sort of science & science fiction magazine. It won some kind of contest for the best funny science word play that was sent in. Most submissions were based around the planet Uranus.

Like many classics, the origin of the joke is uncertain, but the most likely correct attribution is to Anthony Oettinger, from a 1966 article in Scientific American, although he didn't state it quite so succinctly (was later paraphrased by others).

Good luck with your quest. Sorry can't be more helpful.
Time flies like an arrow. Fruit flies like a banana.
Running Mint 18.2 Mate 64 bit

felemur
Level 4
Level 4
Posts: 378
Joined: Sun Sep 20, 2015 2:22 pm

Re: VeraCrypt Problem

Postby felemur » Tue Nov 07, 2017 9:54 am

Problem has solved itself in unknown way.

It starts to eat memory, then drops back down again. Does this over and over as it is transferring large amounts of files into an encrypted container.

The only thing I've changed since the last time I used it when the problem was there and now: I've done the updates including the latest 4.4 series kernel. Correlation is not causation, but I'll take it. :D

fungus
Level 4
Level 4
Posts: 324
Joined: Mon Sep 07, 2015 6:09 am

Re: (Solved) VeraCrypt Problem

Postby fungus » Tue Nov 07, 2017 10:20 am

Always nice.. Ehrm.. Concerning when problems fixes them selves.. You may want to check up on your disk caching - sound a bit like you are loading a lot of the data being copied into memory before actually writing it to disk. Since disk caching is a kernel feature a kernel update may very well have changed the behaviour of this. Check this article about disk caching: https://lonesysadmin.net/2013/12/22/bet ... rty_ratio/
Linux Mint 17.3 64bit KDE @ Asus B150M-A, i3 6100, Crucial 16GB DDR4, Crucial BX100
One bit says: YES, the other answers: NO.. Guess who's he and who's she..! ;)

User avatar
Portreve
Level 5
Level 5
Posts: 816
Joined: Mon Apr 18, 2011 12:03 am
Location: Florida

Re: (Solved) VeraCrypt Problem

Postby Portreve » Tue Nov 07, 2017 11:37 am

No issues here regardless of whether I'm dealing with disk images or physical devices.

Perhaps something else is going on with your system that you haven't yet realized?
Everything is in hand. With this tapestry... and with patience, there is nothing one cannot achieve.

No hamsters were harmed in the authoring of this post.

User avatar
pbear
Level 4
Level 4
Posts: 237
Joined: Wed Jun 21, 2017 12:25 pm
Location: San Francisco

Re: VeraCrypt Problem

Postby pbear » Tue Nov 07, 2017 1:12 pm

felemur wrote:The only thing I've changed since the last time I used it when the problem was there and now: I've done the updates including the latest 4.4 series kernel. Correlation is not causation, but I'll take it. :D

Had a similar pattern several months ago on one of my USB systems. Kernel update knocked out the WiFi connection, which still worked in the host machine running the same kernel from hard drive. Reverted kernel of the USB drive but updated next go round, which worked fine. My guess was that there had been an error installing the earlier update. So, you might have an important unidentified system issue, but not necessarily.
Time flies like an arrow. Fruit flies like a banana.
Running Mint 18.2 Mate 64 bit

felemur
Level 4
Level 4
Posts: 378
Joined: Sun Sep 20, 2015 2:22 pm

Re: (Solved) VeraCrypt Problem

Postby felemur » Wed Nov 08, 2017 8:05 pm

fungus wrote:Always nice.. Ehrm.. Concerning when problems fixes them selves.. You may want to check up on your disk caching - sound a bit like you are loading a lot of the data being copied into memory before actually writing it to disk. Since disk caching is a kernel feature a kernel update may very well have changed the behaviour of this. Check this article about disk caching: https://lonesysadmin.net/2013/12/22/bet ... rty_ratio/


Thanks for that, I will read up on that and see what can be done - what you say makes sense. However......

I do remember changing the swappiness to 10 from the default 60 after upgrading to 18.2, but I had forgotten (and you reminded me) I had put less pressure on shrinking the inode cache by adding this line:

Code: Select all

# Improve cache management
vm.vfs_cache_pressure=50


to the /etc/sysctl.conf file as per: https://sites.google.com/site/easylinux ... node-cache

I wonder if that was the root of the issue?

felemur
Level 4
Level 4
Posts: 378
Joined: Sun Sep 20, 2015 2:22 pm

Re: (Solved) VeraCrypt Problem

Postby felemur » Wed Nov 08, 2017 8:39 pm

fungus wrote:Always nice.. Ehrm.. Concerning when problems fixes them selves.. You may want to check up on your disk caching - sound a bit like you are loading a lot of the data being copied into memory before actually writing it to disk. Since disk caching is a kernel feature a kernel update may very well have changed the behaviour of this. Check this article about disk caching: https://lonesysadmin.net/2013/12/22/bet ... rty_ratio/


In looking into that link you gave, I checked, and found that my dirty background cache ratio was 10%

Code: Select all

vm.dirty_background_bytes = 0
vm.dirty_background_ratio = 10
vm.dirty_bytes = 0
vm.dirty_expire_centisecs = 3000
vm.dirty_ratio = 20
vm.dirty_writeback_centisecs = 500
vm.dirtytime_expire_seconds = 43200


which means with 16Gb of RAM, I would have been loading up the RAM with 1.6GB before it asynchronously flushed the cache to disk. If you add that to the putting less pressure on shrinking the inode cache, I wonder if I caused the problem?

I'm interested in expert opinion before I go ahead and make changes, though with 16Gb RAM, it seems like a conservative change to making the dirty background cache 3 to 5% from the current 10%

fungus
Level 4
Level 4
Posts: 324
Joined: Mon Sep 07, 2015 6:09 am

Re: (Solved) VeraCrypt Problem

Postby fungus » Thu Nov 09, 2017 7:39 am

felemur wrote:I'm interested in expert opinion before I go ahead and make changes, though with 16Gb RAM, it seems like a conservative change to making the dirty background cache 3 to 5% from the current 10%


It is up to you to decide how your caching is to be handled. Experimenting yields experience, so go ahead and fiddle with it and post back with your findings :)
Linux Mint 17.3 64bit KDE @ Asus B150M-A, i3 6100, Crucial 16GB DDR4, Crucial BX100
One bit says: YES, the other answers: NO.. Guess who's he and who's she..! ;)


Return to “Software & Applications”

Who is online

Users browsing this forum: Bing [Bot], hansmex and 19 guests