Since Windows 10 1709 Update - System.OutOfMemoryException c# .net - c#

My winforms application has been running perfectly until the latest Windows 10 1709 Update and ever since updating my app crashes constantly when running the standalone .exe or in Visual Studio 2017. The app crashses on any machine with the latest 1709 update. As a test, I created a Windows 7 machine and works perfectly and all versions prior to Windows 10 1709 fine.
Its pretty random when I get System.OutOfMemoryException exception = usually however when System.Form.Timer fires or a thread is run (this may be a a clue!).
One thing for sure, I am not out of memory! (32GB with 50% available on my development machine).
I am at a loss what is causing this and have tried the following:
The solution comprises of around 30 C# projects.
-I have updated from .Net 4.6 to 4.6.1 then to 4.7 and 4.7.1
-Updated all Nuget projects.
-Compiled code on Windows 7, ran on Windows 10 (crashes) - it runs fine on Windows 7.
- Ran on Windows 10 Home, Windows 10 Pro (1709). Works fine on older Windows 10!
- Fresh install of Windows 10 Pro with 32GB of RAM (my development machine).
- Disabled timers and threads (only to get exceptions elsewhere).
Roll back the OS is not a solution as I have users that rely on this software running Windows 10. I have been looking at this for the last week without no resolution and hope I can get some good pointers to finally resolve this.
Below are two tracebacks - I have 100s of these tracebacks (via rollbar.com) since I updated to latest 1709:
Traceback (most recent call last):
1
at Winforms.Components.ApplicationIdle.System.Windows.Forms.IMessageFilter.PreFilterMessage(System.Windows.Forms.Message& m) in "Winforms.Components.ApplicationIdle" line 17
2
at System.Windows.Forms.Application+ThreadContext.ProcessFilters(System.Windows.Forms.NativeMethods+MSG& msg, System.Boolean& modified) in "System.Windows.Forms.Application+ThreadContext" line 188
3
at System.Windows.Forms.Application+ThreadContext.PreTranslateMessage(System.Windows.Forms.NativeMethods+MSG& msg) in "System.Windows.Forms.Application+ThreadContext" line 2
4
at System.Windows.Forms.Application+ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FPreTranslateMessage(System.Windows.Forms.NativeMethods+MSG& msg) in "System.Windows.Forms.Application+ThreadContext" line 0
5
at System.Windows.Forms.Application+ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(System.IntPtr dwComponentID, System.Int32 reason, System.Int32 pvLoopData) in "System.Windows.Forms.Application+ComponentManager" line 349
6
at System.Windows.Forms.Application+ThreadContext.RunMessageLoopInner(System.Int32 reason, System.Windows.Forms.ApplicationContext context) in "System.Windows.Forms.Application+ThreadContext" line 484
7
at System.Windows.Forms.Application+ThreadContext.RunMessageLoop(System.Int32 reason, System.Windows.Forms.ApplicationContext context) in "System.Windows.Forms.Application+ThreadContext" line 20
8
at System.Windows.Forms.Application.Run(System.Windows.Forms.Form mainForm) in "System.Windows.Forms.Application" line 12
9
at CRS.Program.Main() in "CRS.Program" line 456
System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at System.Windows.Forms.Internal.WindowsGraphics.FromHdc(System.IntPtr hDc) in "System.Windows.Forms.Internal.WindowsGraphics" line 7
2
at System.Windows.Forms.Internal.WindowsGraphics.FromGraphics(System.Drawing.Graphics g, System.Windows.Forms.Internal.ApplyGraphicsProperties properties) in "System.Windows.Forms.Internal.WindowsGraphics" line 114
3
at System.Windows.Forms.WindowsGraphicsWrapper..ctor(System.Drawing.IDeviceContext idc, System.Windows.Forms.TextFormatFlags flags) in "System.Windows.Forms.WindowsGraphicsWrapper" line 45
4
at System.Windows.Forms.VisualStyles.VisualStyleRenderer.GetPartSize(System.Drawing.IDeviceContext dc, System.Windows.Forms.VisualStyles.ThemeSizeType type, System.IntPtr hWnd) in "System.Windows.Forms.VisualStyles.VisualStyleRenderer" line 58
5
at System.Windows.Forms.RadioButtonRenderer.GetGlyphSize(System.Drawing.Graphics g, System.Windows.Forms.VisualStyles.RadioButtonState state, System.IntPtr hWnd) in "System.Windows.Forms.RadioButtonRenderer" line 13
6
at System.Windows.Forms.ButtonInternal.RadioButtonStandardAdapter.Layout(System.Windows.Forms.PaintEventArgs e) in "System.Windows.Forms.ButtonInternal.RadioButtonStandardAdapter" line 35
7
at System.Windows.Forms.ButtonInternal.CheckableControlBaseAdapter.GetPreferredSizeCore(System.Drawing.Size proposedSize) in "System.Windows.Forms.ButtonInternal.CheckableControlBaseAdapter" line 44
8
at System.Windows.Forms.ButtonBase.GetPreferredSizeCore(System.Drawing.Size proposedConstraints) in "System.Windows.Forms.ButtonBase" line 0
9
at System.Windows.Forms.RadioButton.GetPreferredSizeCore(System.Drawing.Size proposedConstraints) in "System.Windows.Forms.RadioButton" line 9
10
at System.Windows.Forms.Control.GetPreferredSize(System.Drawing.Size proposedSize) in "System.Windows.Forms.Control" line 90
11
at System.Windows.Forms.ButtonBase.GetPreferredSize(System.Drawing.Size proposedSize) in "System.Windows.Forms.ButtonBase" line 36
12
at System.Windows.Forms.Layout.DefaultLayout.LayoutAutoSizedControls(System.Windows.Forms.Layout.IArrangedElement container) in "System.Windows.Forms.Layout.DefaultLayout" line 106
13
at System.Windows.Forms.Layout.DefaultLayout.xLayout(System.Windows.Forms.Layout.IArrangedElement container, System.Boolean measureOnly, System.Drawing.Size& preferredSize) in "System.Windows.Forms.Layout.DefaultLayout" line 0
14
at System.Windows.Forms.Layout.DefaultLayout.LayoutCore(System.Windows.Forms.Layout.IArrangedElement container, System.Windows.Forms.LayoutEventArgs args) in "System.Windows.Forms.Layout.DefaultLayout" line 0
15
at System.Windows.Forms.Layout.LayoutEngine.Layout(System.Object container, System.Windows.Forms.LayoutEventArgs layoutEventArgs) in "System.Windows.Forms.Layout.LayoutEngine" line 0
16
at System.Windows.Forms.Control.OnLayout(System.Windows.Forms.LayoutEventArgs levent) in "System.Windows.Forms.Control" line 47
17
at System.Windows.Forms.Control.PerformLayout(System.Windows.Forms.LayoutEventArgs args) in "System.Windows.Forms.Control" line 105
18
at System.Windows.Forms.Control.System.Windows.Forms.Layout.IArrangedElement.PerformLayout(System.Windows.Forms.Layout.IArrangedElement affectedElement, System.String affectedProperty) in "System.Windows.Forms.Control" line 8
19
at System.Windows.Forms.Control.Scale(System.Drawing.SizeF includedFactor, System.Drawing.SizeF excludedFactor, System.Windows.Forms.Control requestingControl) in "System.Windows.Forms.Control" line 44
20
at System.Windows.Forms.Control.ScaleChildControls(System.Drawing.SizeF includedFactor, System.Drawing.SizeF excludedFactor, System.Windows.Forms.Control requestingControl) in "System.Windows.Forms.Control" line 45
21
at System.Windows.Forms.Control.Scale(System.Drawing.SizeF includedFactor, System.Drawing.SizeF excludedFactor, System.Windows.Forms.Control requestingControl) in "System.Windows.Forms.Control" line 23
22
at System.Windows.Forms.Control.ScaleChildControls(System.Drawing.SizeF includedFactor, System.Drawing.SizeF excludedFactor, System.Windows.Forms.Control requestingControl) in "System.Windows.Forms.Control" line 45
23
at System.Windows.Forms.Control.Scale(System.Drawing.SizeF includedFactor, System.Drawing.SizeF excludedFactor, System.Windows.Forms.Control requestingControl) in "System.Windows.Forms.Control" line 23
24
at System.Windows.Forms.Control.ScaleChildControls(System.Drawing.SizeF includedFactor, System.Drawing.SizeF excludedFactor, System.Windows.Forms.Control requestingControl) in "System.Windows.Forms.Control" line 45
25
at System.Windows.Forms.Control.Scale(System.Drawing.SizeF includedFactor, System.Drawing.SizeF excludedFactor, System.Windows.Forms.Control requestingControl) in "System.Windows.Forms.Control" line 23
26
at System.Windows.Forms.Control.ScaleChildControls(System.Drawing.SizeF includedFactor, System.Drawing.SizeF excludedFactor, System.Windows.Forms.Control requestingControl) in "System.Windows.Forms.Control" line 45
27
at System.Windows.Forms.Control.Scale(System.Drawing.SizeF includedFactor, System.Drawing.SizeF excludedFactor, System.Windows.Forms.Control requestingControl) in "System.Windows.Forms.Control" line 23
28
at System.Windows.Forms.Control.ScaleChildControls(System.Drawing.SizeF includedFactor, System.Drawing.SizeF excludedFactor, System.Windows.Forms.Control requestingControl) in "System.Windows.Forms.Control" line 45
29
at System.Windows.Forms.Control.Scale(System.Drawing.SizeF includedFactor, System.Drawing.SizeF excludedFactor, System.Windows.Forms.Control requestingControl) in "System.Windows.Forms.Control" line 23
30
at System.Windows.Forms.ContainerControl.OnChildLayoutResuming(System.Windows.Forms.Control child, System.Boolean performLayout) in "System.Windows.Forms.ContainerControl" line 81
31
at System.Windows.Forms.Control.OnChildLayoutResuming(System.Windows.Forms.Control child, System.Boolean performLayout) in "System.Windows.Forms.Control" line 0
32
at System.Windows.Forms.Control.OnChildLayoutResuming(System.Windows.Forms.Control child, System.Boolean performLayout) in "System.Windows.Forms.Control" line 0
33
at System.Windows.Forms.Control.OnLayoutResuming(System.Boolean performLayout) in "System.Windows.Forms.Control" line 8
34
at System.Windows.Forms.Control.ResumeLayout(System.Boolean performLayout) in "System.Windows.Forms.Control" line 35
35
at CRS.Dialogs.frmCheckin.InitializeComponent() in "CRS.Dialogs.frmCheckin" line 75929
36
at CRS.Dialogs.frmCheckin..ctor() in "CRS.Dialogs.frmCheckin" line 298
37
at CRS.Dialogs.OpenTicketHelper.OpenTicket() in "CRS.Dialogs.OpenTicketHelper" line 12
38
at CRS.Dialogs.frmTicketTracker.btnNewCheckin_Click(System.Object sender, System.EventArgs e) in "CRS.Dialogs.frmTicketTracker" line 19
39
at System.Windows.Forms.Control.OnClick(System.EventArgs e) in "System.Windows.Forms.Control" line 25
40
at System.Windows.Forms.Button.OnClick(System.EventArgs e) in "System.Windows.Forms.Button" line 46
41
at System.Windows.Forms.Button.OnMouseUp(System.Windows.Forms.MouseEventArgs mevent) in "System.Windows.Forms.Button" line 119
42
at System.Windows.Forms.Control.WmMouseUp(System.Windows.Forms.Message& m, System.Windows.Forms.MouseButtons button, System.Int32 clicks) in "System.Windows.Forms.Control" line 388
43
at System.Windows.Forms.Control.WndProc(System.Windows.Forms.Message& m) in "System.Windows.Forms.Control" line 1647
44
at System.Windows.Forms.ButtonBase.WndProc(System.Windows.Forms.Message& m) in "System.Windows.Forms.ButtonBase" line 0
45
at System.Windows.Forms.Button.WndProc(System.Windows.Forms.Message& m) in "System.Windows.Forms.Button" line 61
46
at System.Windows.Forms.Control+ControlNativeWindow.OnMessage(System.Windows.Forms.Message& m) in "System.Windows.Forms.Control+ControlNativeWindow" line 0
47
at System.Windows.Forms.Control+ControlNativeWindow.WndProc(System.Windows.Forms.Message& m) in "System.Windows.Forms.Control+ControlNativeWindow" line 142
48
at System.Windows.Forms.NativeWindow.Callback(System.IntPtr hWnd, System.Int32 msg, System.IntPtr wparam, System.IntPtr lparam) in "System.Windows.Forms.NativeWindow" line 37
System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.

Its turned out the actual issue was .Net WebBrowser Control that was causing massive amount of memory to be used.. I had fice WebBrowser controls open at the same time.. would eat 2GB of RAM! (more if the x32 compiled app didnt crash, x64 lasted much longer!).
Removed them, app only consumes 25MB again!
p.s. changing over to CefSharp to see if this fares better!

Related

Unclear Sqlite exception after updating my UWP app

After updating the UWP app, I get many crash from the different sections of the app
STOWED_EXCEPTION_Microsoft.Data.Sqlite.SqliteException_80131500***APP-NAME***.dll!Microsoft::Data::Sqlite::SqliteCommand.ExecuteReader
Which did not happend in previous version, I also did not change the database access code section nor updated/reinstalled the EF Sqlite nugget package.
Here are Stacktrace i have received from users:
Thanks
Frame Image Function Offset
0 Microsoft.Data.Sqlite.dll Microsoft::Data::Sqlite::Interop::MarshalEx.ThrowExceptionForRC 0x0000000000000067
1 Microsoft.Data.Sqlite.dll Microsoft::Data::Sqlite::SqliteCommand.ExecuteReader 0x000000000000012F
2 Microsoft.Data.Sqlite.dll Microsoft::Data::Sqlite::SqliteCommand.ExecuteDbDataReader 0x000000000000000B
3 EntityFramework.Relational.dll Microsoft::Data::Entity::Storage::Internal::RelationalCommand::__c__DisplayClass17_0._ExecuteReader_b__0$catch$0 0x0000000000000013
4 SharedLibrary.dll System::Func$1_System::__Canon_.Invoke 0x0000000000000013
5 EntityFramework.Relational.dll Microsoft::Data::Entity::Storage::Internal::RelationalCommand.Execute_System.__Canon_$catch$0 0x00000000000000C1
6 EntityFramework.Relational.dll Microsoft::Data::Entity::Storage::Internal::RelationalCommand.ExecuteReader 0x0000000000000057
7 EntityFramework.Relational.dll Microsoft::Data::Entity::Query::Internal::QueryingEnumerable::Enumerator.MoveNext 0x000000000000008B
8 EntityFramework.Relational.dll Microsoft::Data::Entity::Query::QueryMethodProvider.GetResult_System.Int32_ 0x000000000000003D
9 APPNAME.McgInterop.dll _$ILCT$::$ILT$ReflectionDynamicInvoke$.InvokeRetOI_System.__Canon,System.Int32 0x0000000000000061
10 SharedLibrary.dll System::InvokeUtils.CallIHelperStaticCallWithInstantiation 0x0000000000000023
11 SharedLibrary.dll System::InvokeUtils.CallDynamicInvokeMethod 0x0000000000000119
12 System.Linq.Expressions System::Linq::Expressions::Interpreter::MethodInfoCallInstruction.InvokeWorker$catch$0 0x0000000000000017
13 System.Linq.Expressions System::Linq::Expressions::Interpreter::MethodInfoCallInstruction.Invoke 0x0000000000000009
14 System.Linq.Expressions System::Linq::Expressions::Interpreter::MethodInfoCallInstruction.Run 0x0000000000000065
15 System.Linq.Expressions System::Linq::Expressions::Interpreter::Interpreter.Run 0x0000000000000027
16 System.Linq.Expressions System::Linq::Expressions::Interpreter::LightLambda.Run 0x000000000000009B
17 SharedLibrary.dll System::Runtime::CompilerServices::ConditionalWeakTable$2_System::__Canon,System::__Canon_::CreateValueCallback.InvokeObjectArrayThunk 0x0000000000000037
18 EntityFramework.Core.dll Microsoft::Data::Entity::Query::Internal::QueryCompiler::__c__DisplayClass18_1$1_System::Int32_._CompileQuery_b__1$catch$0 0x0000000000000059
19 SharedLibrary.dll System::Comparison$1_System::__Canon_.Invoke 0x0000000000000013
20 EntityFramework.Core.dll Microsoft::Data::Entity::Query::Internal::QueryCompiler.Execute_System.Int32_ 0x000000000000003D
21 EntityFramework.Core.dll Microsoft::Data::Entity::Query::Internal::EntityQueryProvider.Execute_System.Int32_ 0x0000000000000033
22 System.Linq.Queryable.dll System::Linq::Queryable.Count_System.Int32_ 0x0000000000000121
23 APPNAME*.exe InstagramDownloader::pgHome._imgDownloader_b__15_4 0x0000000000000167
24 APPNAME*.McgInterop.dll Windows::System::Threading::TimerElapsedHandler.Invoke 0x000000000000000F
25 APPNAME*.McgInterop.dll McgInterop::ReverseComSharedStubs.Proc_ 0x0000000000000015
26 SharedLibrary.dll System::Runtime::ExceptionServices::ExceptionDispatchInfo.Throw 0x0000000000000019
27 System.Private.Threading System::Runtime::CompilerServices::TaskAwaiter.ThrowForNonSuccess 0x0000000000000053
28 System.Private.Threading System::Runtime::CompilerServices::TaskAwaiter.HandleNonSuccessAndDebuggerNotification 0x000000000000002D
29 System.Private.Threading System::Runtime::CompilerServices::TaskAwaiter.ValidateEnd 0x000000000000001D
30 System.Private.Threading System::Runtime::CompilerServices::TaskAwaiter.GetResult 0x000000000000000B
31 APPNAME*.exe InstagramDownloader::pgHome::_imgDownloader_d__15.MoveNext 0x00000000000015AF
32 SharedLibrary.dll System::Runtime::ExceptionServices::ExceptionDispatchInfo.Throw 0x0000000000000019
33 System.Private.Threading System::Runtime::CompilerServices::TaskAwaiter.ThrowForNonSuccess 0x0000000000000053
34 System.Private.Threading System::Runtime::CompilerServices::TaskAwaiter.HandleNonSuccessAndDebuggerNotification 0x000000000000002D
35 System.Private.Threading System::Runtime::CompilerServices::TaskAwaiter.ValidateEnd 0x000000000000001D
36 System.Private.Threading System::Runtime::CompilerServices::TaskAwaiter.GetResult 0x000000000000000B
37 APPNAME*.exe InstagramDownloader::pgHome::_btnDownload_Click_d__17.MoveNext 0x000000000000025D
38 APPNAME*.McgInterop.dll McgInterop::McgHelpers.ThrowFailed 0x0000000000000033
39 APPNAME*.McgInterop.dll McgInterop::ComCallHelpers.ComCall__HRESULT 0x00000000000000A9
40 APPNAME*.McgInterop.dll McgInterop::ForwardComSharedStubs.Func_TResult___System.__Canon,_System.__Canon_ 0x000000000000002B
41 APPNAME*.McgInterop.dll Windows::UI::Popups::MessageDialog.ShowAsync 0x0000000000000011
42 APPNAME*.exe InstagramDownloader::pgHome::_btnDownload_Click_d__17.MoveNext$catch$0 0x000000000000002F
43 SharedLibrary.dll System::Runtime::ExceptionServices::ExceptionDispatchInfo.Throw 0x0000000000000019
44 System.Private.Threading System::Runtime::CompilerServices::AsyncMethodBuilderCore::__c._ThrowAsync_b__9_0 0x0000000000000013
45 System.Private.Threading System::Threading::WinRTSynchronizationContext::Invoker.InvokeCore 0x0000000000000033
I suggest updating all SQLite-related packages on NuGet as well as the SQLite extension for Visual Studio (via Tools -> Extensions and Updates...)
Update
As I have learned, you use EntityFrameworkCore, which works only with Windows 10 Fall Creators Update and newer and will not work on older versions of UWP. To get rid of the issues, you will have to set your app to have minimum SDK version 16299 (FCU). If you need to support older versions, you will have to work without Entity Framework for now...

Objective_C Exception Thrown when debugging Xamarin C# iOS App

When I go to build and debug my iOS app, the simulator runs but I get an exception thrown and the simulator doesn't open. I'm using Visual Studio for Mac.
The error is:
Objective-C exception thrown.Name: NSInvalidArgumentException Reason:
Could not find a storyboard named 'Main' in bundle NSBundle
</Users/(Username
here)/Library/Developer/CoreSimulator/Devices/23E98CA3-FC40-4AA4-8AAD-
62A9FADE1118/data/Containers/Bundle/Application/715B09C7-FBF2-41E6-
8FCD-A6329DE9E758/(AppName Here).app> (loaded)
Native stack trace:
0 CoreFoundation 0x0000000108f31b0b
__exceptionPreprocess + 171
1 libobjc.A.dylib 0x0000000113b0e141
objc_exception_throw + 48
2 UIKit 0x000000010d005cfb +
[UIStoryboard storyboardWithName:bundle:] + 663
3 UIKit 0x000000010c84590d -
[UIApplication _loadMainStoryboardFileNamed:bundle:] + 72
4 UIKit 0x000000010c845e13 -
[UIApplication _loadMainInterfaceFile] + 260
5 UIKit 0x000000010c8444b6 -
[UIApplication _runWithMainScene:transitionContext:completion:] + 1407
6 UIKit 0x000000010c8417f3 -
[UIApplication workspaceDidEndTransaction:] + 182
7 FrontBoardServices 0x00000001168265f6
__FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 24
8 FrontBoardServices 0x000000011682646d -
[FBSSerialQueue _performNext] + 186
9 FrontBoardServices 0x00000001168267f6 -
[FBSSerialQueue _performNextFromRunLoopSource] + 45
10 CoreFoundation 0x0000000108ed7c01
__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
11 CoreFoundation 0x0000000108ebd0cf
__CFRunLoopDoSources0 + 527
12 CoreFoundation 0x0000000108ebc5ff
__CFRunLoopRun + 911
13 CoreFoundation 0x0000000108ebc016
CFRunLoopRunSpecific + 406
14 UIKit 0x000000010c84008f -
[UIApplication _run] + 468
15 UIKit 0x000000010c846134
UIApplicationMain + 159
16 ??? 0x000000012bee336c 0x0 +
5031998316
17 ??? 0x0000000128fc6abd 0x0 +
4982598333
Thanks,
Z
Edit:
Adding picture.
Info.plist
It seems like no main.storyboard can be found in your project.
Check this
if the Main Interface is Main , check if main.storyboard exsits in your project.
Or you can change it to other viewController.
Okay, the weirdest thing fixed it. I installed an older version of Xarmarin iOS that I got from this page: https://bugzilla.xamarin.com/show_bug.cgi?id=38206
Then when I opened Visual Studio it didn't detect it and had me update it. After updating it, my app was able to debug and the simulator worked fine! Very, very weird!

Why I have different compression byte array sizes using DeflateStream on different machines

I'm compressing short string on my machine using DeflateStream
public byte[] Compress(byte[] oryginalBytes)
{
using (var msi = new MemoryStream(oryginalBytes))
using (var mso = new MemoryStream())
{
using (var gs = new DeflateStream(mso, CompressionMode.Compress))
{
msi.CopyTo(gs);
}
return mso.ToArray();
}
}
And run this code:
Compress(Encoding.Unicode.GetBytes("[TEST]"));
On my machine (windows 7 64 bit) I get 12 elements byte array:
139 102 8 97 112 101 8 6 146 177 12 0
And running this on my build server (Windows 2008 64bit) I have 120 elements byte array.
236 189 7 96 28 73 150 37 38 47 109 202 123 127 74 245 74 215 224 116 161 8 128 96 19 36 216 144 64 16 236 193 136 205 230 146 236 29 105 71 35 41 171 42 129 202 101 86 101 93 102 22 64 204 237 157 188 247 222 123 239 189 247 222 123 239 189 247 186 59 157 78 39 247 223 255 63 92 102 100 1 108 246 206 74 218 201 158 33 128 170 200 31 63 126 124 31 63 34 190 247 107 188 249 53 78 127 141 215 244 239 247 127 141 255 39 0 0 255 255
Anybody has an idea why this behave so strange?
DeflateStream manual
This class represents the Deflate algorithm, which is an industry-standard algorithm for lossless file compression and decompression. Starting with the .NET Framework 4.5, the DeflateStream class uses the zlib library. As a result, it provides a better compression algorithm and, in most cases, a smaller compressed file than it provides in earlier versions of the .NET Framework.

GNUPlot: From 3D scatter plot to Countour map

Given the following list of x,y,z points (z is actually a signal strength indicator in dBm):
63 371 -21
142 371 -9
233 374 -18
288 371 -36
310 373 -38
349 374 -39
415 348 -44
507 334 -49
689 337 -56
635 254 -57
422 284 -42
380 278 -39
281 280 -39
214 299 -34
146 285 -30
81 302 -39
76 246 -39
80 214 -44
137 200 -44
64 134 -48
73 87 -48
200 101 -46
230 202 -44
246 105 -53
285 109 -53
278 191 -50
334 87 -54
395 189 -56
513 208 -58
510 99 -61
553 101 -62
593 100 -65
634 101 -64
679 102 -68
731 196 -70
I can quite easily generate a 3D scatter plot using this command in gnuplot:
splot "C:/path/to/points.dat" with points
What I'm really after is a way to "fill in the gaps" and create a surface. The ultimate goal is to use data like the points shown above to generate an RF map for a given WiFi access point. The resulting map would be used to calculate the possible locations of a device, given its RSSI (received signal strength indicator).
(Several APs and their associated RF maps will be used, however I don't think the specifics are relevant to this question.)
What would be the best way to interpolate the z-values (RSSI in dBm, in this case) for the remaining points?
EDIT :
I seem to have made some progress. Using set dgrid3d 50,100 splines before the splot command seems to generate more or less what I'm looking for. So the next question is: how can I replicate this kind of function in code (C#, ideally)?

Why do I get an exception when updating row on sqlite with monotouch?

I have a simple table and when I try to update row on SQLite, the application close and expose this exception:
Stacktrace:
at (wrapper managed-to-native) MonoTouch.UIKit.UIApplication.UIApplicationMain (int,string[],intptr,intptr) <0xffffffff>
at MonoTouch.UIKit.UIApplication.Main (string[],string,string) <0x000b7>
at RemedioNaHora.Application.Main (string[]) <0x00017>
at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object (object,intptr,intptr,intptr) <0xffffffff>
Native stacktrace:
0 RemedioNaHora 0x000908ec mono_handle_native_sigsegv + 284
1 RemedioNaHora 0x00005c88 mono_sigsegv_signal_handler + 248
2 libsystem_c.dylib 0x9365c59b _sigtramp + 43
3 ??? 0xffffffff 0x0 + 4294967295
4 UIKit 0x0219355a -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 61
5 UIKit 0x02238b76 -[UIControl sendAction:to:forEvent:] + 66
6 UIKit 0x0223903f -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 503
7 UIKit 0x0238aa6c -[_UISwitchInternalView _sendActions] + 121
8 Foundation 0x0173786d __NSFireDelayedPerform + 389
9 CoreFoundation 0x01195966 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 22
10 CoreFoundation 0x01195407 __CFRunLoopDoTimer + 551
11 CoreFoundation 0x010f87c0 __CFRunLoopRun + 1888
12 CoreFoundation 0x010f7db4 CFRunLoopRunSpecific + 212
13 CoreFoundation 0x010f7ccb CFRunLoopRunInMode + 123
14 GraphicsServices 0x04789879 GSEventRunModal + 207
15 GraphicsServices 0x0478993e GSEventRun + 114
16 UIKit 0x02190a9b UIApplicationMain + 1175
17 ??? 0x0b5b9784 0x0 + 190551940
18 ??? 0x0b5b89d0 0x0 + 190548432
19 ??? 0x0b5b8878 0x0 + 190548088
20 ??? 0x0b5b8907 0x0 + 190548231
21 RemedioNaHora 0x00009ff2 mono_jit_runtime_invoke + 722
22 RemedioNaHora 0x00169eee mono_runtime_invoke + 126
23 RemedioNaHora 0x0016dfd4 mono_runtime_exec_main + 420
24 RemedioNaHora 0x001733f5 mono_runtime_run_main + 725
25 RemedioNaHora 0x000671f5 mono_jit_exec + 149
26 RemedioNaHora 0x002116c9 main + 2825
27 RemedioNaHora 0x00003045 start + 53
=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================
Does somebody know what happened?
It looks like an UISwitch is calling back into managed code. It's likely:
calling into an object that has been garbage collected (it's freed and can't be used anymore). Ensuring you kept a reference to the object being used would solve this; or
it could also be calling an UI element out of the main thread. Ensuring UI elements are only used form the main thread would solve that case.
Hopefully this will help you. If not we'll need to see some source code in order to help you further. You can edit your question to add it.

Categories