[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
ssh_mutex_lock on windows failing
[Thread Prev] | [Thread Next]
- Subject: ssh_mutex_lock on windows failing
- From: "Matthew Allen" <fret@xxxxxxxxxxxx>
- Reply-to: libssh@xxxxxxxxxx
- Date: Mon, 10 Nov 2025 21:23:12 +1100
- To: <libssh@xxxxxxxxxx>
Hi all, I'm seeing a very specific failure in ssh_mutex_lock on windows where the InterlockedCompareExchangePointer call fails and it falls into the DeleteCriticalSection error handler and exiting the process. This of course is quite annoying for the calling application. It's clear that "this should NOT happen". But here is where it gets a bit weird... this only happens when I first boot windows. Once the app has run once and exited, the second and all further invocations run fine. So it's not super duper bad, but it's annoying enough I'm looking into it. I'm building using vs2019, using the cmake to create a solution. And from the latest git code here: https://git.libssh.org/projects/libssh.git Has anyone else seen this behaviour? Or have any smart ideas on what could be causing this? More info, my stack trace looks like this: ssh.dll!ssh_mutex_lock(_RTL_CRITICAL_SECTION * * mutex) Line 108 C ssh.dll!is_ssh_initialized() Line 289 C ssh.dll!ssh_connect(ssh_session_struct * session) Line 532 C Lvc.exe!LSsh::Open(const char * Host, const char * Username, const char * Password, bool PublicKey, int Port) Line 516 C++ Lvc.exe!SshConnection::GetConsole() Line 88 C++ Lvc.exe!SshConnection::GetStream() Line 82 C++ Lvc.exe!SshConnection::OnEvent(LMessage * Msg) Line 401 C++ Lgi19x64d.dll!LEventTargetThread::Main() Line 381 C++ Lgi19x64d.dll!ThreadEntryPoint(void * i) Line 80 C++ Where 'Lvc.exe' is my application. And the final call is 'exit(ENOMEM);' And yes, this is running in a worker thread. Not the main GUI thread. Not sure if that's important. But it might be relevant. Regards Matthew Allen Memecode
| RE: ssh_mutex_lock on windows failing | Jeremy Cross <JCross@xxxxxxxxxxxxxxx> |