Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Your fault -- core dumped


devel / comp.lang.c++ / Re: msvc wrt locking errors...

SubjectAuthor
* msvc wrt locking errors...Chris M. Thomasson
+- Re: msvc wrt locking errors...Chris M. Thomasson
`- Re: msvc wrt locking errors...Chris M. Thomasson

1
msvc wrt locking errors...

<upsm0u$ouf8$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=3127&group=comp.lang.c%2B%2B#3127

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: chris.m....@gmail.com (Chris M. Thomasson)
Newsgroups: comp.lang.c++
Subject: msvc wrt locking errors...
Date: Mon, 5 Feb 2024 23:10:23 -0800
Organization: A noiseless patient Spider
Lines: 62
Message-ID: <upsm0u$ouf8$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 6 Feb 2024 07:10:23 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="d977dfc718b87c6477e28e021d409c7a";
logging-data="817640"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18rIzhuea1huCcWKJeR3BeU6OepcrK36sU="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:eKMnd8OivRynxZRzwSd6BCudqaA=
Content-Language: en-US
 by: Chris M. Thomasson - Tue, 6 Feb 2024 07:10 UTC

This is not giving me a warning, but an assertion. I am still wondering
why Bonita has to suppress all of those warnings wrt this thread ala MSVC:

https://groups.google.com/g/comp.lang.c++/c/pFsb3JI11-k

Here is some bugged code I just created, wrt MSVC version 17.8.5. No
warnings, but an assertion:

https://i.ibb.co/QQFyZQq/image.png

code:
____________________________________
#include <iostream>
#include <functional>
#include <thread>
#include <mutex>

namespace ct
{ struct mutex_test
{
std::mutex m_mutex;

void
works()
{
m_mutex.lock();
m_mutex.unlock();
}

void
foobar()
{
m_mutex.lock();
//m_mutex.unlock(); YIKES!
}
};
}

int
main()
{ std::cout << "ct_threads... ;^)\n" << std::endl;

{
ct::mutex_test test;

test.works();
test.foobar(); // humm... Kabboom!
}

return 0;
} ____________________________________

Btw, I am going to port my new XCHG based code from Relacy race detector
into actual C++ code where we all can play with it. Getting to a point
where I need to use it for a project.

Re: msvc wrt locking errors...

<upsqtl$q63b$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=3128&group=comp.lang.c%2B%2B#3128

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: chris.m....@gmail.com (Chris M. Thomasson)
Newsgroups: comp.lang.c++
Subject: Re: msvc wrt locking errors...
Date: Tue, 6 Feb 2024 00:33:57 -0800
Organization: A noiseless patient Spider
Lines: 10
Message-ID: <upsqtl$q63b$1@dont-email.me>
References: <upsm0u$ouf8$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 6 Feb 2024 08:33:57 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="d977dfc718b87c6477e28e021d409c7a";
logging-data="858219"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/GHmfpBbPyQZrbJS3r7Izn+cy7zurrkhA="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:+JujyofNiKp67ZjKdpPlAKzzJx0=
Content-Language: en-US
In-Reply-To: <upsm0u$ouf8$1@dont-email.me>
 by: Chris M. Thomasson - Tue, 6 Feb 2024 08:33 UTC

On 2/5/2024 11:10 PM, Chris M. Thomasson wrote:
> This is not giving me a warning, but an assertion. I am still wondering
> why Bonita has to suppress all of those warnings wrt this thread ala MSVC:
>
> https://groups.google.com/g/comp.lang.c++/c/pFsb3JI11-k
[...]

Sometime tomorrow I can work on this. I need to compile the bugged test
code with the warning level bumped up.

Re: msvc wrt locking errors...

<uq0q9b$1j51f$3@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=3139&group=comp.lang.c%2B%2B#3139

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: chris.m....@gmail.com (Chris M. Thomasson)
Newsgroups: comp.lang.c++
Subject: Re: msvc wrt locking errors...
Date: Wed, 7 Feb 2024 12:47:40 -0800
Organization: A noiseless patient Spider
Lines: 61
Message-ID: <uq0q9b$1j51f$3@dont-email.me>
References: <upsm0u$ouf8$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 7 Feb 2024 20:47:40 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="832a879ced2a94899cfa3a469992b5bb";
logging-data="1676335"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/8/RRicMLFAC3EEz0CcKEvj4av4DAD/w0="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:A5BLpRPe7VzVGlCDgpMFCD0NwIk=
Content-Language: en-US
In-Reply-To: <upsm0u$ouf8$1@dont-email.me>
 by: Chris M. Thomasson - Wed, 7 Feb 2024 20:47 UTC

On 2/5/2024 11:10 PM, Chris M. Thomasson wrote:
> This is not giving me a warning, but an assertion. I am still wondering
> why Bonita has to suppress all of those warnings wrt this thread ala MSVC:
>
> https://groups.google.com/g/comp.lang.c++/c/pFsb3JI11-k
[...]

Okay, made some progress. Here is a little example of where the warnings
pop up. "Sketchy" use of std::unique_lock, well, imvvho that is:
___________________________________________
#include <iostream>
#include <functional>
#include <thread>
#include <mutex>
#include <cassert>

namespace ct
{ struct mutex_test
{
std::mutex m_mutex;

void
bar(std::unique_lock<std::mutex>& lock)
{
assert(lock);
lock.unlock();
}

void
foo()
{
std::unique_lock<std::mutex> lock(m_mutex);

// lock will be unlocked after this call!
bar(lock);

lock.lock(); // Yup...
}
};
}

int
main()
{ std::cout << "ct_threads... ;^)\n" << std::endl;

{
ct::mutex_test test;

test.foo();
}

return 0;
} ___________________________________________

Interesting wrt MSVC.


devel / comp.lang.c++ / Re: msvc wrt locking errors...

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor