Skip to content

Conversation

@lorenzopivetta
Copy link
Owner

No description provided.

Marius Elvert and others added 30 commits December 17, 2019 17:06
The snprintf test was missing the declaration of the exit function.
This never found a working system snprintf implementation.

The fallout from this bug is that the LOG_* macros are not working as
e.g. TangoTest returns

1453759720 [140389277255488] INFO tangotest/tt/1 TangoTest::init_device::init device

Ready to accept request
1453759720 [140389141108480] INFO tangotest/tt/1 TangoTest::always_executed_hook()  TangoTest/tt/1
1453759720 [140389141108480] INFO tangotest/tt/1 TangoTest::always_executed_hook()  TangoTest/tt/1
1453759720 [140389141108480] INFO tangotest/tt/1 TangoTest::always_executed_hook()  TangoTest/tt/1
1453759720 [140389141108480] INFO tangotest/tt/1 TangoTest::always_executed_hook()  TangoTest/tt/1

instead of

1453842671 [139686148966208] INFO tangotest/tt/1 TangoTest::init_device::init device TangoTest/tt/1
1453842671 [139686148966208] DEBUG tangotest/tt/1 sleep_period=2000
1453842671 [139686148966208] DEBUG tangotest/tt/1 mthreaded_impl=0
1453842671 [139686148966208] DEBUG tangotest/tt/1 uShort_image_ro_size=251
Ready to accept request
1453842671 [139685942777600] INFO tangotest/tt/1 TangoTest::always_executed_hook()  TangoTest/tt/1

from the lines

TangoTest.cpp:  LOG_INFO(("TangoTest::init_device::init device %s", device_name.c_str()));
TangoTest.cpp:  LOG_DEBUG(("In read_attr_hardware for %d attributes",attr_list.size()));

Original report from the author of this commit at [1].

[1]: https://www.tango-controls.org/community/forum/c/development/c/log_-macros-not-working/
Undefine interface for Microsoft Visual Studio version 14.0.25431.01 Update 3
comming with _MSC_VER = 1900 to fix compilation error:
 "error C2236: unexpected token 'struct'. Did you forget a ';'?
Travis: Add testing with ubuntu 20.04 (aka focal)
Only install() PTHREAD_WIN files if it is enabled
The test runner will start a fresh environment
(database and device servers) for each test case.
The scripts are not needed anymore as ctest command sets
the test environment up.
If some tests failed during parallel run, try to re-run
them sequentially to see if the failure is permanent.
Extract setup scripts so that it is possible to run the setup manually
and then attach the debugger or perform some additional configuration.
Run up to (num of CPUs) tests in parallel to avoid overloading
the machine and to reduce the number of failures of unstable tests.
Since we are running up to (num of CPUs) tests in parallel, no failures
are expected.
The owning group of docker socket varies between different docker
packages and different operating systems. Official docker-ce package
uses gid 957 while docker.io package on Ubuntu 20.04 uses gid 103.
New group with matching gid matching docker host is added to the
cpp_tango container to allow tango user access the docker socket.
Sonar and Coveralls were disabled in 226d70c and this was unnoticed
until now. We again enable those integrations.
This PR resets the database and device servers for each tests.

There is a wrapper script: `run_with_fixture.sh <test-binary> [param1] [param2] ...`

The script:
  * starts docker with mysql and database ds
  * starts DevTest and FwdTest
  * runs <test-binary> (forwards all parameters)
  * stops DevTest and FwdTest
  * stops dockers
We don't use per target properties like cxx_std_11 as these are only
supported starting with cmake 3.8. So we set it globally instead.
This is way too old to work anymore as we now require C++11.
We now require C++11.

Done with unifdef -DHAS_UNIQUE_PTR
We now require C++11.

Done with unifdef -DHAS_MAP_AT
We now require C++11.

Done with unifdef -DHAS_OVERRIDE
We now require C++11.

Done with unifdef -DHAS_RVALUE
We now require C++11.

Done with unifdef -DHAS_THREAD
We now require C++11.

Done with unifdef -DHAS_TYPE_TRAITS
We now require C++11.

Done with unifdef -DHAS_LAMBDA_FUNC
t-b and others added 25 commits January 22, 2020 16:33
We now require C++11 so nullptr is always available. But we keep the
definitions of Tango_nullptr for backwards compatibility.
We now require C++11.

Done with unifdef -DHAS_RANGE_BASE_FOR
We now require C++11.

Done with unifdef -DINIT_LIST
We now require C++11.

Done with unifdef -DHAS_UNDERLYING
…feature checking

We now always require C++11.
This is just too old as it has only GCC 4.7.2.
Exposed with the new C++11 compilation, but ultimately forgotten in
cc8f943 (cppapi/server: Ignore warnings for generated code,
2019-11-15).
Found with -Winconsistent-missing-override using latest clang 9.0.
The only C++ feature we are currently using which is not supported by
C++11 is C++14 relaxed constexpr.

Instead of using the old school ifdef magic we now use a real feature
test.

This also requires to move the definition of TANGO_CONSTEXPR to
tango_const.h.in.
We now output cmake/compiler and platform versions for easier debugging.
Output like the CMAKE_BUILD_TYPE was also changed to be outputted always
regardless if default or not.
MSVC versions prior to VS 2015 (aka msvc14) don't have usable C++11
support. So we can't build on those anymore.

This was also decided in  [2] which said:

> Decision was taken to stop support for MSVC9, MSVC10 and MSVC12. The
> builds for these MSVC compiler versions will be removed from appveyor.
> If some users still need to compile cppTango using these compilers, they
> will need to fork cppTango and maintain a version compatible with these
> old compilers.

[1]: https://docs.microsoft.com/en-us/previous-versions/hh567368(v=vs.140)?redirectedfrom=MSDN#featurelist
[2]: https://github.com/tango-controls/tango-kernel-followup/blob/master/2019-02-04/outcomes.md
Removed with unifdef -D_MSC_VER=1900 and manual fixup of false matches.

We also remove the predefined WIN32_VC* definitions as nobody is using
them.
Support for MSVC below 2015 (aka vc14 aka _MSC_VER 1900) was removed in
a previous commit.
We nowadays alwas mark Except::throw_exception as [[noreturn]] therefore
all compiler should be able to figure out that the function does not
need a return value here.
CMakeLists.txt: Require C++11 and cmake 3.7
Fix interface name collission on MSC_VER = 1900
Fixes data race between:
* polling thread (EventSupplier::detect_and_push_xxx_event)
* and user thread pushing events (Attribute::fire_xxx_event)
Remove detect_mutex and protect detect_change method with
event_mutex to synchronize access to the old attribute value.

Fixes data race between:
* polling thread (EventSupplier::detect_and_push_xxx_event)
* and user thread pushing events (EventSupplier::detect_change)
Fixes data race between:
* omni worker thread (DServer::event_subscription)
* and user thread pushing events (Attribute::fire_xxx_event)
Redundant checks are removed to simplify the condition for enforcing
sending of change event. New condition is equivalent to the original
one. This is non-functional change.
…nt-push-attempt-2

Correction for race condition between polling threads and user threads pushing events.

Three different data races are addressed in the PR:
* All code that sets previous event value (like in below example) in attribute.cpp and eventsupplier.cpp, is protected by `event_mutex`,
* We remove `detect_mutex`. Previously it was protecting the whole `EventSupplier::detect_change`. Now this method is protected by `event_mutex`,
* Setting timestamps of last event subscription is protected now by `event_mutex`.

Fixes #511.
@lorenzopivetta lorenzopivetta merged commit 3d1b8e0 into lorenzopivetta:tango-9-lts Feb 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants