Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1513172 - program compiled with both visibility=hidden and sanitize=undefined gets run time error
Summary: program compiled with both visibility=hidden and sanitize=undefined gets run ...
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 29
Hardware: x86_64
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-11-14 21:29 UTC by Gene Hightower
Modified: 2018-12-20 05:16 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:


Attachments (Terms of Use)
small program that show runtime error with -fvisibility=hidden (deleted)
2017-11-14 21:29 UTC, Gene Hightower
no flags Details

Description Gene Hightower 2017-11-14 21:29:21 UTC
Created attachment 1352165 [details]
small program that show runtime error with -fvisibility=hidden

Description of problem:

Compile with both visibility=hidden and sanitize=undefined and you get
a strange runtime error report from inside boost smart_ptr.

Remove the visibility=hidden and no report.


Version-Release number of selected component (if applicable):

$ gcc --version
gcc (GCC) 7.2.1 20170915 (Red Hat 7.2.1-2)
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ lsb_release -a
LSB Version:	:core-4.1-amd64:core-4.1-noarch
Distributor ID:	Fedora
Description:	Fedora release 27 (Twenty Seven)
Release:	27
Codename:	TwentySeven

How reproducible:


Steps to Reproduce:
$ g++ -fvisibility=hidden -fsanitize=undefined mfs.cpp -lboost_iostreams -lboost_system -o mfs && ./mfs

Actual results:

$ g++ -fvisibility=hidden -fsanitize=undefined mfs.cpp -lboost_iostreams -lboost_system -o mfs && ./mfs
/usr/include/boost/smart_ptr/detail/shared_count.hpp:419:36: runtime error: member call on address 0x000001ba2f20 which does not point to an object of type 'sp_counted_base'
0x000001ba2f20: note: object is of type 'boost::detail::sp_counted_impl_p<boost::iostreams::detail::mapped_file_impl>'
 00 00 00 00  e0 f5 e6 6c 5c 7f 00 00  01 00 00 00 01 00 00 00  90 2e ba 01 00 00 00 00  91 00 00 00
              ^~~~~~~~~~~~~~~~~~~~~~~
              vptr for 'boost::detail::sp_counted_impl_p<boost::iostreams::detail::mapped_file_impl>'
/usr/include/boost/smart_ptr/detail/sp_counted_base_std_atomic.hpp:109:20: runtime error: member call on address 0x000001ba2f20 which does not point to an object of type 'sp_counted_base'
0x000001ba2f20: note: object is of type 'boost::detail::sp_counted_impl_p<boost::iostreams::detail::mapped_file_impl>'
 00 00 00 00  e0 f5 e6 6c 5c 7f 00 00  00 00 00 00 01 00 00 00  90 2e ba 01 00 00 00 00  91 00 00 00
              ^~~~~~~~~~~~~~~~~~~~~~~
              vptr for 'boost::detail::sp_counted_impl_p<boost::iostreams::detail::mapped_file_impl>'
/usr/include/boost/smart_ptr/detail/sp_counted_base_std_atomic.hpp:110:25: runtime error: member call on address 0x000001ba2f20 which does not point to an object of type 'sp_counted_base'
0x000001ba2f20: note: object is of type 'boost::detail::sp_counted_impl_p<boost::iostreams::detail::mapped_file_impl>'
 00 00 00 00  e0 f5 e6 6c 5c 7f 00 00  00 00 00 00 01 00 00 00  90 2e ba 01 00 00 00 00  91 00 00 00
              ^~~~~~~~~~~~~~~~~~~~~~~
              vptr for 'boost::detail::sp_counted_impl_p<boost::iostreams::detail::mapped_file_impl>'
/usr/include/boost/smart_ptr/detail/sp_counted_base_std_atomic.hpp:123:20: runtime error: member call on address 0x000001ba2f20 which does not point to an object of type 'sp_counted_base'
0x000001ba2f20: note: object is of type 'boost::detail::sp_counted_impl_p<boost::iostreams::detail::mapped_file_impl>'
 00 00 00 00  e0 f5 e6 6c 5c 7f 00 00  00 00 00 00 00 00 00 00  90 2e ba 01 00 00 00 00  91 00 00 00
              ^~~~~~~~~~~~~~~~~~~~~~~
              vptr for 'boost::detail::sp_counted_impl_p<boost::iostreams::detail::mapped_file_impl>'

Expected results:

no runtime error, remove -fvisibility=hidden from above and see no error.
Additional info:

Comment 1 Florian Weimer 2017-11-14 21:46:12 UTC
Isn't the error essentially correct because with -fvisibility=hidden, the types are distinct?

Comment 2 Gene Hightower 2017-11-14 22:08:50 UTC
You got me: if boost::detail::sp_counted_impl_p<boost::iostreams::detail::mapped_file_impl> is publicly derived from sp_counted_base, why can't we call release()?  And why should the default visibility of hidden make any difference?  This may be beyond my simple understanding of the world.

Comment 3 Gene Hightower 2017-11-14 22:10:47 UTC
Does visibility change the types of my pointers?

Comment 4 Gene Hightower 2017-11-14 22:45:38 UTC
Are you saying that code in the liblboost_iostreams now has no access to
boost::detail::sp_counted_impl_p<boost::iostreams::detail::mapped_file_impl>
to know that it publicly derives from sp_counted_base?

Comment 5 Ben Cotton 2018-11-27 18:15:18 UTC
This message is a reminder that Fedora 27 is nearing its end of life.
On 2018-Nov-30  Fedora will stop maintaining and issuing updates for
Fedora 27. It is Fedora's policy to close all bug reports from releases
that are no longer maintained. At that time this bug will be closed as
EOL if it remains open with a Fedora  'version' of '27'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 27 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 6 Gene Hightower 2018-11-27 18:21:56 UTC
Nothing has changed with regard to this issue in the last two Fedora releases.

$ gcc --version
gcc (GCC) 8.2.1 20181105 (Red Hat 8.2.1-5)
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ lsb_release -a
LSB Version:	:core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch
Distributor ID:	Fedora
Description:	Fedora release 29 (Twenty Nine)
Release:	29
Codename:	TwentyNine

$ g++ -fvisibility=hidden -fsanitize=undefined mfs.cpp -lboost_iostreams -lboost_system -o mfs && ./mfs
/usr/include/boost/smart_ptr/detail/shared_count.hpp:426:36: runtime error: member call on address 0x000001b32f20 which does not point to an object of type 'sp_counted_base'
0x000001b32f20: note: object is of type 'boost::detail::sp_counted_impl_p<boost::iostreams::detail::mapped_file_impl>'
 00 00 00 00  60 d1 85 3e 8a 7f 00 00  01 00 00 00 01 00 00 00  90 2e b3 01 00 00 00 00  91 00 00 00
              ^~~~~~~~~~~~~~~~~~~~~~~
              vptr for 'boost::detail::sp_counted_impl_p<boost::iostreams::detail::mapped_file_impl>'
/usr/include/boost/smart_ptr/detail/sp_counted_base_std_atomic.hpp:110:20: runtime error: member call on address 0x000001b32f20 which does not point to an object of type 'sp_counted_base'
0x000001b32f20: note: object is of type 'boost::detail::sp_counted_impl_p<boost::iostreams::detail::mapped_file_impl>'
 00 00 00 00  60 d1 85 3e 8a 7f 00 00  00 00 00 00 01 00 00 00  90 2e b3 01 00 00 00 00  91 00 00 00
              ^~~~~~~~~~~~~~~~~~~~~~~
              vptr for 'boost::detail::sp_counted_impl_p<boost::iostreams::detail::mapped_file_impl>'
/usr/include/boost/smart_ptr/detail/sp_counted_base_std_atomic.hpp:111:25: runtime error: member call on address 0x000001b32f20 which does not point to an object of type 'sp_counted_base'
0x000001b32f20: note: object is of type 'boost::detail::sp_counted_impl_p<boost::iostreams::detail::mapped_file_impl>'
 00 00 00 00  60 d1 85 3e 8a 7f 00 00  00 00 00 00 01 00 00 00  90 2e b3 01 00 00 00 00  91 00 00 00
              ^~~~~~~~~~~~~~~~~~~~~~~
              vptr for 'boost::detail::sp_counted_impl_p<boost::iostreams::detail::mapped_file_impl>'
/usr/include/boost/smart_ptr/detail/sp_counted_base_std_atomic.hpp:124:20: runtime error: member call on address 0x000001b32f20 which does not point to an object of type 'sp_counted_base'
0x000001b32f20: note: object is of type 'boost::detail::sp_counted_impl_p<boost::iostreams::detail::mapped_file_impl>'
 00 00 00 00  60 d1 85 3e 8a 7f 00 00  00 00 00 00 00 00 00 00  90 2e b3 01 00 00 00 00  91 00 00 00
              ^~~~~~~~~~~~~~~~~~~~~~~
              vptr for 'boost::detail::sp_counted_impl_p<boost::iostreams::detail::mapped_file_impl>'

Comment 7 Gene Hightower 2018-12-20 05:16:16 UTC
Is this a "bug" or not?


Note You need to log in before you can comment on or make changes to this bug.