Opened 6 years ago

Last modified 3 years ago

#3160 assigned defect

boost::lexical_cast failure on Solaris with SunStudio

Reported by: muks Owned by: UnAssigned
Priority: medium Milestone: Solaris and other unsupported
Component: logging Version:
Keywords: Cc:
CVSS Scoring: Parent Tickets:
Sensitive: no Defect Severity: N/A
Sub-Project: DNS Feature Depending on Ticket:
Estimated Difficulty: 4 Add Hours to Ticket: 0
Total Hours: 0 Internal?: no

Description (last modified by tomek)

We now require a newer version of Boost. This has caused various build failures on different platforms. This is one of them:

boost::lexical_cast fails compile on Solaris with SunStudio?:

libtool: compile:  /usr/bin/CC -DHAVE_CONFIG_H -I. -I../../../.. -I../../../../src/lib -I../../../../src/lib -I../../../../src/lib/dns -I../../../../src/lib/dns -I/udir/jreed/pkg/include -D_XPG4_2 -D__EXTENSIONS__ -DOS_SUN -DBOOST_DISABLE_THREADS=1 -I../../../../ext/asio -I../../../../ext/coroutine -DASIO_DISABLE_THREADS=1 -g -library=stlport4 -features=tmplife -features=tmplrefstatic -c zone_finder.cc  -KPIC -DPIC -o .libs/zone_finder.o
"../../../../src/lib/log/log_formatter.h", line 198: Error: isc::dns::AbstractRRset::AbstractRRset(const isc::dns::AbstractRRset&) is not accessible from isc::log::Formatter<isc::log::Logger>::arg<isc::dns::AbstractRRset>(const isc::dns::AbstractRRset&).
"../../../../src/lib/log/log_formatter.h", line 198: Error: Formal argument arg of type isc::dns::AbstractRRset in call to boost::lexical_cast<std::string, isc::dns::AbstractRRset>(isc::dns::AbstractRRset) has an inaccessible copy constructor.

See full compile log:
http://git.bind10.isc.org/~tester/builder/BIND10/20130910064517-Solaris10-sparc-Sunstudio/logs/build.out

Brief analysis:

The copy constructor is indeed private, but I don't see why it would be
used in this case. Is it trying to make a new non-const instance out of
the const reference during lexical_cast<std::string,
isc::dns::AbstractRRset> due to the guessed template argument being
non-const?

Subtickets

Attachments (2)

0001-master-Explicitly-cast-to-const-argument-type.patch (1.1 KB) - added by muks 6 years ago.
Does this patch help?
0001-3160-Log-text-representation-of-the-AbstractRRset.patch (1.4 KB) - added by muks 6 years ago.
Alternate patch if the first one doesn't work. Use either the first or the second, not both.

Download all attachments as: .zip

Change History (14)

Changed 6 years ago by muks

Does this patch help?

Changed 6 years ago by muks

Alternate patch if the first one doesn't work. Use either the first or the second, not both.

comment:1 follow-up: Changed 6 years ago by jreed

first patch results in:

libtool: compile:  /usr/bin/CC -DHAVE_CONFIG_H -I. -I../../../.. -I../../../../src/lib -I../../../../src/lib -I../../../../src/lib/dns -I../../../../src/lib/dns -I/udir/jreed/pkg/include -D_XPG4_2 -D__EXTENSIONS__ -DOS_SUN -DBOOST_DISABLE_THREADS=1 -I../../../../ext/asio -I../../../../ext/coroutine -DASIO_DISABLE_THREADS=1 -g -library=stlport4 -features=tmplife -features=tmplrefstatic -c zone_finder.cc  -KPIC -DPIC -o .libs/zone_finder.o
"/udir/jreed/pkg/include/boost/lexical_cast.hpp", line 2641: Error: Cannot define a reference or pointer to a reference.
"/udir/jreed/pkg/include/boost/lexical_cast.hpp", line 2700:     Where: While specializing "boost::detail::lexical_stream<std::string, const isc::dns::AbstractRRset&, std::char_traits<char>>".
"/udir/jreed/pkg/include/boost/lexical_cast.hpp", line 2700:     Where: Instantiated from boost::lexical_cast<std::string, const isc::dns::AbstractRRset&>(const isc::dns::AbstractRRset&).
"../../../../src/lib/log/log_formatter.h", line 199:     Where: Instantiated from non-template code.
1 Error(s) detected.

second patch results in:

libtool: compile:  /usr/bin/CC -DHAVE_CONFIG_H -I. -I../../.. -I../../../src/lib -I../../../src/lib -I../../../src/lib/dns -I../../../src/lib/dns -I/udir/jreed/pkg/include -I/udir/jreed/pkg/include -D_XPG4_2 -D__EXTENSIONS__ -DOS_SUN -DBOOST_DISABLE_THREADS=1 -I../../../ext/asio -I../../../ext/coroutine -DASIO_DISABLE_THREADS=1 -g -library=stlport4 -features=tmplife -features=tmplrefstatic -c database.cc  -KPIC -DPIC -o .libs/database.o
"../../../src/lib/log/log_formatter.h", line 198: Error: isc::dns::AbstractRRset::AbstractRRset(const isc::dns::AbstractRRset&) is not accessible from isc::log::Formatter<isc::log::Logger>::arg<isc::dns::AbstractRRset>(const isc::dns::AbstractRRset&).
"../../../src/lib/log/log_formatter.h", line 198: Error: Formal argument arg of type isc::dns::AbstractRRset in call to boost::lexical_cast<std::string, isc::dns::AbstractRRset>(isc::dns::AbstractRRset) has an inaccessible copy constructor.
2 Error(s) detected.
*** Error code 1

(which appears to be same problem in original report)

comment:2 in reply to: ↑ 1 Changed 6 years ago by muks

Hi Jeremy

Replying to jreed:

second patch results in:

libtool: compile:  /usr/bin/CC -DHAVE_CONFIG_H -I. -I../../.. -I../../../src/lib -I../../../src/lib -I../../../src/lib/dns -I../../../src/lib/dns -I/udir/jreed/pkg/include -I/udir/jreed/pkg/include -D_XPG4_2 -D__EXTENSIONS__ -DOS_SUN -DBOOST_DISABLE_THREADS=1 -I../../../ext/asio -I../../../ext/coroutine -DASIO_DISABLE_THREADS=1 -g -library=stlport4 -features=tmplife -features=tmplrefstatic -c database.cc  -KPIC -DPIC -o .libs/database.o
"../../../src/lib/log/log_formatter.h", line 198: Error: isc::dns::AbstractRRset::AbstractRRset(const isc::dns::AbstractRRset&) is not accessible from isc::log::Formatter<isc::log::Logger>::arg<isc::dns::AbstractRRset>(const isc::dns::AbstractRRset&).
"../../../src/lib/log/log_formatter.h", line 198: Error: Formal argument arg of type isc::dns::AbstractRRset in call to boost::lexical_cast<std::string, isc::dns::AbstractRRset>(isc::dns::AbstractRRset) has an inaccessible copy constructor.
2 Error(s) detected.
*** Error code 1

(which appears to be same problem in original report)

This is now in a different file, so the patch worked. There is more (similar) fixing to do.

Thank you for testing it. :) I'll try to get a build going on the SPARC box itself to fix all outstanding issues.

comment:3 Changed 6 years ago by muks

  • Milestone changed from Next-Sprint-Proposed to Sprint-20130917
  • Owner set to muks
  • Status changed from new to assigned

comment:4 Changed 6 years ago by muks

Please don't consider the patches in this ticket anymore.

A set of fixes including the working patch are now in the trac3160 branch. I'm waiting for a successful report from the builders before putting it to review.

comment:5 Changed 6 years ago by muks

  • Estimated Difficulty changed from 0 to 4

comment:6 Changed 6 years ago by muks

I want to add an update:

Though the issue in this ticket passes, there are several new issues that show up in libraries due to bad lexical_cast implementation, such as improper overflow/underflow handling. There is something very wrong in the Boost lexical_cast implementation, and it seems that we need not fix our code for it.

comment:7 Changed 6 years ago by muks

  • Owner changed from muks to UnAssigned

I'm setting this back to unassigned as I'm no longer working on it.

comment:8 Changed 6 years ago by stephen

  • Milestone changed from bind10-1.2-release-freeze to Common Outstanding Tasks

comment:9 Changed 4 years ago by tomek

  • Milestone changed from Common Outstanding Tasks to DHCP Outstanding Tasks

comment:10 Changed 4 years ago by tomek

  • Milestone changed from DHCP Outstanding Tasks to Outstanding Tasks

Milestone renamed

comment:11 Changed 3 years ago by tomek

  • Description modified (diff)
  • Milestone changed from Outstanding Tasks to Solaris-and-exotic-systems

comment:12 Changed 3 years ago by tomek

  • Milestone changed from Solaris-and-exotic-systems to Solaris and other unsupported

Milestone renamed

Note: See TracTickets for help on using tickets.