-
Notifications
You must be signed in to change notification settings - Fork 166
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
Windows: fatal error C1001: An internal error has occurred in the compiler. #596
Comments
Doesn't seem to be the optimization. Currently we don't have optimization specified explicitly, but tried with
same error. |
Alas, more ICE! I'd try this to make it easier for the compiler:
|
@BergWerkGIS - I just looked into this a bit. I'm feeling like the use of So I think the best route here is to troubleshoot this in node-mapnik. Could you create a branch of node-mapnik that points at a Mapnik master SDK then ping me? I'll then poke by committing to that branch and letting appveyor tell me if we've dodged the issue. |
@BergWerkGIS - nevermind! I got this and bumped to start testing in 238035e |
That commit passed: 238035e. I assumed it would fail and the original compiler error would be replicated. Not sure why not.... |
@BergWerkGIS - let me know when you've had a chance to test to see if you can still replicate this. |
@springmeyer sorry, forgot to report back yesterday. Tried again today on three different machines. Built Interestingly However, if I use My current hunch: Maybe Also interesting that |
Could this be why Partial Support for Expression SFINAE in VS 2015 Update 1 Especially the "unsupported section". |
Can you confirm that the error is not caused by initializing the variant with Regardless of the above, I think this is where |
@lightmare - good clues. @BergWerkGIS - you were going to diff out the differences in the Mapnik SDK that crashes vs not - what was the outcome of that investigation? Also @BergWerkGIS @artemp will ping you in the morning to try debugging interactively with a few ideas that might help. |
Here is my rough plan to try tomorrow with @BergWerkGIS :
struct dummy {};
using surface_type = mapnik::util::variant<
dummy,
Image *
, CairoSurface *
#if defined(GRID_RENDERER)
, Grid *
#endif
>; In
|
Diff: Not exactly sure how that happened, but old variant made it into the SDK that already should have contained a new one.
I updated the build chain with a new SDK.
https://ci.appveyor.com/project/Mapbox/node-mapnik/build/1.0.1242/job/m3n76h4mg5oqinjp#L405 |
Forgot, all tests passed with https://github.com/mapbox/variant/compare/crazy_usage |
y, also found a reference that VS compiler doesn't like that, but haven't checked yet. |
Okay, thanks @BergWerkGIS - so sounds like:
Therefore despite this being a compiler crash (a compiler should never crash) I think variant is likely partly to blame. So the idea above with @artemp is a good next step. I also see that @lightmare created mapbox/variant#93 which might be another thing to try. Both might workaround the problem. I presume that you can easily test workarounds by:
So: you should not need to recompile Mapnik core to iterate on testing tomorrow. |
The MSVC compiler has a really hard time with some C++11 features, |
All ✅ Only change needed was:
https://ci.appveyor.com/project/Mapbox/node-mapnik/build/1.0.1243 Maybe compiler was not able to infer the type of Alsot tried mapbox/variant#93 but that crashed the compiler like before (with un-modified |
@BergWerkGIS - sounds good ^ . ^ disregard, I'm not fully awake yet. Default constructed |
…ult contructor in `vector_tile_render_baton_t` (ref #596)
That was not supposed to fix the issue by itself. It will only allow you to keep variant uninitialized and not blow up when visited, i.e.: surface(mapbox::util::no_init) // instead of surface(nullptr) struct deref_visitor
{
void operator() (/* no arg*/) {} // no-op, this is called when uninitialized
template <typename SurfaceType>
void operator() (SurfaceType * surface)
...
}; edit: btw, if MSVC has trouble matching nullptr to pointer type, you can probably solve that by telling it explicitly |
Thanks for everyones efforts here. So before closing this a few followup questions:
|
because relying on nullptr is a not a smart idea and it breaks strong typing and trips MSVC etc etc. So having a |
Thanks @artemp. Sounds like then:
|
mapnik@master
andnode-mapnik@master
as of now.Possible hints:
https://social.msdn.microsoft.com/Forums/vstudio/en-US/ea74ee2b-3c8b-4b55-ab0b-9ec5d6f9acef/compiler-bug-in-vs-2015-when-using-code-analyzer-on-kernel-driver-c-code-project?forum=vsdebug
https://msdn.microsoft.com/en-us/library/y19zxzb2.aspx?f=255&MSPPError=-2147217396
https://connect.microsoft.com/VisualStudio/feedback/details/813086/c1xx-fatal-error-c1001-an-internal-error-has-occurred-in-the-compiler
https://support.microsoft.com/en-us/kb/195738
The text was updated successfully, but these errors were encountered: