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 595653 - qpid c++ client library missing symbol `qpid::sys::Duration::Duration(qpid::sys::AbsTime&)'
Summary: qpid c++ client library missing symbol `qpid::sys::Duration::Duration(qpid::s...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: qpid-cpp
Version: Development
Hardware: All
OS: Linux
high
high
Target Milestone: 1.3
: ---
Assignee: Andrew Stitcher
QA Contact: MRG Quality Engineering
URL:
Whiteboard:
Depends On:
Blocks: 595788
TreeView+ depends on / blocked
 
Reported: 2010-05-25 09:55 UTC by Frantisek Reznicek
Modified: 2015-11-16 01:12 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-05-25 14:17:43 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Frantisek Reznicek 2010-05-25 09:55:17 UTC
Description of problem:

There is recent change in qpid::sys::Duration::Duration() c++ client library which causes all c++ clients using qpid::sys::Duration::Duration(qpid::sys::AbsTime&) call to be not compilable:

[root@mrg-qe-07 c++]# g++ ${cli_fn}.cpp -Wall -O3 -ggdb -I/usr/include/qpid-boost     -lqpidclient -o ${cli_fn}
qc_tsxtest.cpp: In constructor `Opts::Opts()':
qc_tsxtest.cpp:114: warning: `Opts::events' will be initialized after
qc_tsxtest.cpp:107: warning:   `int Opts::rate'
qc_tsxtest.cpp:130: warning:   when initialized here
qc_tsxtest.cpp:113: warning: `Opts::depth' will be initialized after
qc_tsxtest.cpp:89: warning:   `bool Opts::run_now'
qc_tsxtest.cpp:130: warning:   when initialized here
qc_tsxtest.cpp:117: warning: `Opts::ring_d' will be initialized after
qc_tsxtest.cpp:115: warning:   `int Opts::symbol_queues'
qc_tsxtest.cpp:130: warning:   when initialized here
qc_tsxtest.cpp: In function `std::string timeStr(qpid::sys::AbsTime)':
qc_tsxtest.cpp:274: error: no matching function for call to `qpid::sys::Duration::Duration(qpid::sys::AbsTime&)'
/usr/include/qpid/sys/Time.h:115: note: candidates are: qpid::sys::Duration::Duration(const qpid::sys::Duration&)
/usr/include/qpid/sys/Time.h:123: note:                 qpid::sys::Duration::Duration(const qpid::sys::AbsTime&, const qpid::sys::AbsTime&)
/usr/include/qpid/sys/Time.h:136: note:                 qpid::sys::Duration::Duration(int64_t)
qc_tsxtest.cpp: In constructor `SMRStats::SMRStats()':
qc_tsxtest.cpp:699: warning: `SMRStats::end' will be initialized after
qc_tsxtest.cpp:696: warning:   `int64_t SMRStats::delay[3]'
qc_tsxtest.cpp:702: warning:   when initialized here
qc_tsxtest.cpp: In constructor `Smr::Smr()':
qc_tsxtest.cpp:757: warning: `Smr::expect' will be initialized after
qc_tsxtest.cpp:756: warning:   `int Smr::msg_cnt'
qc_tsxtest.cpp:760: warning:   when initialized here
qc_tsxtest.cpp: In constructor `Report::Report()':
qc_tsxtest.cpp:883: warning: `Report::expect' will be initialized after
qc_tsxtest.cpp:880: warning:   `int64_t Report::max_l'
qc_tsxtest.cpp:885: warning:   when initialized here
[root@mrg-qe-07 c++]# echo $?
1

It looks like 
qpid::sys::Duration::Duration(const qpid::sys::AbsTime&, 
                              const qpid::sys::AbsTime&)
candidate should have second parameter with default value like this:
qpid::sys::Duration::Duration(const qpid::sys::AbsTime&, 
                              const qpid::sys::AbsTime& = N)


Version-Release number of selected component (if applicable):
qpid-cpp-*0.7.946106-1.el[45]

How reproducible:
100%

Steps to Reproduce:
1. compile a client with qpid::sys::Duration::Duration(qpid::sys::AbsTime&) call
  
Actual results:
Client does not compile.

Expected results:
Client should compile fine.

Additional info:

Comment 1 Frantisek Reznicek 2010-05-25 09:57:39 UTC
This issue breaks ABI compatibility between releases.

Comment 2 Frantisek Reznicek 2010-05-25 10:06:40 UTC
It seems that 937147 commit introduced the issue:
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/include/qpid/sys/Time.h?r1=931995&r2=937147&diff_format=h

Comment 3 Andrew Stitcher 2010-05-25 14:16:36 UTC
This removal was deliberate, and was not in the API/ABI poart of the library.

The timing classes are only exposed incidentally to clients.

The major reason for the removal is that the meaning of constructing a Duration from an AbsTime is ambiguous, and potentially different between platforms, as it was just exposing the underlying nanosecond count. You can only meaningfully construct a duration from the difference between two absolute times.

We've now added a constant AbsTime::EPOCH which corresponds to the absolute time at the Unix Epoch, so you can construct what you probably wanted all along.

If you've code like this then you need to replace it with something like:

Duration d(AbsTime::EPOCH, time);


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