[mapserver-users] Re: Mapscript c# VS 2010 framework 4 and memory leaks

2010-04-22 Thread Tamas Szekeres
2010/4/22 James Perrins 

>  Thanks – I had seen that BlogSpot – and I’ve been careful to rebuild all
> the dlls on my machine and always use a complete “family” from one source
>
> I also double checked with dependency walker – and can’t see multiple CRTs
>
> Also – its strange that simply loading a mapObj from the map file can get
> memory errors – I wouldn’t have thought it was calling out to many DLLs at
> this point.
>
>
>
> I’ll try and knock up a Ticket explaining all this
>

And please attach your testing example to this ticket as well.

Best regards,

Tamas
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


[mapserver-users] Re: Mapscript c# VS 2010 framework 4 and memory leaks

2010-04-22 Thread Tamas Szekeres
2010/4/22 James Perrins 

>
> However - unfortunately after all this - it doesn't seem to make any
> difference to the original problems with the memory errors.  I had hoped by
> compiling to CLR 4 these would go but they haven't.  So I'm back to square
> one - it doesn't work with CLR 4.
>
> Any other ideas whey there might be memory issues ?
>
>
I suspect it may be due to the fact that many dependent dll-s may refer to
different CRT libraries since multiple compilers have been used. For more
information about this topic see my related blogpost: Redistribution of the
shared C runtime component in Visual
C++

It would be reasonable to test with a consistent build, where all the
dependecies have been compiled with the same compiler. I'll be trying to
extend the SDK packages  with the VS2010
versions soon.

Best regards,

Tamas
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Re: Mapscript c# VS 2010 framework 4 and memoryleaks - Found word(s) list error in the Text body [Keyword]

2010-04-22 Thread Tamas Szekeres
2010/4/22 James Perrins :

> Need to add:
>
> using System.Security;
> [assembly: SecurityRules(SecurityRuleSet.Level1)]
>
> I haven't yet found anything that says where you can do this once for
> an assembly - or whether you have to mark each class (probably doesn't
> hurt to mark each class) - all the examples are a bit trivial
>

James,

You could add this line in
AssemblyInfo.cswhich
won't be re-generated during the build process.  However I'd be
curious to know whether this change breaks the existing builds with
VS2003/VS2005/VS2008. If yes, then this addition should be conditional to
VS2010 only.

> I've found some source in a slightly different location from your
suggestions:
> ~\mapserver-5-6\mapscript\
> csharp

Ah, it seems I was referring to the GDAL project, but it seems you've
already found it.

> As an aside (and why I've been caught with this) is that referencing
> the mapscript_csharp.dll in a CLR 4 app works in design mode
> apparently fine.  Its only when you try and run the compiled exe (or
> as it turns out switch off "suppress jit optimization on module load
> (managed code only)").  At that point even trying to load a mapObj
> results in numerous memory errrors
>

It would be helpful to submit a new
ticketfor this issue and
describe your experiences here.

Best regards,

Tamas
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] having trouble with label size

2010-04-22 Thread Daniel Morissette

Worth Lutz wrote:

I believe that what you are looking for is DEFRESOLUTION in the mapfile at
the MAP level.  From what I remember seeing on this list is that you set

RESOLUTION 300
DEFRESOLUTION 72

And then increase the size of your map to get the large size at 300 dpi.

I'm not sure when this was added but it is not in the documentation.

Hopefully someone will add to this information.



This was added in MS 5.6. Unfortunately the doc is a bit behind, but you 
can find all relevant info about the new RESOLUTION/DEFRESOLUTION 
support in RFC-55:


http://mapserver.org/development/rfc/ms-rfc-55.html

Daniel
--
Daniel Morissette
http://www.mapgears.com/
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


[mapserver-users] Re: Mapscript c# VS 2010 framework 4 and memory leaks

2010-04-22 Thread James Perrins
OK - been looking into this a bit.

With luck it may just be a case of having to mark the assemblies) -
each class with:
[assembly: SecurityRules(SecurityRuleSet.Level1)]

Need to add:

using System.Security;
[assembly: SecurityRules(SecurityRuleSet.Level1)]

I haven't yet found anything that says where you can do this once for
an assembly - or whether you have to mark each class (probably doesn't
hurt to mark each class) - all the examples are a bit trivial

I've found some source in a slightly different location from your suggestions:
~\mapserver-5-6\mapscript\csharp

But as you say - when I tried adding in the above change - and ran the
makefile - the swig (which I'm not familiar with) replaced my changes
- so I haven't yet been able to test if it really works.
Is there an easy edit to the makefile to disable the swig regeneration ?

As an aside (and why I've been caught with this) is that referencing
the mapscript_csharp.dll in a CLR 4 app works in design mode
apparently fine.  Its only when you try and run the compiled exe (or
as it turns out switch off "suppress jit optimization on module load
(managed code only)").  At that point even trying to load a mapObj
results in numerous memory errrors

Thanks
James


On Thu, Apr 22, 2010 at 11:56 AM, Tamas Szekeres  wrote:
> The geneated sources should be in /swig/csharp/ogr, /swig/csharp/gdal,
> /swig/csharp/osr
> However in the final version of the patch, the corresponding interface
> files should be updated instead (in /swig/include/csharp), because the
> source files are regenared during the build process.
>
> If you find out the desired changes in the generated sources (.cs) I
> could help in making the related changes in the SWIG interface files.
>
> Best regards,
>
> Tamas
>
>
>
> 2010/4/22 James Perrins :
>> Thanks for that - I was looking for a setting like that but failed to find 
>> it.
>>
>> However I'm not sure its the complete solution (as I've tried it and
>> still seem to have the same error) - the link you give states that you
>> need to still add:
>> [assembly: SecurityRules(SecurityRuleSet.Level1)] to your assembly to
>> revert to CLR2 transparency.
>>
>> Unfortunately this
>> http://msdn.microsoft.com/en-us/library/dd409253(v=VS.100).aspx states
>> that even with the switch set - it doesn’t effect transparency rules -
>> which appears to be the breaking change :-(.  I'm assuming code
>> changes need to me made to mapscript_csharp rather than any of my code
>> consuming it.
>>
>> If I was going to have a go at adding this into the mapscript_csharp
>> wrapper could you give me a pointer to where to look for the source -
>> I seem to have compiled it OK - but am having trouble seeing where the
>> source is amongst everything else.
>>
>> Thanks again
>> James
>>
>>
>> On Thu, Apr 22, 2010 at 9:29 AM, Tamas Szekeres  wrote:
>>> 2010/4/22 James Perrins :


 Things seemed to compile - but when I call something like
 mapObj(MyMapFile) I get an error about

 "Attempt by security transparent method
 'OSGeo.MapServer.mapObj..ctor(System.String)' to call native code
 through method 'OSGeo.MapServer.mapscriptPINVOKE.new_mapObj(System.String)'
 failed.  Methods must be security critical or security safe-critical
 to call native code."

>>>
>>> This appears to be due to the different level of the security
>>> transparency setting of .NET FW 4.0 vs. the previous versions.
>>> I'll require some further testings to find out the desired solution,
>>> however you might want to try with the suggestions below:
>>> http://blogs.rev-net.com/ddewinter/2009/05/20/opting-out-of-security-changes-in-net-4/
>>>
>>> Best regards,
>>>
>>> Tamas
>>>
>>
>
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


[mapserver-users] Re: Mapscript c# VS 2010 framework 4 and memory leaks

2010-04-22 Thread Tamas Szekeres
The geneated sources should be in /swig/csharp/ogr, /swig/csharp/gdal,
/swig/csharp/osr
However in the final version of the patch, the corresponding interface
files should be updated instead (in /swig/include/csharp), because the
source files are regenared during the build process.

If you find out the desired changes in the generated sources (.cs) I
could help in making the related changes in the SWIG interface files.

Best regards,

Tamas



2010/4/22 James Perrins :
> Thanks for that - I was looking for a setting like that but failed to find it.
>
> However I'm not sure its the complete solution (as I've tried it and
> still seem to have the same error) - the link you give states that you
> need to still add:
> [assembly: SecurityRules(SecurityRuleSet.Level1)] to your assembly to
> revert to CLR2 transparency.
>
> Unfortunately this
> http://msdn.microsoft.com/en-us/library/dd409253(v=VS.100).aspx states
> that even with the switch set - it doesn’t effect transparency rules -
> which appears to be the breaking change :-(.  I'm assuming code
> changes need to me made to mapscript_csharp rather than any of my code
> consuming it.
>
> If I was going to have a go at adding this into the mapscript_csharp
> wrapper could you give me a pointer to where to look for the source -
> I seem to have compiled it OK - but am having trouble seeing where the
> source is amongst everything else.
>
> Thanks again
> James
>
>
> On Thu, Apr 22, 2010 at 9:29 AM, Tamas Szekeres  wrote:
>> 2010/4/22 James Perrins :
>>>
>>>
>>> Things seemed to compile - but when I call something like
>>> mapObj(MyMapFile) I get an error about
>>>
>>> "Attempt by security transparent method
>>> 'OSGeo.MapServer.mapObj..ctor(System.String)' to call native code
>>> through method 'OSGeo.MapServer.mapscriptPINVOKE.new_mapObj(System.String)'
>>> failed.  Methods must be security critical or security safe-critical
>>> to call native code."
>>>
>>
>> This appears to be due to the different level of the security
>> transparency setting of .NET FW 4.0 vs. the previous versions.
>> I'll require some further testings to find out the desired solution,
>> however you might want to try with the suggestions below:
>> http://blogs.rev-net.com/ddewinter/2009/05/20/opting-out-of-security-changes-in-net-4/
>>
>> Best regards,
>>
>> Tamas
>>
>
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


[mapserver-users] Re: Mapscript c# VS 2010 framework 4 and memory leaks

2010-04-22 Thread James Perrins
Thanks for that - I was looking for a setting like that but failed to find it.

However I'm not sure its the complete solution (as I've tried it and
still seem to have the same error) - the link you give states that you
need to still add:
[assembly: SecurityRules(SecurityRuleSet.Level1)] to your assembly to
revert to CLR2 transparency.

Unfortunately this
http://msdn.microsoft.com/en-us/library/dd409253(v=VS.100).aspx states
that even with the switch set - it doesn’t effect transparency rules -
which appears to be the breaking change :-(.  I'm assuming code
changes need to me made to mapscript_csharp rather than any of my code
consuming it.

If I was going to have a go at adding this into the mapscript_csharp
wrapper could you give me a pointer to where to look for the source -
I seem to have compiled it OK - but am having trouble seeing where the
source is amongst everything else.

Thanks again
James


On Thu, Apr 22, 2010 at 9:29 AM, Tamas Szekeres  wrote:
> 2010/4/22 James Perrins :
>>
>>
>> Things seemed to compile - but when I call something like
>> mapObj(MyMapFile) I get an error about
>>
>> "Attempt by security transparent method
>> 'OSGeo.MapServer.mapObj..ctor(System.String)' to call native code
>> through method 'OSGeo.MapServer.mapscriptPINVOKE.new_mapObj(System.String)'
>> failed.  Methods must be security critical or security safe-critical
>> to call native code."
>>
>
> This appears to be due to the different level of the security
> transparency setting of .NET FW 4.0 vs. the previous versions.
> I'll require some further testings to find out the desired solution,
> however you might want to try with the suggestions below:
> http://blogs.rev-net.com/ddewinter/2009/05/20/opting-out-of-security-changes-in-net-4/
>
> Best regards,
>
> Tamas
>
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


[mapserver-users] Re: Mapscript c# VS 2010 framework 4 and memory leaks

2010-04-22 Thread Tamas Szekeres
2010/4/22 James Perrins :
>
>
> Things seemed to compile - but when I call something like
> mapObj(MyMapFile) I get an error about
>
> "Attempt by security transparent method
> 'OSGeo.MapServer.mapObj..ctor(System.String)' to call native code
> through method 'OSGeo.MapServer.mapscriptPINVOKE.new_mapObj(System.String)'
> failed.  Methods must be security critical or security safe-critical
> to call native code."
>

This appears to be due to the different level of the security
transparency setting of .NET FW 4.0 vs. the previous versions.
I'll require some further testings to find out the desired solution,
however you might want to try with the suggestions below:
http://blogs.rev-net.com/ddewinter/2009/05/20/opting-out-of-security-changes-in-net-4/

Best regards,

Tamas
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users