SmartAssembly 6.6.3 OutOfMemoryException with 64-bit App

.NET obfuscator and automated error reporting

Moderators: Luke Jefferson, melvyn.harbour, dom.smith

SmartAssembly 6.6.3 OutOfMemoryException with 64-bit App

Postby craigm » Tue Apr 03, 2012 5:06 am

Hi,

I'm having issues with version 6.6.3 of SmartAssembly when trying to generate a 64-bit version of my application. It seems to be running out of memory at a similar point it would if it were a 32-bit application. It works fine without processing through SmartAssembly, but once I process it, it throws an out of memory exception, even if all of the options are turned off (no obfuscation, pruning, control flow, etc).

I was able to reproduce this program with a simple command line application with the following code:

Code: Select all
    class Program
    {
        static void Main(string[] args)
        {

            try
            {
                var l = new List<object>();
                for (int i = 1; i <= 4096; i++)
                {
                    l.Add(new A());
                    Console.WriteLine("Created " + i.ToString("#,##0") + "MB");
                }
                Console.WriteLine("No out of memory exception.");
            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
            }
            Console.WriteLine((Environment.Is64BitProcess ? "64" : "32") + "-bit process");
            Console.ReadKey();
        }
    }
   
   class A
   {
      byte[] b;
      
      public A()
      {
         b = new Byte[1048576];
      }
   }


I've reverted to version 6.1 and it seems to be working fine so I'm going to use this in the meantime.

Thanks,

Craig
craigm
 
Posts: 9
Joined: Wed Jun 23, 2010 1:13 pm

Postby Simon C » Tue Apr 03, 2012 9:20 am

Thanks for the test case, I've reproduced it on my machine, however only if the application is specifically compiled for 64-bit. AnyCPU works fine, which is probably why we haven't picked this up yet.
Simon C
 
Posts: 140
Joined: Tue Feb 26, 2008 4:56 pm
Location: Red Gate Software

Postby Simon C » Tue Apr 03, 2012 9:33 am

I've just checked in a fix. We weren't setting the large address aware flag on the PE header of the assembly, which (for some reason) is required on 64-bit assemblies but not 32-bit or AnyCPU. This'll be in the next release of SA.
Simon C
 
Posts: 140
Joined: Tue Feb 26, 2008 4:56 pm
Location: Red Gate Software

Postby craigm » Tue Apr 03, 2012 12:07 pm

Thanks for looking at this for us. Do you have any idea on when I could expect a new version to be released?

Thanks,

Craig
craigm
 
Posts: 9
Joined: Wed Jun 23, 2010 1:13 pm

Postby Simon C » Wed Apr 04, 2012 4:51 pm

We're planning on releasing a new version of SA sometime next week. It's currently undergoing final testing.
Simon C
 
Posts: 140
Joined: Tue Feb 26, 2008 4:56 pm
Location: Red Gate Software

Postby dom.smith » Thu Apr 12, 2012 12:18 pm

Hi,

I've just released SmartAssembly 6.6.4.95, which includes this fix. To download it, use 'Check for Updates' in SmartAssembly's menu.

Thanks for telling us about the bug.

Dom.
Dominic Smith,
Project Manager,
Red Gate Software.
dom.smith
 
Posts: 95
Joined: Thu Jun 03, 2010 5:54 pm
Location: Cambridge, UK


Return to SmartAssembly 6

Who is online

Users browsing this forum: No registered users and 1 guest