Results 1 to 5 of 5

Thread: An unhandled exception of type 'System.StackOverflowException' occurred in Sagem.Morp

  1. #1

    Thread Starter
    Frenzied Member usamaalam's Avatar
    Join Date
    Nov 2002
    Location
    Karachi
    Posts
    1,308

    An unhandled exception of type 'System.StackOverflowException' occurred in Sagem.Morp

    Hello Everybody,

    I have a web service that communicates with a dll called Sagem.MorphoKit.dll. This dll further communicates with a USB Dongle plugged on the server for 1-1 fingerprint matching. I deployed the service on the server and when I try to perform matching, I am getting following exception:

    An unhandled exception of type 'System.StackOverflowException' occurred in Sagem.MorphoKit.dll

    Here's the piece of my snippet, let me know if you need more info.

    Code:
            byte[] MK5_CreateTemplate(byte[] WSQ)
            {
                try
                {
                    log.Info("** Inside MK5_CreateTemplate() method");
    
                    if (m_coder == null) return null;
    
                    AwWsq wsq = new AwWsq();
                    
                    log.Info("** Before converting WSQ format");
                    wsq.SetInputImage(AwWsqImageFormat.WSQ, WSQ);
                    log.Info("** After converting WSQ format");
    
                    int cols = wsq.GetInputImageCols();
                    int rows = wsq.GetInputImageRows();
    
                    log.Info("** WSQ Columns := " + cols.ToString());
                    log.Info("** WSQ Rows := " + rows.ToString());
    
                    byte[] raw = wsq.GetOutputImage(AwWsqImageFormat.RAW);
    
                    log.Info("** After getting WSQ Image");
                    log.Info("** WSQ Image Length := " + raw.Length.ToString());
    
    
                    wsq.Dispose();
    
                    if (string.IsNullOrEmpty(PadImageAndConvertToGray(ref raw, ref cols, ref rows)))
                    {
                        byte[] template = null;
                        try
                        {
                            log.Info("** Before m_coder.Enroll() method");
                            Sagem.MorphoKit.ICoderResult result = m_coder.Enroll(raw, cols, rows, 1);
                            log.Info("** After m_coder.Enroll() method");
    
                            if (result != null)
                            {
                                template = result.Template;
    
                                log.Info("** Template Length : " + template.Length.ToString());
    
                                return template;
                            }
                        }
                        catch (System.Exception ex)
                        {
                            log.Info("** Exception : " + ex.Message);
                            return null;
                        }
                    }
    
                    return null;
                }
                catch (Exception ex)
                {
                    log.Info("** Exception := " + ex.Message);
                    throw ex;
                }
            }
    The exception is coming on this line Sagem.MorphoKit.ICoderResult result = m_coder.Enroll(raw, cols, rows, 1);

    The strange thing is the same service works good when I run the service in my DEV environment from Visual Studio but when I deploy it on the server and it runs under IIS, it doesn't work.

    Any ideas??

    Thanks.

  2. #2
    Superbly Moderated NeedSomeAnswers's Avatar
    Join Date
    Jun 2002
    Location
    Manchester uk
    Posts
    2,657

    Re: An unhandled exception of type 'System.StackOverflowException' occurred in Sagem.

    How are you deploying your app to the server?

    Could you show us your deployed Webservice folder under wwwroot on your server?
    Please Mark your Thread "Resolved", if the query is solved & Rate those who have helped you



  3. #3

    Thread Starter
    Frenzied Member usamaalam's Avatar
    Join Date
    Nov 2002
    Location
    Karachi
    Posts
    1,308

    Re: An unhandled exception of type 'System.StackOverflowException' occurred in Sagem.

    Quote Originally Posted by NeedSomeAnswers View Post
    How are you deploying your app to the server?

    Could you show us your deployed Webservice folder under wwwroot on your server?
    I just copy pasted the folder and created the Virtual Directory, then I converted it to the Application. Please check the screenshot.

    Name:  finger.jpg
Views: 423
Size:  29.2 KB

  4. #4
    Fanatic Member
    Join Date
    Oct 1999
    Location
    England
    Posts
    982

    Re: An unhandled exception of type 'System.StackOverflowException' occurred in Sagem.

    When you are running it on the server under IIS is this using the same data as you use when running in DEV locally? If not could the amount of data be different e.g more rows/columns that are causing the overflow error?

    Also have you correctly configured the application pool relevant to your application?


    Things I do when I am bored: DotNetable

  5. #5
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: An unhandled exception of type 'System.StackOverflowException' occurred in Sagem.

    It's a StackOverflowException ... which usually means that the amount of data pushed onto the stack got to be too big. 99% of the time this happens when you call something recursively and don't put in a failsafe to prevent an infinite recursion. It's also happening in their module... not your code... which I find a bit odd. I wonder though if the call to PadImageAndConvertToGray is some how blowing out the size of the data into a format that causes recursion to happen to the point that the exception happens. Is there a way you can look at the size of the data before and after the call to PadImageAndConvertToGray?

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width