locked
Microsoft.SqlServer.Types.SqlGeometry.MakeValid() method cause out of memory exception RRS feed

  • Question

  • Hi,

    I'm using the Microsoft.SqlServer.Types in C#, but when I try to use the MakeValid method, the memory goes up to several giga bytes and crashed. Here is my code to test

    SqlGeometry.STGeomFromWKB(new SqlBytes(wellKnownBinary), 0).MakeValid()

    The Base64String of the wellKnownBinary is 

    "AQIAAAC/AgAAO0xdbn+gNsD2KFyPwjUZQNBpA502oDbAi0YCvnk1GUAGW7AFW6A2wPYoXI/CNRlAO0xdbn+gNsD2KFyPwjUZQEGnDXTaoDbAN9BpA502GUCsiWdFI6E2wOJZ0UjANxlAF2zBFmyhNsBkqOwwdTkZQBdswRZsoTbA+cWSXyw5GUDhehSuR6E2wCMB37yaOBlArIlnRSOhNsDiWdFIwDcZQDtMXW5/oDbA9ihcj8I1GUA7TF1uf6A2wGELtmALNhlAoNMGOm2gNsD2KFyPwjUZQAZbsAVboDbA9ihcj8I1GUCg0wY6baA2wPYoXI/CNRlA1sSzopGgNsD2KFyPwjUZQAZbsAVboDbA9ihcj8I1GUBr4lnRSKA2wItGAr55NRlABluwBVugNsD2KFyPwjUZQGviWdFIoDbA9ihcj8I1GUCbeFY0EqA2wItGAr55NRlAimdFIwGfNsATz4pGAj4ZQOQ4juM4njbAorLD1OU2GUDpkz7pk542wEqf9EmfNBlAVHaYutyeNsBKn/RJnzQZQIpnRSMBnzbASp/0SZ80GUC5/UGGyp42wEqf9EmfNBlA7+7u7u6eNsC1gU4b6DQZQFR2mLrcnjbAtYFOG+g0GUDv7u7u7p42wEqf9EmfNBlAimdFIwGfNsBKn/RJnzQZQLn9QYbKnjbASp/0SZ80GUAfhetRuJ42wEqf9EmfNBlAVHaYutyeNsD2KFyPwjUZQGWHqcvtnzbAjuM4juM4GUAqO0xdbp82wCBkqOwwNRlAeVY0EvCdNsCLRgK+eTUZQKjsMHW5nTbAzO0PMlQ2GUDe3d3d3Z02wPYoXI/CNRlAGSo7TF2eNsC1gU4b6DQZQH6x5B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As2GUBlh6nL7Z82wGELtmALNhlANfGsaCSgNsCissPU5TYZQAZbsAVboDbATTwrGgk4GUAGW7AFW6A2wOJZ0UjANxlA1sSzopGgNsClT/qkTzoZQAZbsAVboDbAVHaYutw+GUAGW7AFW6A2wL9Y8oslPxlAZYepy+2fNsCsiWdFI0EZQAAAAAAAoDbAa+JZ0UhAGUBr4lnRSKA2wJUdpi63PxlA0GkDnTagNsAAAAAAAEAZQGviWdFIoDbAKjtMXW4/GUA7TF1uf6A2wBPPikYCPhlA1sSzopGgNsBoRSMB3zwZQA=="

    Is this a bug in SqlServer Types?

    Regards,

    Edgar

    Wednesday, February 20, 2013 3:00 AM

All replies

  • Hi Edgar,

    I want to confirm whether SQL Server crashed or the application which calls MakeValid() method crashed. I suggest debugging the codes to make sure you pass a valid value to the method, additionally, please run the application from another computer and check the result again. There is a similar question on the following link, you can also refer to it:

    http://social.technet.microsoft.com/Forums/ms/sqlspatial/thread/6b73e701-be81-424b-a052-29b5efa0d5e9


    Allen Li
    TechNet Community Support

    Thursday, February 21, 2013 6:40 AM
  •     Hi Allen,

     I get same result than Edgar just by using the Microsoft.SqlServer.Types library from a windows form application (without SQL at all). MakeValid method start eating memory until application crash.

     It's quite simple to test, just try to MakeValid the geometry Edgar posted and you will se the effect.

     By the way CanMakeValid returns true. But then Microsoft.SqlServer.Types gets crazy when trying to make the geometry valid. If we knew the reason, maybe we could check manually the invalid geometry before calling MakeValid.

     Regards,

    Carlos 

    Thursday, February 21, 2013 8:05 AM
  • Hi Allen,

    Thanks for your reply, as Carlos said, we're using the Microsoft.SqlServer.Types 11.0 library, you can just create a console application and write this code and run, you'll see the memory rise up to giga bytes and then the exception occurs.

    SqlGeometry.STGeomFromWKB(new SqlBytes(Convert.FromBase64String(Base64String)), 0).MakeValid()

    Thanks,

    Edgar

    Thursday, February 21, 2013 8:47 AM
  •    Hi Allen,

    Did you have a chance to run the code an recreate the issue?

    Wednesday, February 27, 2013 7:09 AM
  • Hi, from your description,

    I get same result than Edgar just by using the Microsoft.SqlServer.Types library from a windows form application (without SQL at all). MakeValid method start eating memory until application crash.

    This issue can occur due to SqlGeometry.MakeValid Method self since there is no SQL Server. I would recommend to submit a feedback to the Microsoft Connect at this link https://connect.microsoft.com/SQLServer/Feedback. This connect site will serve as a connecting point between you and Microsoft, and ultimately the large community for you and Microsoft to interact with. Your feedback enables Microsoft to offer the best software and deliver superior services, meanwhile you can learn more about and contribute to the exciting projects on Microsoft Connect.


    Allen Li
    TechNet Community Support

    Friday, March 1, 2013 8:22 AM
  •    Thanks Allen,

    I filled the feedback: https://connect.microsoft.com/SQLServer/feedback/details/780448/outofmemory-exception-on-microsoft-sqlserver-types-with-sqlgeometry-stgeomfromwkb-new-sqlbytes-wellknownbinary-0-makevalid

    Carlos

    Friday, March 1, 2013 6:46 PM
  •     Hi Again Allen,

      Do you know how long use to take roughly until Microsoft respond the the feedback posted on Microsoft Connect?

    Thursday, March 7, 2013 5:44 PM
  • Hi Allen,

    There is still no reply at the Connect page, do you have any idea with this?

    Edgar

    Friday, March 15, 2013 6:57 AM