{"action":"created","issue":{"url":"https://api.github.com/repos/lballabio/quantlib/issues/306","labels_url":"https://api.github.com/repos/lballabio/quantlib/issues/306/labels{/name}","comments_url":"https://api.github.com/repos/lballabio/quantlib/issues/306/comments","events_url":"https://api.github.com/repos/lballabio/quantlib/issues/306/events","html_url":"https://github.com/lballabio/quantlib/issues/306","id":105290476,"number":306,"title":"C# System.AccessViolationException still exists on new version QuantLib-SWIG-1.6 ","user":{"login":"vinaydwivedi","id":9931326,"avatar_url":"https://avatars.githubusercontent.com/u/9931326?v=3","gravatar_id":"","url":"https://api.github.com/users/vinaydwivedi","html_url":"https://github.com/vinaydwivedi","followers_url":"https://api.github.com/users/vinaydwivedi/followers","following_url":"https://api.github.com/users/vinaydwivedi/following{/other_user}","gists_url":"https://api.github.com/users/vinaydwivedi/gists{/gist_id}","starred_url":"https://api.github.com/users/vinaydwivedi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vinaydwivedi/subscriptions","organizations_url":"https://api.github.com/users/vinaydwivedi/orgs","repos_url":"https://api.github.com/users/vinaydwivedi/repos","events_url":"https://api.github.com/users/vinaydwivedi/events{/privacy}","received_events_url":"https://api.github.com/users/vinaydwivedi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-09-08T02:49:39Z","updated_at":"2015-09-09T10:52:31Z","closed_at":null,"body":"I upgraded to new version QuantLib-SWIG-1.6 - Still has many System.AccessViolationException. System.AccessViolationException - Is very hard to reproduce and generally comes randomly during very high load, consistent with comment \r\n\r\n\"This usually occurs because a pointer has a bad value. Not all reads or writes through bad pointers lead to access violations, so an access violation usually indicates that several reads or writes have occurred through bad pointers, and that memory might be corrupted. Thus, access violations almost always indicate serious programming errors\"\r\nhttps://msdn.microsoft.com/en-us/library/system.accessviolationexception(v=vs.110).aspx\r\n\r\nWe were using V1.2 with same issues, wondering if anything has been done to solve these issues in V1.6?  \r\n\r\nAppreciate any help, many thanks.\r\n\r\nApplication: Pricer.exe\r\nFramework Version: v4.0.30319\r\nDescription: The process was terminated due to an unhandled exception.\r\nException Info: System.AccessViolationException\r\nStack:\r\n   at QuantLib.NQuantLibcPINVOKE.delete_DividendVanillaOption(System.Runtime.InteropServices.HandleRef)\r\n   at QuantLib.DividendVanillaOption.Dispose()\r\n   at QuantLib.DividendVanillaOption.Finalize()\r\n   \r\n   \r\nApplication: Pricer.exe\r\nFramework Version: v4.0.30319\r\nDescription: The process was terminated due to an unhandled exception.\r\nException Info: System.AccessViolationException\r\nStack:\r\n   at QuantLib.NQuantLibcPINVOKE.delete_BlackVolTermStructureHandle(System.Runtime.InteropServices.HandleRef)\r\n   at QuantLib.BlackVolTermStructureHandle.Dispose()\r\n   at QuantLib.BlackVolTermStructureHandle.Finalize()\r\n"},"comment":{"url":"https://api.github.com/repos/lballabio/quantlib/issues/comments/138873817","html_url":"https://github.com/lballabio/quantlib/issues/306#issuecomment-138873817","issue_url":"https://api.github.com/repos/lballabio/quantlib/issues/306","id":138873817,"user":{"login":"klausspanderen","id":4692192,"avatar_url":"https://avatars.githubusercontent.com/u/4692192?v=3","gravatar_id":"","url":"https://api.github.com/users/klausspanderen","html_url":"https://github.com/klausspanderen","followers_url":"https://api.github.com/users/klausspanderen/followers","following_url":"https://api.github.com/users/klausspanderen/following{/other_user}","gists_url":"https://api.github.com/users/klausspanderen/gists{/gist_id}","starred_url":"https://api.github.com/users/klausspanderen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/klausspanderen/subscriptions","organizations_url":"https://api.github.com/users/klausspanderen/orgs","repos_url":"https://api.github.com/users/klausspanderen/repos","events_url":"https://api.github.com/users/klausspanderen/events{/privacy}","received_events_url":"https://api.github.com/users/klausspanderen/received_events","type":"User","site_admin":false},"created_at":"2015-09-09T10:52:31Z","updated_at":"2015-09-09T10:52:31Z","body":"Easiest way might be to add these libraries to the auto_link section in test-suite/quantlibtestsuite.cpp, line 30ff should become\r\n\r\n```c++\r\n#ifdef BOOST_MSVC\r\n#  include <ql/auto_link.hpp>\r\n#  define BOOST_LIB_NAME boost_unit_test_framework\r\n#  include <boost/config/auto_link.hpp>\r\n#  undef BOOST_LIB_NAME\r\n\r\n#  define BOOST_LIB_NAME boost_thread\r\n#  include <boost/config/auto_link.hpp>\r\n#  undef BOOST_LIB_NAME\r\n\r\n#  define BOOST_LIB_NAME boost_system\r\n#  include <boost/config/auto_link.hpp>\r\n#  undef BOOST_LIB_NAME\r\n```\r\n\r\nThe first five lines are unchanged w.r.t. the original version of the file. Thanks for highlighting this issue. I'm going to add the modified quantlibtestsuite.cpp file to the patch,"}}