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

Bad initialization of performance counters #130

Closed
brycelelbach opened this issue Jul 10, 2012 · 2 comments

Comments

Projects
None yet
1 participant
@brycelelbach
Copy link
Member

commented Jul 10, 2012

[reported by blelbach] [Trac time Wed Sep 21 04:08:59 2011] Hartmut,

Neglecting field initializers in GCC is very dangerous. The neglected fields will /NOT/ be default initialized. This is particularly bad for the std::string data members which may end up with pointers initialized to random values.

Scanning dependencies of target hpx_serialization
[  0%] [  0%] [  4%] Building CXX object src/CMakeFiles/hpx_serialization.dir/util/binary_portable_archives.cpp.o
Building CXX object src/CMakeFiles/hpx_serialization.dir/util/portable_binary_iarchive.cpp.o
Building CXX object src/CMakeFiles/hpx_serialization.dir/util/portable_binary_oarchive.cpp.o
Scanning dependencies of target hpx_init
[  4%] Building CXX object src/CMakeFiles/hpx_init.dir/hpx_init.cpp.o
Linking CXX shared library ../lib/libhpx_serialization.so
[  4%] Built target hpx_serialization
Scanning dependencies of target hpx
[  4%] [  8%] [  8%] Building CXX object src/CMakeFiles/hpx.dir/exception.cpp.o
[ 12%] [ 12%] Building CXX object src/CMakeFiles/hpx.dir/exception_list.cpp.o
Building CXX object src/CMakeFiles/hpx.dir/pre_main.cpp.o
[ 12%] Building CXX object src/CMakeFiles/hpx.dir/state.cpp.o
[ 16%] Building CXX object src/CMakeFiles/hpx.dir/version.cpp.o
[ 16%] [ 20%] Building CXX object src/CMakeFiles/hpx.dir/lcos/base_lco.cpp.o
Building CXX object src/CMakeFiles/hpx.dir/runtime.cpp.o
Building CXX object src/CMakeFiles/hpx.dir/lcos/local_counting_semaphore.cpp.o
[ 20%] Building CXX object src/CMakeFiles/hpx.dir/lcos/barrier/barrier.cpp.o
[ 20%] [ 24%] Building CXX object src/CMakeFiles/hpx.dir/performance_counters/counters.cpp.o
Building CXX object src/CMakeFiles/hpx.dir/performance_counters/manage_counter_type.cpp.o
[ 24%] [ 28%] Building CXX object src/CMakeFiles/hpx.dir/performance_counters/manage_counter.cpp.o
Building CXX object src/CMakeFiles/hpx.dir/performance_counters/registry.cpp.o
[ 28%] [ 28%] Building CXX object src/CMakeFiles/hpx.dir/performance_counters/server/raw_counter.cpp.o
[ 32%] Building CXX object src/CMakeFiles/hpx.dir/performance_counters/server/elapsed_time_counter.cpp.o
Building CXX object src/CMakeFiles/hpx.dir/performance_counters/stubs/performance_counter.cpp.o
[ 32%] [ 32%] Building CXX object src/CMakeFiles/hpx.dir/runtime/actions/action_manager.cpp.o
[ 36%] Building CXX object src/CMakeFiles/hpx.dir/runtime/actions/continuation.cpp.o
[ 36%] Building CXX object src/CMakeFiles/hpx.dir/runtime/agas/router/big_boot_barrier.cpp.o
Building CXX object src/CMakeFiles/hpx.dir/runtime/agas/router/legacy.cpp.o
[ 40%] [ 40%] Building CXX object src/CMakeFiles/hpx.dir/runtime/agas/stdmap_tcpip/component_module.cpp.o
[ 40%] Building CXX object src/CMakeFiles/hpx.dir/runtime/agas/stdmap_tcpip/primary_namespace.cpp.o
[ 44%] Building CXX object src/CMakeFiles/hpx.dir/runtime/agas/stdmap_tcpip/component_namespace.cpp.o
[ 44%] Building CXX object src/CMakeFiles/hpx.dir/runtime/agas/stdmap_tcpip/symbol_namespace.cpp.o
[ 48%] [ 48%] Building CXX object src/CMakeFiles/hpx.dir/runtime/applier/bind_naming_wrappers.cpp.o
[ 48%] Building CXX object src/CMakeFiles/hpx.dir/runtime/applier/applier.cpp.o
Building CXX object src/CMakeFiles/hpx.dir/runtime/components/component_type.cpp.o
Building CXX object src/CMakeFiles/hpx.dir/runtime/components/console_error_sink.cpp.o
[ 52%] [ 52%] Building CXX object src/CMakeFiles/hpx.dir/runtime/components/console_logging.cpp.o
[ 56%] [ 56%] Building CXX object src/CMakeFiles/hpx.dir/runtime/components/server/console_error_sink.cpp.o
Building CXX object src/CMakeFiles/hpx.dir/runtime/components/server/console_error_sink_singleton.cpp.o
[ 56%] Building CXX object src/CMakeFiles/hpx.dir/runtime/components/server/console_logging.cpp.o
[ 60%] Building CXX object src/CMakeFiles/hpx.dir/runtime/components/server/memory.cpp.o
Building CXX object src/CMakeFiles/hpx.dir/runtime/components/server/memory_block.cpp.o
[ 60%] [ 60%] [ 64%] Building CXX object src/CMakeFiles/hpx.dir/runtime/components/server/runtime_support.cpp.o
[ 64%] Building CXX object src/CMakeFiles/hpx.dir/runtime/naming/address.cpp.o
Building CXX object src/CMakeFiles/hpx.dir/runtime/naming/name.cpp.o
Building CXX object src/CMakeFiles/hpx.dir/runtime/naming/resolver_server.cpp.o
Building CXX object src/CMakeFiles/hpx.dir/runtime/naming/locality.cpp.o
[ 68%] Building CXX object src/CMakeFiles/hpx.dir/runtime/naming/server/reply.cpp.o
[ 68%] Building CXX object src/CMakeFiles/hpx.dir/runtime/naming/server/request.cpp.o
[ 68%] Building CXX object src/CMakeFiles/hpx.dir/runtime/naming/server/request_handler.cpp.o
[ 72%] Building CXX object src/CMakeFiles/hpx.dir/runtime/parcelset/parcel.cpp.o
[ 72%] Building CXX object src/CMakeFiles/hpx.dir/runtime/parcelset/parcelport.cpp.o
[ 76%] Building CXX object src/CMakeFiles/hpx.dir/runtime/parcelset/parcelport_connection.cpp.o
[ 76%] Building CXX object src/CMakeFiles/hpx.dir/runtime/parcelset/parcelhandler_v2.cpp.o
[ 76%] Building CXX object src/CMakeFiles/hpx.dir/runtime/threads/thread.cpp.o
[ 80%] Building CXX object src/CMakeFiles/hpx.dir/runtime/threads/thread_helpers.cpp.o
[ 80%] Building CXX object src/CMakeFiles/hpx.dir/runtime/threads/threadmanager.cpp.o
[ 84%] Building CXX object src/CMakeFiles/hpx.dir/util/ini.cpp.o
/home/wash/hpx_clean/src/runtime.cpp: In member function ‘void hpx::runtime::install_counters()’:
/home/wash/hpx_clean/src/runtime.cpp:729:9: warning: missing initializer for member ‘hpx::performance_counters::counter_type_data::helptext_’ [-Wmissing-field-initializers]
/home/wash/hpx_clean/src/runtime.cpp:729:9: warning: missing initializer for member ‘hpx::performance_counters::counter_type_data::version_’ [-Wmissing-field-initializers]
/home/wash/hpx_clean/src/runtime.cpp:738:9: warning: missing initializer for member ‘hpx::performance_counters::counter_data::func_’ [-Wmissing-field-initializers]
[ 84%] Building CXX object src/CMakeFiles/hpx.dir/util/init_ini_data.cpp.o
/home/wash/hpx_clean/src/runtime/parcelset/parcelhandler_v2.cpp: In member function ‘void hpx::parcelset::parcelhandler::install_counters()’:
/home/wash/hpx_clean/src/runtime/parcelset/parcelhandler_v2.cpp:302:9: warning: missing initializer for member ‘hpx::performance_counters::counter_type_data::version_’ [-Wmissing-field-initializers]
/home/wash/hpx_clean/src/runtime/parcelset/parcelhandler_v2.cpp:302:9: warning: missing initializer for member ‘hpx::performance_counters::counter_type_data::version_’ [-Wmissing-field-initializers]
[ 84%] Building CXX object src/CMakeFiles/hpx.dir/util/itt_notify.cpp.o
[ 88%] Building CXX object src/CMakeFiles/hpx.dir/util/logging.cpp.o
[ 88%] Building CXX object src/CMakeFiles/hpx.dir/util/performance_counters.cpp.o
[ 92%] Building CXX object src/CMakeFiles/hpx.dir/util/runtime_configuration.cpp.o
[ 92%] Building CXX object src/CMakeFiles/hpx.dir/util/asio_util.cpp.o
[ 92%] Building CXX object src/CMakeFiles/hpx.dir/util/io_service_pool.cpp.o
[ 96%] [ 96%] Building CXX object src/CMakeFiles/hpx.dir/util/serialize_exception.cpp.o
Building CXX object src/CMakeFiles/hpx.dir/util/generate_unique_ids_v2.cpp.o
[ 96%] Building CXX object src/CMakeFiles/hpx.dir/__/external/backtrace/libs/backtrace/src/backtrace.cpp.o
[100%] Building CXX object src/CMakeFiles/hpx.dir/__/external/coroutine/libs/coroutine/src/swapcontext.cpp.o
/home/wash/hpx_clean/src/runtime/threads/threadmanager.cpp: In member function ‘void hpx::threads::threadmanager_impl<SchedulingPolicy, NotificationPolicy>::install_counters() [with SchedulingPolicy = hpx::threads::policies::global_queue_scheduler, NotificationPolicy = hpx::threads::policies::callback_notifier]’:
/home/wash/hpx_clean/src/runtime/threads/threadmanager.cpp:1431:41:   instantiated from here
/home/wash/hpx_clean/src/runtime/threads/threadmanager.cpp:994:9: warning: missing initializer for member ‘hpx::performance_counters::counter_type_data::version_’ [-Wmissing-field-initializers]
/home/wash/hpx_clean/src/runtime/threads/threadmanager.cpp:994:9: warning: missing initializer for member ‘hpx::performance_counters::counter_type_data::version_’ [-Wmissing-field-initializers]
/home/wash/hpx_clean/src/runtime/threads/threadmanager.cpp:994:9: warning: missing initializer for member ‘hpx::performance_counters::counter_type_data::version_’ [-Wmissing-field-initializers]
/home/wash/hpx_clean/src/runtime/threads/threadmanager.cpp:994:9: warning: missing initializer for member ‘hpx::performance_counters::counter_type_data::version_’ [-Wmissing-field-initializers]
/home/wash/hpx_clean/src/runtime/threads/threadmanager.cpp:994:9: warning: missing initializer for member ‘hpx::performance_counters::counter_type_data::version_’ [-Wmissing-field-initializers]
/home/wash/hpx_clean/src/runtime/threads/threadmanager.cpp:994:9: warning: missing initializer for member ‘hpx::performance_counters::counter_type_data::version_’ [-Wmissing-field-initializers]
/home/wash/hpx_clean/src/runtime/threads/threadmanager.cpp:994:9: warning: missing initializer for member ‘hpx::performance_counters::counter_type_data::version_’ [-Wmissing-field-initializers]
/home/wash/hpx_clean/src/runtime/threads/threadmanager.cpp:994:9: warning: missing initializer for member ‘hpx::performance_counters::counter_type_data::helptext_’ [-Wmissing-field-initializers]
/home/wash/hpx_clean/src/runtime/threads/threadmanager.cpp:994:9: warning: missing initializer for member ‘hpx::performance_counters::counter_type_data::version_’ [-Wmissing-field-initializers]
/home/wash/hpx_clean/src/runtime/threads/threadmanager.cpp: In member function ‘void hpx::threads::threadmanager_impl<SchedulingPolicy, NotificationPolicy>::install_counters() [with SchedulingPolicy = hpx::threads::policies::local_queue_scheduler, NotificationPolicy = hpx::threads::policies::callback_notifier]’:
/home/wash/hpx_clean/src/runtime/threads/threadmanager.cpp:1435:41:   instantiated from here
/home/wash/hpx_clean/src/runtime/threads/threadmanager.cpp:994:9: warning: missing initializer for member ‘hpx::performance_counters::counter_type_data::version_’ [-Wmissing-field-initializers]
/home/wash/hpx_clean/src/runtime/threads/threadmanager.cpp:994:9: warning: missing initializer for member ‘hpx::performance_counters::counter_type_data::version_’ [-Wmissing-field-initializers]
/home/wash/hpx_clean/src/runtime/threads/threadmanager.cpp:994:9: warning: missing initializer for member ‘hpx::performance_counters::counter_type_data::version_’ [-Wmissing-field-initializers]
/home/wash/hpx_clean/src/runtime/threads/threadmanager.cpp:994:9: warning: missing initializer for member ‘hpx::performance_counters::counter_type_data::version_’ [-Wmissing-field-initializers]
/home/wash/hpx_clean/src/runtime/threads/threadmanager.cpp:994:9: warning: missing initializer for member ‘hpx::performance_counters::counter_type_data::version_’ [-Wmissing-field-initializers]
/home/wash/hpx_clean/src/runtime/threads/threadmanager.cpp:994:9: warning: missing initializer for member ‘hpx::performance_counters::counter_type_data::version_’ [-Wmissing-field-initializers]
/home/wash/hpx_clean/src/runtime/threads/threadmanager.cpp:994:9: warning: missing initializer for member ‘hpx::performance_counters::counter_type_data::version_’ [-Wmissing-field-initializers]
/home/wash/hpx_clean/src/runtime/threads/threadmanager.cpp:994:9: warning: missing initializer for member ‘hpx::performance_counters::counter_type_data::helptext_’ [-Wmissing-field-initializers]
/home/wash/hpx_clean/src/runtime/threads/threadmanager.cpp:994:9: warning: missing initializer for member ‘hpx::performance_counters::counter_type_data::version_’ [-Wmissing-field-initializers]
/home/wash/hpx_clean/src/runtime/threads/threadmanager.cpp: In member function ‘void hpx::threads::threadmanager_impl<SchedulingPolicy, NotificationPolicy>::install_counters() [with SchedulingPolicy = hpx::threads::policies::local_priority_queue_scheduler, NotificationPolicy = hpx::threads::policies::callback_notifier]’:
/home/wash/hpx_clean/src/runtime/threads/threadmanager.cpp:1439:41:   instantiated from here
/home/wash/hpx_clean/src/runtime/threads/threadmanager.cpp:994:9: warning: missing initializer for member ‘hpx::performance_counters::counter_type_data::version_’ [-Wmissing-field-initializers]
/home/wash/hpx_clean/src/runtime/threads/threadmanager.cpp:994:9: warning: missing initializer for member ‘hpx::performance_counters::counter_type_data::version_’ [-Wmissing-field-initializers]
/home/wash/hpx_clean/src/runtime/threads/threadmanager.cpp:994:9: warning: missing initializer for member ‘hpx::performance_counters::counter_type_data::version_’ [-Wmissing-field-initializers]
/home/wash/hpx_clean/src/runtime/threads/threadmanager.cpp:994:9: warning: missing initializer for member ‘hpx::performance_counters::counter_type_data::version_’ [-Wmissing-field-initializers]
/home/wash/hpx_clean/src/runtime/threads/threadmanager.cpp:994:9: warning: missing initializer for member ‘hpx::performance_counters::counter_type_data::version_’ [-Wmissing-field-initializers]
/home/wash/hpx_clean/src/runtime/threads/threadmanager.cpp:994:9: warning: missing initializer for member ‘hpx::performance_counters::counter_type_data::version_’ [-Wmissing-field-initializers]
/home/wash/hpx_clean/src/runtime/threads/threadmanager.cpp:994:9: warning: missing initializer for member ‘hpx::performance_counters::counter_type_data::version_’ [-Wmissing-field-initializers]
/home/wash/hpx_clean/src/runtime/threads/threadmanager.cpp:994:9: warning: missing initializer for member ‘hpx::performance_counters::counter_type_data::helptext_’ [-Wmissing-field-initializers]
/home/wash/hpx_clean/src/runtime/threads/threadmanager.cpp:994:9: warning: missing initializer for member ‘hpx::performance_counters::counter_type_data::version_’ [-Wmissing-field-initializers]
/home/wash/hpx_clean/src/runtime/threads/threadmanager.cpp: In member function ‘void hpx::threads::threadmanager_impl<SchedulingPolicy, NotificationPolicy>::install_counters() [with SchedulingPolicy = hpx::threads::policies::abp_queue_scheduler, NotificationPolicy = hpx::threads::policies::callback_notifier]’:
/home/wash/hpx_clean/src/runtime/threads/threadmanager.cpp:1443:41:   instantiated from here
/home/wash/hpx_clean/src/runtime/threads/threadmanager.cpp:994:9: warning: missing initializer for member ‘hpx::performance_counters::counter_type_data::version_’ [-Wmissing-field-initializers]
/home/wash/hpx_clean/src/runtime/threads/threadmanager.cpp:994:9: warning: missing initializer for member ‘hpx::performance_counters::counter_type_data::version_’ [-Wmissing-field-initializers]
/home/wash/hpx_clean/src/runtime/threads/threadmanager.cpp:994:9: warning: missing initializer for member ‘hpx::performance_counters::counter_type_data::version_’ [-Wmissing-field-initializers]
/home/wash/hpx_clean/src/runtime/threads/threadmanager.cpp:994:9: warning: missing initializer for member ‘hpx::performance_counters::counter_type_data::version_’ [-Wmissing-field-initializers]
/home/wash/hpx_clean/src/runtime/threads/threadmanager.cpp:994:9: warning: missing initializer for member ‘hpx::performance_counters::counter_type_data::version_’ [-Wmissing-field-initializers]
/home/wash/hpx_clean/src/runtime/threads/threadmanager.cpp:994:9: warning: missing initializer for member ‘hpx::performance_counters::counter_type_data::version_’ [-Wmissing-field-initializers]
/home/wash/hpx_clean/src/runtime/threads/threadmanager.cpp:994:9: warning: missing initializer for member ‘hpx::performance_counters::counter_type_data::version_’ [-Wmissing-field-initializers]
/home/wash/hpx_clean/src/runtime/threads/threadmanager.cpp:994:9: warning: missing initializer for member ‘hpx::performance_counters::counter_type_data::helptext_’ [-Wmissing-field-initializers]
/home/wash/hpx_clean/src/runtime/threads/threadmanager.cpp:994:9: warning: missing initializer for member ‘hpx::performance_counters::counter_type_data::version_’ [-Wmissing-field-initializers]
@brycelelbach

This comment has been minimized.

Copy link
Member Author

commented Jul 10, 2012

[comment by hkaiser] [Trac time Wed Sep 21 11:14:19 2011] Replying to [ticket:130 blelbach]:

Hartmut,

Neglecting field initializers in GCC is very dangerous. The neglected
fields will /NOT/ be default initialized. This is particularly bad for
the std::string data members which may end up with pointers initialized
to random values.

That's clearly not standard conformant. Will fix anyways.

@brycelelbach

This comment has been minimized.

Copy link
Member Author

commented Jul 10, 2012

[comment by hkaiser] [Trac time Wed Sep 21 13:27:31 2011] Fixed in rev. [5521]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.