Friday 27 May 2016

Announcing: MapGuide Open Source 3.1 Beta 1

After several months of messing with vagrant for a more streamlined build pipeline and clearing some last-minute roadblocks, I am happy to finally announce the availability of the 1st beta release of MapGuide Open Source 3.1.

In terms of new features, well ... 3.1 can mostly be considered a "bugfix" release. The major features I had hoped to get implemented before this release cycle did not materialize in time, so I'll spare you the usual showcase series of blog posts every time we do a new major release, because you can fit it all in this one post.

New Layer Definition Cache

When MapGuide renders maps, we have to fetch Layer Definition documents from the repository to know how to render and style feature data. Until now, those documents aren't being cached, so we have to fetch the same Layer Definition documents over and over every time MapGuide renders a map image.

3.1 introduces a new server-side Layer Definition cache so we can avoid repeated fetching of Layer Definitions from the repository (and converting the XML to its object-oriented form) every time we render maps. For maps with a very large layer count, some noticeable gains in rendering performance should be noticeable.

Updated Web Tier Components

MapGuide Open Source 3.1 Beta 1 includes the following updated Web Tier components.

  • Apache HTTPD 2.4.18
  • PHP 5.5.33
  • Tomcat 7.0.68

Linux support

The Ubuntu build of MapGuide Open Source 3.1 Beta 1 now supports Ubuntu 14.04 LTS.

The Linux builds in general have a new and improved service control script for:

  • Restarting the mgserver daemon
  • Checking the running status of the mgserver daemon
  • Extra warnings when attempting to start an already started mgserver daemon or stopping an already stopped mgserver daemon
Many thanks to Gabriele Monfardini for providing this new service control script.

Like 3.0, the 64-bit Linux builds should still be considered experimental/preview for 3.1 and should still only be used for testing and feedback. Use in production at your own risk.


Fusion

Fusion has some important and long overdue fixes for Google Maps support and various widgets


For more information, consult the release notes in the link below.

Download

400 posts!

... about the release of MapGuide Open Source 3.1 Beta 1?

Nah, we'll save that one for the post after this one.

For this is the 400th published post on this blog!




This year has slowed down a bit in blog-age, but as I've mentioned previously, it's not due to lack of content. Like a CPU at 100% usage, I've been busy with stuff. But that should be hopefully fleeting and I'll be resuming normal blogging operations soon.

Thank you all for your continued eyeball patronage.

Thursday 26 May 2016

MapGuide Open Source 3.1 pre-flight check part 3 (a wild roadblock appeared!)

Stop the presses. We ran into a blocker!

A particular nasty one, that affects not just MapGuide on CentOS, but on Ubuntu as well.

Something slipped into MapGuide or the WMS FDO provider that causes mgserver to segfault when one does a GETFEATUREPROVIDERS request and a WFS/WMS FDO connection is created when inspecting its capabilities. Previously, I thought it was a quirk with the internal FDO source copy of OpenSSL and so FDO was built using the system-installed copy of OpenSSL (like we did for Ubuntu), but this problem still persisted on CentOS, and it turned out it was also segfaulting on Ubuntu as well!

Running this under gdb didn't help us at all. It only shows that the SIGSEGV happens at a function named ?? in libWMSProvider.so on CentOS, and at a function named _init in libWMSProvider.so on Ubuntu. Not very helpful.

Even the venerable valgrind couldn't help me here. Putting mgserver under valgrind and triggering the segfault gives me this incomprehensible gibberish

==11521== Thread 13:
==11521== Jump to the invalid address stated on the next line
==11521==    at 0x6E8A6: ???
==11521==    by 0x4275D9F: FdoConnectionManager::CreateConnection(wchar_t const*) (ConnectionManager.cpp:334)
==11521==    by 0x4BBB543: MgServerGetFeatureProviders::AddConnectionProperties(xercesc_3_1::DOMElement*, wchar_t const*) (in /usr/local/mapguideopensource-3.1.0/server/lib/libMgServerFeatureService-3.1.0.so)
==11521==    by 0x4BBADD3: MgServerGetFeatureProviders::CreateFeatureProvidersDocument() (in /usr/local/mapguideopensource-3.1.0/server/lib/libMgServerFeatureService-3.1.0.so)
==11521==    by 0x4BB9E23: MgServerGetFeatureProviders::GetFeatureProviders() (in /usr/local/mapguideopensource-3.1.0/server/lib/libMgServerFeatureService-3.1.0.so)
==11521==    by 0x4B67285: MgServerFeatureService::GetFeatureProviders() (in /usr/local/mapguideopensource-3.1.0/server/lib/libMgServerFeatureService-3.1.0.so)
==11521==    by 0x4B303A4: MgOpGetFeatureProviders::Execute() (in /usr/local/mapguideopensource-3.1.0/server/lib/libMgServerFeatureService-3.1.0.so)
==11521==    by 0x4B19AE6: MgFeatureServiceHandler::ProcessOperation() (in /usr/local/mapguideopensource-3.1.0/server/lib/libMgServerFeatureService-3.1.0.so)
==11521==    by 0x809768A: MgOperationThread::ProcessOperation(MgServerStreamData*) (OperationThread.cpp:397)
==11521==    by 0x8095C1B: MgOperationThread::ProcessMessage(ACE_Message_Block*) (OperationThread.cpp:226)
==11521==    by 0x8094536: MgOperationThread::svc() (OperationThread.cpp:90)
==11521==    by 0x623521B: ACE_Task_Base::svc_run(void*) (in /usr/local/mapguideopensource-3.1.0/lib/libACE.so)
==11521==  Address 0x6e8a6 is not stack'd, malloc'd or (recently) free'd
==11521== 
==11521== 
==11521== Process terminating with default action of signal 11 (SIGSEGV)
==11521==  Bad permissions for mapped region at address 0x6E8A6
==11521==    at 0x6E8A6: ???
==11521==    by 0x4275D9F: FdoConnectionManager::CreateConnection(wchar_t const*) (ConnectionManager.cpp:334)
==11521==    by 0x4BBB543: MgServerGetFeatureProviders::AddConnectionProperties(xercesc_3_1::DOMElement*, wchar_t const*) (in /usr/local/mapguideopensource-3.1.0/server/lib/libMgServerFeatureService-3.1.0.so)
==11521==    by 0x4BBADD3: MgServerGetFeatureProviders::CreateFeatureProvidersDocument() (in /usr/local/mapguideopensource-3.1.0/server/lib/libMgServerFeatureService-3.1.0.so)
==11521==    by 0x4BB9E23: MgServerGetFeatureProviders::GetFeatureProviders() (in /usr/local/mapguideopensource-3.1.0/server/lib/libMgServerFeatureService-3.1.0.so)
==11521==    by 0x4B67285: MgServerFeatureService::GetFeatureProviders() (in /usr/local/mapguideopensource-3.1.0/server/lib/libMgServerFeatureService-3.1.0.so)
==11521==    by 0x4B303A4: MgOpGetFeatureProviders::Execute() (in /usr/local/mapguideopensource-3.1.0/server/lib/libMgServerFeatureService-3.1.0.so)
==11521==    by 0x4B19AE6: MgFeatureServiceHandler::ProcessOperation() (in /usr/local/mapguideopensource-3.1.0/server/lib/libMgServerFeatureService-3.1.0.so)
==11521==    by 0x809768A: MgOperationThread::ProcessOperation(MgServerStreamData*) (OperationThread.cpp:397)
==11521==    by 0x8095C1B: MgOperationThread::ProcessMessage(ACE_Message_Block*) (OperationThread.cpp:226)
==11521==    by 0x8094536: MgOperationThread::svc() (OperationThread.cpp:90)

==11521==    by 0x623521B: ACE_Task_Base::svc_run(void*) (in /usr/local/mapguideopensource-3.1.0/lib/libACE.so)

I admit to not being an expert-level C++ developer, so when I can't find the usual cases for a SIGSEGV (eg. A null pointer de-reference) in gdb/valgrind output, I am often left scratching my head. Google searches on these error messages weren't of much help.

The good thing was that this problem only happens on FDO since 4.0 was branched and released (we're targeting FDO 4.1 here) so in the absence of expert-level C++ knowledge it was time to be systematic and track down the offending FDO revision since 4.0 branched that introduced this breakage. Time to apply that binary search again! After several wasted days of trial and error compilation/testing, we found the offending revision.

At face value, this commit looks innocuous enough, a few new files and some modifications. Nothing in the new and modified files that sounds like dangerous C++ code to my padawan-tier knowledge.


But looking at the overall list of files, something caught my eye. In this commit was a project file update, but it was only for windows (the modified WMSProvider.vcxproj file). Normally if new files are to be added, not only should the windows vcxproj file be updated as well (to include the new .h and .cpp files), but the corresponding Makefile.am files for Linux as well, and this was conspicuously absent.

This lit a light-bulb in my head, I had a look at the Makefile.am file for the WMS provider and lo-and-behold, it didn't have the new .cpp and .h files in this commit. Then it all came together.

The WMS provider was segfaulting because it was being compiled with undefined symbols (to the new FdoWmsGetFeatureInfoFormats class). Updating the Makefile.am with the missing files and re-compiling the WMS provider made the segfault go away.

And that was the tale of how I cleared the final roadblock to releasing MapGuide Open Source 3.1 (smoke tests with this change all pass, the beta 1 binaries are being built as this blog post is being published). Now on Windows with the MSVC compiler, such a problem would've manifested at the compiler phase as LNK2001 unresolved external symbol errors, so it surprised me big time that gcc or ld did not error out about undefined symbols and immediately break the build which would've caught this problem much sooner!

It turns out gcc/ld erroring out is a flag you have to opt-in to. The more you know. Thanks to Johan for the heads up.

So you can now expect the next post to be about ...

Monday 16 May 2016

MapGuide Open Source 3.1 pre-flight check part 2

We're close. Soooooooo close to a 3.1 beta release of MapGuide Open Source. But there's one small snag before I am ready to start uploading binaries.

An issue was caught in smoke testing where the WFS/WMS providers seem to destabilize the MapGuide installation on CentOS when listing available FDO providers...

... Which sounds very similar to a problem we had with Ubuntu builds of FDO until we made the change to build FDO against system-installed versions of OpenSSL/libCURL.

So I'm going to give that a try (building against system OpenSSL/libCURL) with the CentOS builds again, which should hopefully pass my smoke tests to give the all clear to upload the long awaited binaries for MapGuide Open Source 3.1