Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS sanitizer github jobs (fixes #4313) #4346

Merged
merged 5 commits into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 93 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,7 @@ jobs:
CppUnit::TestCaller<UniqueExpireLRUCacheTest>.testExpireN,
CppUnit::TestCaller<ExpireLRUCacheTest>.testAccessExpireN,
CppUnit::TestCaller<SyslogTest>.testOldBSD,
CppUnit::TestCaller<PollSetTest>.testPollClosedServer,
CppUnit::TestCaller<CryptoTest>.testEncryptDecryptGCM"
CppUnit::TestCaller<PollSetTest>.testPollClosedServer"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be looked into when working on #4382; not being able to detect the server closing connection is a problem

EXCLUDE_TESTS="Redis Data/MySQL Data/ODBC Data/PostgreSQL MongoDB PDF"
./ci/runtests.sh

Expand All @@ -242,8 +241,7 @@ jobs:
CppUnit::TestCaller<ExpireLRUCacheTest>.testAccessExpireN,
CppUnit::TestCaller<UniqueExpireLRUCacheTest>.testExpireN,
CppUnit::TestCaller<ExpireLRUCacheTest>.testAccessExpireN,
CppUnit::TestCaller<PollSetTest>.testPollClosedServer,
CppUnit::TestCaller<CryptoTest>.testEncryptDecryptGCM"
CppUnit::TestCaller<PollSetTest>.testPollClosedServer"
PWD=`pwd`
ctest --output-on-failure -E "(DataMySQL)|(DataODBC)|(PostgreSQL)|(MongoDB)|(Redis)"

Expand All @@ -268,11 +266,100 @@ jobs:
CppUnit::TestCaller<ExpireLRUCacheTest>.testAccessExpireN,
CppUnit::TestCaller<UniqueExpireLRUCacheTest>.testExpireN,
CppUnit::TestCaller<ExpireLRUCacheTest>.testAccessExpireN,
CppUnit::TestCaller<PollSetTest>.testPollClosedServer,
CppUnit::TestCaller<CryptoTest>.testEncryptDecryptGCM"
CppUnit::TestCaller<PollSetTest>.testPollClosedServer"
PWD=`pwd`
ctest --output-on-failure -E "(DataMySQL)|(DataODBC)|(PostgreSQL)|(MongoDB)|(Redis)"

macos-clang-make-openssl3-tsan:
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- run: brew install openssl@3
- run: >-
./configure --everything --no-prefix --no-samples --omit=CppParser,Encodings,Data/MySQL,Data/ODBC,Data/PostgreSQL,MongoDB,PageCompiler,PDF,PocoDoc,ProGen,Redis,SevenZip
--odbc-include=/usr/local/opt/unixodbc/include --odbc-lib=/usr/local/opt/unixodbc/lib
--mysql-include=/usr/local/opt/mysql-client/include --mysql-lib=/usr/local/opt/mysql-client/lib
--include-path="/usr/local/opt/openssl@3/include" --library-path="/usr/local/opt/openssl@3/lib" &&
make all -s -j4 SANITIZEFLAGS=-fsanitize=thread

- uses: ./.github/actions/retry-action
with:
timeout_minutes: 90
max_attempts: 3
retry_on: any
command: >-
sudo -s
CPPUNIT_IGNORE="
CppUnit::TestCaller<ThreadTest>.testTrySleep,
CppUnit::TestCaller<TimestampTest>.testTimestamp,
CppUnit::TestCaller<ExpireLRUCacheTest>.testExpireN,
CppUnit::TestCaller<ExpireLRUCacheTest>.testAccessExpireN,
CppUnit::TestCaller<UniqueExpireLRUCacheTest>.testExpireN,
CppUnit::TestCaller<ExpireLRUCacheTest>.testAccessExpireN,
CppUnit::TestCaller<PollSetTest>.testPollClosedServer"
EXCLUDE_TESTS="Redis Data/MySQL Data/ODBC Data/PostgreSQL MongoDB PDF"
./ci/runtests.sh TSAN

macos-clang-make-openssl3-ubsan:
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- run: brew install openssl@3 mysql-client unixodbc libpq
- run: >-
./configure --everything --no-prefix --no-samples --omit=PDF
--odbc-include=/usr/local/opt/unixodbc/include --odbc-lib=/usr/local/opt/unixodbc/lib
--mysql-include=/usr/local/opt/mysql-client/include --mysql-lib=/usr/local/opt/mysql-client/lib
--include-path="/usr/local/opt/openssl@3/include" --library-path="/usr/local/opt/openssl@3/lib" &&
make all -s -j4 SANITIZEFLAGS=-fsanitize=undefined

- uses: ./.github/actions/retry-action
with:
timeout_minutes: 90
max_attempts: 3
retry_on: any
command: >-
sudo -s
CPPUNIT_IGNORE="
CppUnit::TestCaller<ThreadTest>.testTrySleep,
CppUnit::TestCaller<TimestampTest>.testTimestamp,
CppUnit::TestCaller<ExpireLRUCacheTest>.testExpireN,
CppUnit::TestCaller<ExpireLRUCacheTest>.testAccessExpireN,
CppUnit::TestCaller<UniqueExpireLRUCacheTest>.testExpireN,
CppUnit::TestCaller<ExpireLRUCacheTest>.testAccessExpireN,
CppUnit::TestCaller<PollSetTest>.testPollClosedServer"
EXCLUDE_TESTS="Redis Data/MySQL Data/ODBC Data/PostgreSQL MongoDB PDF"
./ci/runtests.sh

macos-clang-make-openssl3-asan:
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- run: brew install openssl@3 mysql-client unixodbc libpq
- run: >-
./configure --everything --no-prefix --no-samples --omit=PDF
--odbc-include=/usr/local/opt/unixodbc/include --odbc-lib=/usr/local/opt/unixodbc/lib
--mysql-include=/usr/local/opt/mysql-client/include --mysql-lib=/usr/local/opt/mysql-client/lib
--include-path="/usr/local/opt/openssl@3/include" --library-path="/usr/local/opt/openssl@3/lib" &&
make all -s -j4 SANITIZEFLAGS=-fsanitize=address

- uses: ./.github/actions/retry-action
with:
timeout_minutes: 90
max_attempts: 3
retry_on: any
command: >-
sudo -s
CPPUNIT_IGNORE="
CppUnit::TestCaller<ThreadTest>.testTrySleep,
CppUnit::TestCaller<TimestampTest>.testTimestamp,
CppUnit::TestCaller<ExpireLRUCacheTest>.testExpireN,
CppUnit::TestCaller<ExpireLRUCacheTest>.testAccessExpireN,
CppUnit::TestCaller<UniqueExpireLRUCacheTest>.testExpireN,
CppUnit::TestCaller<ExpireLRUCacheTest>.testAccessExpireN,
CppUnit::TestCaller<PollSetTest>.testPollClosedServer"
EXCLUDE_TESTS="Redis Data/MySQL Data/ODBC Data/PostgreSQL MongoDB PDF"
./ci/runtests.sh

# windows-2019-msvc-cmake:
# runs-on: windows-2019
# env:
Expand Down
11 changes: 4 additions & 7 deletions Crypto/testsuite/src/CryptoTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,15 +212,12 @@ void CryptoTest::testEncryptDecryptDESECB()

void CryptoTest::testEncryptDecryptGCM()
{
//
// The test sometimes fails when it is running for longer time
// This conversation perhaps contains a hint:
// https://github.com/openssl/openssl/issues/21119
//

CipherKey key("aes-256-gcm");

CipherKey::ByteVec iv(20, 213);
// 96-bit (12 byte) IV is recommended for usage with GCM.
// https://crypto.stackexchange.com/questions/41601/aes-gcm-recommended-iv-size-why-12-bytes

CipherKey::ByteVec iv(12, 213);
key.setIV(iv);

Cipher::Ptr pCipher = CipherFactory::defaultFactory().createCipher(key);
Expand Down
7 changes: 6 additions & 1 deletion Net/testsuite/src/TCPServerTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "Poco/Net/StreamSocket.h"
#include "Poco/Net/ServerSocket.h"
#include "Poco/Thread.h"
#include "Poco/Mutex.h"
#include <iostream>


Expand All @@ -35,6 +36,8 @@ using Poco::Thread;

namespace
{
static Poco::FastMutex cerrMutex;

class EchoConnection: public TCPServerConnection
{
public:
Expand All @@ -55,8 +58,10 @@ namespace
n = ss.receiveBytes(buffer, sizeof(buffer));
}
}
catch (Poco::Exception& exc)
catch (const Poco::Exception& exc)
{
Poco::FastMutex::ScopedLock l(cerrMutex);

std::cerr << "EchoConnection: " << exc.displayText() << std::endl;
}
}
Expand Down
7 changes: 6 additions & 1 deletion NetSSL_OpenSSL/testsuite/src/TCPServerTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "Poco/Util/Application.h"
#include "Poco/Util/AbstractConfiguration.h"
#include "Poco/Thread.h"
#include "Poco/Mutex.h"
#include <iostream>


Expand All @@ -46,6 +47,8 @@ using Poco::Util::Application;

namespace
{
static Poco::FastMutex cerrMutex;

class EchoConnection: public TCPServerConnection
{
public:
Expand All @@ -66,8 +69,10 @@ namespace
n = ss.receiveBytes(buffer, sizeof(buffer));
}
}
catch (Poco::Exception& exc)
catch (const Poco::Exception& exc)
{
Poco::FastMutex::ScopedLock l(cerrMutex);

std::cerr << "EchoConnection: " << exc.displayText() << std::endl;
}
}
Expand Down
5 changes: 5 additions & 0 deletions NetSSL_Win/testsuite/src/TCPServerTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "Poco/Util/Application.h"
#include "Poco/Util/AbstractConfiguration.h"
#include "Poco/Thread.h"
#include "Poco/Mutex.h"
#include <iostream>


Expand All @@ -44,6 +45,8 @@ using Poco::Util::Application;

namespace
{
static Poco::FastMutex cerrMutex;

class EchoConnection: public TCPServerConnection
{
public:
Expand All @@ -66,6 +69,8 @@ namespace
}
catch (Poco::Exception& exc)
{
Poco::FastMutex::ScopedLock l(cerrMutex);

std::cerr << "EchoConnection: " << exc.displayText() << std::endl;
}
}
Expand Down
Loading