ufairiya / mongoose

Automatically exported from code.google.com/p/mongoose
MIT License
0 stars 0 forks source link

Mongoose 2.8 embedded c# crashes when accessing a urihandler. #123

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Compile example.cs and mongoose.cs on visual studio 2008 or 2010
2. run example.exe and access either /foo or /dumpinfo

What is the expected output? What do you see instead?
I except to get a webpage with the info.  Instead I get this error on the 
console:
Unhandled Exception: System.AccessViolationException: Attempted to read or 
write  protected memory. This is often an indication that other memory is 
corrupt.

What version of the product are you using? On what operating system?
2.8

Please provide any additional information below.
This happens on both Windows server 2003 (x86) and Windows 7 (x64)

Original issue reported on code.google.com by Brondo...@gmail.com on 27 Feb 2010 at 1:11

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Works for me on Windows XP, Visual Studio 2008 with self-compiled 
_mongoose.dll. 
/dumpinfo gives me 404,
but /foo works fine.

Suspect:
1.  Bad _mongoose.dll?  Ask if you want mine.
2.  Data execution prevention (DEP) shutting you down?  Windows might think your
program is accessing protected memory and shutting down your app.  Suggest you 
first
disable DEP on Windows 7: http://www.itechtalk.com/thread3591.html

Original comment by franklin...@gmail.com on 6 Mar 2010 at 12:45

GoogleCodeExporter commented 9 years ago
I also have this issue. I built _mongoose.dll from stable sources. I tried both 
x86 and 
x64, making sure to set the target in my C# project to the same, i.e. NOT 
AnyCPU. With 
x86 I get the described access violation. With x64 my application immediately 
crashes 
on run.

I tried disabling DEP for my app but it doesn't appear possible for .NET 
applications. 
Disabling DEP is a bad idea anyway.

Original comment by olen...@gmail.com on 6 Mar 2010 at 2:36

GoogleCodeExporter commented 9 years ago
I also tried a copy of _mongoose.dll compiled with MinGW and got the exact same 
problem.

Original comment by olen...@gmail.com on 6 Mar 2010 at 6:07

GoogleCodeExporter commented 9 years ago
Is it possible to disable it entirely for the whole computer, run the test, 
then turn it back on?

This is all speculation on my part - could end up being a wild-goose chase.

Original comment by franklin...@gmail.com on 6 Mar 2010 at 7:28

GoogleCodeExporter commented 9 years ago
I have (very very) tentatively confirmed that this issue is caused by DEP.

I wrote a Mongoose callback causing the exact problem the OP described, but only
after ~100 refreshes (with the F5 key held down).  I disabled DEP, and the 
problem
went away.

Original comment by franklin...@gmail.com on 13 Mar 2010 at 2:56

GoogleCodeExporter commented 9 years ago
I don't understand, what in Mongoose is causing a problem for DEP? Other 
libraries 
don't have this issue?

Original comment by olen...@gmail.com on 13 Mar 2010 at 3:36

GoogleCodeExporter commented 9 years ago
olenikm - 

Hi, I rescind my blame on DEP.  Apologies for being stubborn; it seemed like a 
good 
scapegoat at the time.

Running windbg shows a failed RTLFreeHeap at every callback.  Also, task 
manager 
shows that there's a small memory leak at every callback (which is consistent 
with 
the failed RTLFreeHeap).  This test was performed on the golden example code.  
Can 
someone verify this?

I suspect that this may have to do with the pinvoke.  This article [ 
http://www.eggheadcafe.com/software/aspnet/32697277/howto-use-callback-functi.as
px ] 
suggests we may have to add [UnmanagedFunctionPointer 
(CallingConvention.Cdecl)] 
before callback2.  However, this didn't fix it for me.  Still investigating.

Original comment by franklin...@gmail.com on 23 Mar 2010 at 12:35

GoogleCodeExporter commented 9 years ago
I also tried the same fix with UnmanagedFunctionPointer, also to no avail.

Original comment by olen...@gmail.com on 23 Mar 2010 at 12:40

GoogleCodeExporter commented 9 years ago
Oh man, I wish I had seen issues 81 & 85.  They are the same thing as this one.

I'll suggest marking this one closed and continuing the discussion in 81/85.

Original comment by franklin...@gmail.com on 23 Mar 2010 at 12:46

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I have observed that the C# bindings work correctly on Windows XP.  However, 
they
fail intermittently on both Vista & Windows 7, always resulting in an "Out of 
Memory"
exception.

Issues # 81, 85, & 123 All refer to broken C# bindings.  The first problem was
reported nearly eight months ago, in August, 2009.  Since it seems like the 
problem
isn't going to be addressed anytime soon, would someone please update the 
"Language
Support" section on Project's Home page, to indicate that Mongoose no longer 
works
with C# on Windows Vista and higher.

Original comment by codemonk...@gmail.com on 26 Mar 2010 at 9:59

GoogleCodeExporter commented 9 years ago
Done. I am discontinuing C# support because I don't have resources to do it.

Original comment by valenok on 12 Sep 2010 at 9:34

GoogleCodeExporter commented 9 years ago
Any chance this will ever get revived?

Original comment by mmihajlo...@gmail.com on 19 Feb 2013 at 1:16

GoogleCodeExporter commented 9 years ago
Unfortunately, I don't have resources to support bindings, so the answer is no.

Original comment by valenok on 19 Feb 2013 at 2:33