Search code examples
.netxmlxsltnhibernatefluent-nhibernate

BuildSessionFactory from FluentNHibernate hanging after applying KB3122648 update


After applying MS16-019 security update, FluentNHibernate 1.1 fails to build session factory - it's just hanging on BuildSessionFactory call.

NHibernate logging interrupts before mapping XML:

[1] INFO  NHibernate.Cfg.Environment - NHibernate 2.1.2.4000 (2.1.2.4000)
[1] INFO  NHibernate.Cfg.Environment - hibernate-configuration section not found in application configuration file
[1] INFO  NHibernate.Cfg.Environment - Bytecode provider name : lcg
[1] INFO  NHibernate.Cfg.Environment - Using reflection optimizer

So it looks like it is hanging either on reflection optimiser part (which I tried to disable **) or at point when reading/applying XML mapping.

** - ExposeConfiguration(x => x.SetProperty("use_reflection_optimizer", "false"))

In working scenario (before applying MS16-019 update), "Using reflection optimizer" is followed by:

[1] DEBUG NHibernate.Cfg.Configuration - Mapping XML:
<hibernate-mapping...</hibernate-mapping>
[1] INFO  NHibernate.Dialect.Dialect - Using dialect: NHibernate.Dialect.MsSql2005Dialect

My guess is that mapping xml becomes invalid after fixes from MS16-019, but how I can find out what exactly is wrong and what FluentNHibernate version has fix for that?


Solution

  • After I recompiled NHibernate libraries locally with additional logging I was able to find that hang occurs at SelectNodes call in ClassExtractor.GetClassEntries. The issue was fixed starting from NHibernate 3.3.x.