Opened 9 years ago
Closed 8 years ago
#9266 closed Bugs (worksforme)
Synchronized_value crashes MSVC12 (VS2013)
Reported by: | Owned by: | viboes | |
---|---|---|---|
Milestone: | To Be Determined | Component: | config |
Version: | Boost Development Trunk | Severity: | Problem |
Keywords: | Cc: |
Description (last modified by )
I got the crash using the following full code (using boost trunk r86347 ):
#include<boost/thread/synchronized_value.hpp> boost::synchronized_value<int> foo;
Which produce the following error (ignore the file name, it contains exactly the code above):
1> clock.cpp 1>e:\projects\sdk\boost\boost\include\boost-1_55\boost\thread\synchronized_value.hpp(401): fatal error C1001: An internal error has occurred in the compiler. 1> (compiler file 'f:\dd\vctools\compiler\cxxfe\sl\p1\c\types.c', line 12852) 1> To work around this problem, try simplifying or changing the program near the locations listed above. 1> Please choose the Technical Support command on the Visual C++ 1> Help menu, or open the Technical Support help file for more information 1> e:\projects\games\netrush\netrush_projects\projects\netrush\system\core\clock.hpp(120) : see reference to class template instantiation 'boost::synchronized_value<int,boost::mutex>' being compiled Build has been canceled.
Note that I reported another problem similar in MSVC12 RC: connect.microsoft.com/VisualStudio/feedback/details/802157/compiler-crash-mixing-boost-synchronized-value-and-boost-property-tree I'm not sure if it's related.
Change History (9)
follow-up: 3 comment:1 by , 9 years ago
comment:2 by , 9 years ago
Description: | modified (diff) |
---|---|
Owner: | changed from | to
Status: | new → assigned |
comment:3 by , 9 years ago
Replying to mjklaim@…:
Removing the ifdefs in the synchronized_value related to BOOST_NO_CXX11_VARIADIC_TEMPLATES, and taking the code using variadic templates does fix the problem for me.
Please, could you provide a patch that resolve the issue, I don't understand which part must be removed in your case.
comment:4 by , 9 years ago
Sorry! I meant:
- go into synchronized_value.hpp
- search ifdefs testing BOOST_NO_CXX11_VARIADIC_TEMPLATES (there are 2 if I'm correct)
- remove the ifdef and keep only the code that does use variadic templates.
Then boost::synchronized_value<int>
does compile for me.
I also forgot to say that I'm using the last boost thread interface (V4?).
I'm currently recompiling this revision of trunk boost with BOOST_NO_CXX11_VARIADIC_TEMPLATES defined only for MSVC <= VC11 , see if it impacts my current code (I suspect it will break my signals2 usage as said in the mailing list but I want to be sure).
follow-up: 6 comment:5 by , 9 years ago
Component: | thread → config |
---|
Whether BOOST_NO_CXX11_VARIADIC_TEMPLATES must be defined or not is out of the scope of Boost.Thread and we need to fix it in Boost.Config.
Anyway it is a shame that Microsoft has not checked MSVC12 RC against the regression tests in boost before delivering.
comment:6 by , 9 years ago
Replying to viboes:
Anyway it is a shame that Microsoft has not checked MSVC12 RC against the regression tests in boost before delivering.
That being said, synchronized_value worked correctly with MSVC12 RC, at least in the revision I used in the past months (which I believe was r85663 ). Yesterday I was still using this revision with MSVC12 RC and had no other problem than this one: connect.microsoft.com/VisualStudio/feedback/details/802157/compiler-crash-mixing-boost-synchronized-value-and-boost-property-tree
I didn't check if something changed in config or synchronized_value since them so there are several potential source of problem here.
comment:8 by , 9 years ago
There's a message thread on the lists to the effect that variadic templates are not fully supported yet: http://lists.boost.org/Archives/boost/2013/09/206389.php so I'm reluctant to re-enable them in Boost.Config. Sounds like this is a good case where a BOOST_WORKAROUND would be more appropriate in the thread lib?
BTW am I alone in finding it ironic that the way to work around a compiler bug is to enable an only-partially-working new feature? Oh well!
The change I'm suggesting for synchronized_value.hpp is to change:
#if ! defined BOOST_NO_CXX11_VARIADIC_TEMPLATES
to
#if ! defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) || BOOST_WORKAROUND(BOOST_MSVC, == 1800)
comment:9 by , 8 years ago
Resolution: | → worksforme |
---|---|
Status: | assigned → closed |
Update: this works for me with current develop and master branches and released VC12.
Removing the ifdefs in the synchronized_value related to BOOST_NO_CXX11_VARIADIC_TEMPLATES, and taking the code using variadic templates does fix the problem for me.