arcgisruntime 100.8 crashed

666
6
09-15-2020 11:26 PM
EricJing
New Contributor III

My application crashed due to the following error which copied from windows event log. 

In my code, I couldn't catch the exception. The app just crashed without any exception.

It happens at startup, not every time, but quite often. 

Does anyone have same issue? Can someone tell me how to solve this issue or how to find the root cause?


Faulting application name: MyClient.exe, version: 5.11.0.0, time stamp: 0x85799697
Faulting module name: runtimecore.dll, version: 100.8.0.2768, time stamp: 0x5eac7fc3
Exception code: 0xc0000005
Fault offset: 0x0000000000c8f5f4
Faulting process ID: 0x1580
Faulting application start time: 0x01d68befb01d39ca
Faulting application path: C:\Workspace\MyClient\Client\MyClient\bin\x64\Debug\MyClient.exe
Faulting module path: C:\Workspace\MyClient\Client\MyClient\bin\x64\Debug\runtimecore.dll
Report ID: 9d362766-7135-4e70-98d4-a5b0b4c19329
Faulting package full name:
Faulting package-relative application ID:

Tags (1)
0 Kudos
6 Replies
MichaelBranscomb
Esri Frequent Contributor

Hi,

Please can you update to the latest release v100.9 and retest?

If you can still reproduce then please follow the instructions in this Guide doc topic for obtaining a native call stack: Debug using ArcGIS Runtime Windows symbol files—ArcGIS Runtime SDK for .NET | ArcGIS for Developers 

Thanks

Mike

0 Kudos
EricJing
New Contributor III

Thank you for reply..

I follow your suggestion, upgrade to 100.9, it still happens. But I got the following exception.

Exception thrown at 0x00007FF8F82FD354 (runtimecore.dll) in MyClient.exe: 0xC0000005: Access violation writing location 0xFFFFFFFFFD37ACA0.

Stacktrace: 

> runtimecore.dll!00007ff8f82fd354() Unknown
runtimecore.dll!00007ff8f7e48b4f() Unknown
runtimecore.dll!00007ff8f7e4f2f6() Unknown
runtimecore.dll!00007ff8f9d83cef() Unknown
runtimecore.dll!00007ff8f9d842e2() Unknown
runtimecore.dll!00007ff8f9d8a932() Unknown
runtimecore.dll!00007ff8f9d8a6ec() Unknown
runtimecore.dll!00007ff8f9d897c4() Unknown
runtimecore.dll!00007ff8f7b2434d() Unknown
runtimecore.dll!00007ff8f9d9c2fb() Unknown
runtimecore.dll!00007ff8f9d9c1e6() Unknown
runtimecore.dll!00007ff8f9d9ebff() Unknown
ntdll.dll!00007ff9ae5138a0() Unknown
ntdll.dll!00007ff9ae4c276a() Unknown
kernel32.dll!00007ff9ad106fd4() Unknown
ntdll.dll!00007ff9ae4fcec1() Unknown

Then, symbol loader showed info "runtimecore_link.pdb could not be found in the selected paths". Looks the missing runtimecore_link.pdb stopped me getting more stacktrace....

How can I get runtimecore_link.pdb?

In addition,  I have a question which could relate to this issue...

My app has two threads to read a mmpk simultaneously at startup....Is it okay to do this? Does it possibly cause the crash? 

0 Kudos
MichaelBranscomb
Esri Frequent Contributor

Hi,

Apologies - the pdbs for 100.9 are still being staged before deployment to the production server. If you revert to 100.8 you'll get the pdbs and be able to get a native call stack.

Are you able to share the code where to open/load the mobile map package, and particularly the multi-threading code?

Thanks

Mike

0 Kudos
EricJing
New Contributor III

Hi, 

Thanks....After roll back to 100.8, I got the following stack trace when the exception occurred.

****************************************************************************
Exception thrown at 0x00007FF8EC20F5F4 (runtimecore.dll) in MyClient.exe: 0xC0000005: Access violation writing location 0x0000000002ADC0F0.


> runtimecore.dll!std::vector<class std::weak_ptr<class Esri_runtimecore::Geo_model::WMS_layer_info>,class std::allocator<class std::weak_ptr<class Esri_runtimecore::Geo_model::WMS_layer_info> > >::_Emplace_reallocate<class std::shared_ptr<class Esri_runtimecore::Geo_model::WMS_layer_info> const &>(class std::weak_ptr<class Esri_runtimecore::Geo_model::WMS_layer_info> * const,class std::shared_ptr<class Esri_runtimecore::Geo_model::WMS_layer_info> const &) Unknown
runtimecore.dll!Esri_runtimecore::Geo_model::Geodatabase::load_sync_(class pplx::cancellation_token const &) Unknown
runtimecore.dll!std::_Func_impl_no_alloc<<lambda_22e1f3949484d95b0c39990ed8fbdeea>,void>::_Do_call() Unknown
runtimecore.dll!std::_Func_impl_no_alloc<<lambda_23d350ddfca9531044d43a119b81b3d3>,boost::any>::_Do_call() Unknown
runtimecore.dll!<lambda>(void)() Unknown
runtimecore.dll!std::_Func_impl_no_alloc<<lambda>(void),boost::any>::_Do_call() Unknown
runtimecore.dll!pplx::task<boost::any>::_InitialTaskHandle<boost::any,<lambda>(void),pplx::details::_TypeSelectorNoAsync>::_Init() Unknown
runtimecore.dll!pplx::details::_PPLTaskHandle<boost::any,pplx::task<boost::any>::_InitialTaskHandle<boost::any,<lambda>(void),pplx::details::_TypeSelectorNoAsync>,pplx::details::_TaskProcHandle>::invoke() Unknown
runtimecore.dll!pplx::details::_TaskProcHandle::_RunChoreBridge(void *) Unknown
runtimecore.dll!Esri_runtimecore::Common::Core_scheduler::Queued_proc::invoke(void) Unknown
runtimecore.dll!Esri_runtimecore::Common::Core_scheduler::bridge_proc_(void *) Unknown
runtimecore.dll!Esri_runtimecore::Common::Windows_Threadpool_scheduler::Scheduler_param::work_callback(struct _TP_CALLBACK_INSTANCE *,void *,struct _TP_WORK *) Unknown
ntdll.dll!00007ff9a1c938a0() Unknown
ntdll.dll!00007ff9a1c4276a() Unknown
kernel32.dll!00007ff9a1336fd4() Unknown
ntdll.dll!00007ff9a1c7cec1() Unknown

****************************************************************************

Seems it is related to WMS_layer_info, but we do not use WMS_layer (I checked API documents, I do not know what it is)...

Regarding the code, I cannot copy all code... The following code is the method which opens mmpk file. It is invoked from two separate instances in two threads, I expect they read the same mmpk file from  two separate instances to create two separate map instances(we have two windows to display mapview, one is for detail map, the other is for overview.)

public abstract class MobileMapPackageBase : IMapPackage
{

protected virtual async Task Initialize()
{
try
{
MapPackage = await MobileMapPackage.OpenAsync(MapSettings.MapPackagePath);
}
catch (Exception e)
{
Logger.Error($"{Resources.Error_OpenMapFailure}.{e}");
throw new OpenMapFailureException(Resources.Error_OpenMapFailure, e);
}

if (MapPackage.Maps.Count <= 0)
{
throw new InvalidOperationException(Resources.Error_NoMapObjectInMmpk);
}

MapObject = MapPackage.Maps.First();

MapObject.MaxScale = await GetMaxScaleTask();
MapObject.MinScale = await GetMinScaleTask();

foreach (var layer in MapObject.OperationalLayers.ToList().AsParallel())
{
if (!RequestedLayerTypes.Contains(GetLayerTypeValue(layer.Name)))
{
MapObject.OperationalLayers.Remove(layer);
}
}

_layers.AddRange(MapObject.OperationalLayers);
}

}

0 Kudos
MichaelBranscomb
Esri Frequent Contributor

Hi,

- Can you share any of the multi-threading code? 

- Do you see the exception if only one thread is accessing the mobile map package? 

- What code runs in GetMaxScaleTask and GetMinScaleTask?

- Can you try awaiting the Map.LoadAsync operation before attempting to set the MaxScale and MinScale?
- What happens if you remove the List parallelization? 

Thanks

Mike

0 Kudos
EricJing
New Contributor III

Hi, 

- Can you share any of the multi-threading code? 

It is hard to copy all code, it is too much.We have two windows, each one holds a map. They are loading in multi-threading by calling the method I post...

- Do you see the exception if only one thread is accessing the mobile map package? 

I did not try with one thread on purpose..But even if I run it multi-threading, it does not happen every time...Sometimes, it happens 3 times in a row....Sometimes, I cannot see it once a whole day...And there is a strange thing, if the first time startup has this issue, mostly, the second time startup will be good. The multi-threading code has been used 3 months...I detect this issue in recent 3 weeks...Before, I did not notice this problem..

- What code runs in GetMaxScaleTask and GetMinScaleTask?

These two methods are simply retrieving a value from mmpk...

public async Task<double> GetMaxScaleTask()
{
string nameKey = KeyMaxScale;
var qryParams = new QueryParameters()
{
WhereClause = $"{GeoElementHelper.ColumnUName}='{nameKey}'",
ReturnGeometry = false,
};

var floorTable = GetTable(MapPackageTableTypes.settings);
var result = await floorTable.QueryFeaturesAsync(qryParams).ContinueWith(t => t.Result.FirstOrDefault());
if (null == result)
{
throw new InvalidOperationException(string.Format(Resources.Msg_NoKeyInMapPackage, KeyMaxScale));
}
return double.Parse(result.GetAttributeValue(GeoElementHelper.ColumnUValue1).ToString());
}

public async Task<double> GetMinScaleTask()
{
string nameKey = KeyMinScale;

var qryParams = new QueryParameters()
{
WhereClause = $"{GeoElementHelper.ColumnUName}='{nameKey}'",
ReturnGeometry = false,
};

var floorTable = GetTable(MapPackageTableTypes.settings);
Feature result = await floorTable.QueryFeaturesAsync(qryParams).ContinueWith(t => t.Result.FirstOrDefault());
if (null == result)
{
throw new InvalidOperationException(string.Format(Resources.Msg_NoKeyInMapPackage, KeyMinScale));
}

return double.Parse(result.GetAttributeValue(GeoElementHelper.ColumnUValue1).ToString());
}

**************************************************

- Can you try awaiting the Map.LoadAsync operation before attempting to set the MaxScale and MinScale?
- What happens if you remove the List parallelization? 

I will try this...

And I have two questions..

1. Does the stack trace I copied provide some useful information?

2. Can you let me know if loading mmpk in multi-threading is safe?

Thanks...

0 Kudos