
- VBForums
- .NET and More
- C#
- 4.0 An unhandled exception of type 'System.StackOverflowException' occurred in Sagem.Morp
-
Dec 21st, 2015, 11:12 PM
#1
Thread Starter
Frenzied Member
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.
-
Dec 22nd, 2015, 03:51 AM
#2
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
-
Dec 22nd, 2015, 04:20 AM
#3
Thread Starter
Frenzied Member
Re: An unhandled exception of type 'System.StackOverflowException' occurred in Sagem.
 Originally Posted by NeedSomeAnswers
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.
-
Dec 29th, 2015, 06:32 AM
#4
Fanatic Member
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?
-
Dec 29th, 2015, 08:29 AM
#5
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

- VBForums
- .NET and More
- C#
- 4.0 An unhandled exception of type 'System.StackOverflowException' occurred in Sagem.Morp
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|