Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 VAX freezing in Visual Studio 2022
 New Topic  Reply to Topic
 Printer Friendly
Author  Topic Next Topic  

foxmuldr
Tomato Guru

USA
433 Posts

Posted - Nov 03 2025 :  11:03:33 AM  Show Profile  Reply with Quote
I have a C/C++ project where I'm including libsodium in a particular source file (let's call it main.cpp).

In main.cpp, I #include libsodium with a single line:
#include "..\libsodium\include\sodium.h"


Which is this sodium.h include file:
#ifndef sodium_H
#define sodium_H

#include "sodium/version.h"

#include "sodium/core.h"
#include "sodium/crypto_aead_aes256gcm.h"
#include "sodium/crypto_aead_aegis128l.h"
#include "sodium/crypto_aead_aegis256.h"
#include "sodium/crypto_aead_chacha20poly1305.h"
#include "sodium/crypto_aead_xchacha20poly1305.h"
#include "sodium/crypto_auth.h"
#include "sodium/crypto_auth_hmacsha256.h"
#include "sodium/crypto_auth_hmacsha512.h"
#include "sodium/crypto_auth_hmacsha512256.h"
#include "sodium/crypto_box.h"
#include "sodium/crypto_box_curve25519xsalsa20poly1305.h"
#include "sodium/crypto_core_hsalsa20.h"
#include "sodium/crypto_core_hchacha20.h"
#include "sodium/crypto_core_salsa20.h"
#include "sodium/crypto_core_salsa2012.h"
#include "sodium/crypto_core_salsa208.h"
#include "sodium/crypto_generichash.h"
#include "sodium/crypto_generichash_blake2b.h"
#include "sodium/crypto_hash.h"
#include "sodium/crypto_hash_sha256.h"
#include "sodium/crypto_hash_sha512.h"
#include "sodium/crypto_kdf.h"
#include "sodium/crypto_kdf_hkdf_sha256.h"
#include "sodium/crypto_kdf_hkdf_sha512.h"
#include "sodium/crypto_kdf_blake2b.h"
#include "sodium/crypto_kx.h"
#include "sodium/crypto_onetimeauth.h"
#include "sodium/crypto_onetimeauth_poly1305.h"
#include "sodium/crypto_pwhash.h"
#include "sodium/crypto_pwhash_argon2i.h"
#include "sodium/crypto_scalarmult.h"
#include "sodium/crypto_scalarmult_curve25519.h"
#include "sodium/crypto_secretbox.h"
#include "sodium/crypto_secretbox_xsalsa20poly1305.h"
#include "sodium/crypto_secretstream_xchacha20poly1305.h"
#include "sodium/crypto_shorthash.h"
#include "sodium/crypto_shorthash_siphash24.h"
#include "sodium/crypto_sign.h"
#include "sodium/crypto_sign_ed25519.h"
#include "sodium/crypto_stream.h"
#include "sodium/crypto_stream_chacha20.h"
#include "sodium/crypto_stream_salsa20.h"
#include "sodium/crypto_stream_xsalsa20.h"
#include "sodium/crypto_verify_16.h"
#include "sodium/crypto_verify_32.h"
#include "sodium/crypto_verify_64.h"
#include "sodium/randombytes.h"
#include "sodium/randombytes_internal_random.h"
#include "sodium/randombytes_sysrandom.h"
#include "sodium/runtime.h"
#include "sodium/utils.h"

#ifndef SODIUM_LIBRARY_MINIMAL
# include "sodium/crypto_box_curve25519xchacha20poly1305.h"
# include "sodium/crypto_core_ed25519.h"
# include "sodium/crypto_core_ristretto255.h"
# include "sodium/crypto_scalarmult_ed25519.h"
# include "sodium/crypto_scalarmult_ristretto255.h"
# include "sodium/crypto_secretbox_xchacha20poly1305.h"
# include "sodium/crypto_pwhash_scryptsalsa208sha256.h"
# include "sodium/crypto_stream_salsa2012.h"
# include "sodium/crypto_stream_salsa208.h"
# include "sodium/crypto_stream_xchacha20.h"
#endif

#endif


The problem is, each time I go to that main.cpp file with VAX enabled, it pauses for about 15 seconds and then continues. The UI is frozen, and if I start trying to click on things I get the not responding mouse pointer, and eventually the frosted window indicating it's not responding, and finally if I keep clicking, the attached image.

If I disable VAX then I'm able to go back and forth just fine. I'm reasonably sure it has to do with checking all those files to see if they've changed since the last time that file was opened.

Is there a way to add that folder to the do-not-rescan list, or some such?

--
Rick C. Hodgin




Edited by - foxmuldr on Nov 03 2025 11:04:42 AM

feline
Whole Tomato Software

United Kingdom
19249 Posts

Posted - Nov 03 2025 :  11:28:18 AM  Show Profile  Reply with Quote
Is this an open source library I can test on here? Or something that only you have access to?

My first thought would be to add the library to the stable include directory list, by adding it to:

Project properties -> VC++ Directories -> Include Directories

directories included here are automatically added to VA's stable include directory list, assuming you are using:

VA Options -> C/C++ Directories -> Platform = Project defined

and not a custom directory list.

VA doesn't re-scan stable include directories.

The problem with this answer is that VA is designed not to re-scan files it has already scanned once, unless they have changed. So, assuming these files are not changing on the hard drive, getting a new last modified date / time, once VA has scanned then the once, we should not need to re-scan them again. So I am not actually sure if this will have any effect or not.

zen is the art of being at one with the two'ness
Go to Top of Page

foxmuldr
Tomato Guru

USA
433 Posts

Posted - Nov 03 2025 :  11:48:03 AM  Show Profile  Reply with Quote
Libsodium is a well-known public encryption library:
https://github.com/jedisct1/libsodium/
https://github.com/jedisct1/libsodium/releases/download/1.0.20-RELEASE/libsodium-1.0.20-msvc.zip
This file: libsodium-1.0.20-msvc.zip/libsodium/include/sodium.h

It's also available with vcpkg (https://github.com/Microsoft/vcpkg.git):
vcpkg install libsodium:x86-windows

Assuming vcpkg is installed at c:\github\vcpkg\:
C:\github\vcpkg\installed\x86-windows\include\sodium.h

--
Rick C. Hodgin
Go to Top of Page

foxmuldr
Tomato Guru

USA
433 Posts

Posted - Nov 03 2025 :  11:49:49 AM  Show Profile  Reply with Quote
quote:
Originally posted by feline
The problem with this answer is that VA is designed not to re-scan files it has already scanned once, unless they have changed. So, assuming these files are not changing on the hard drive, getting a new last modified date / time, once VA has scanned then the once, we should not need to re-scan them again. So I am not actually sure if this will have any effect or not.



Then I'm not sure what it is. It only happens with VAX enabled.

Is there a diagnostic / logging mode I can enable which would log which internal algorithms in VAX are being called and which ones are consuming the most time? It's literally unusable with VAX right now, so I've had to disable it to complete this current task.

--
Rick C. Hodgin
Go to Top of Page

foxmuldr
Tomato Guru

USA
433 Posts

Posted - Nov 03 2025 :  12:59:51 PM  Show Profile  Reply with Quote
I created a second cpp file with those entries, and it's not lagging. I'm going to add bits in one by one until it starts lagging to figure out what's causing it.

--
Rick C. Hodgin
Go to Top of Page

foxmuldr
Tomato Guru

USA
433 Posts

Posted - Nov 03 2025 :  1:50:29 PM  Show Profile  Reply with Quote
I've added everything in the original source file to the second one and no pauses. So, I'm truly at a loss. I'm going to try cutting all, re-pasting all, etc., to see if I can get it to go away.

--
Rick C. Hodgin

Edited by - foxmuldr on Nov 03 2025 2:11:49 PM
Go to Top of Page

foxmuldr
Tomato Guru

USA
433 Posts

Posted - Nov 03 2025 :  5:38:59 PM  Show Profile  Reply with Quote
I ultimately asked Claude about it, and that AI suggested I exit Visual Studio, delete my .vs folder, restart, and that fixed it. So apparently it was something inside of VS working with VAX, because disabling VAX would prevent it from happening on that file.

Thank you, feline.

--
Rick C. Hodgin
Go to Top of Page
   Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000