Answered by:
Power Query - Unexpected Error Memory Corrupt when opening other files or having other files open

Question
-
I have been getting Unexpected Error every time I open a file that contains a power query and a second file within excel. It happens about 14 times in a row every time the files open and anything is refreshed. It is driving me insane.
I tried to attach a pic, but my account is not verified?
Here are the copied details
Error Message: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. Stack Trace: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. Server stack trace: at Microsoft.Mashup.Client.Excel.NativeExcelFunctions.Microsoft.Mashup.Client.Excel.INativeExcelFunctions.GetNamedObjects(IntPtr workbookPointer) at Microsoft.Mashup.Client.Excel.ExcelHost.<>c__DisplayClass4.<TryGetTableNames>b__3() at Microsoft.Mashup.Host.Document.SynchronizationContextExtensions.<>c__DisplayClass6`1.<SendAndMarshalExceptions>b__5() at Microsoft.Mashup.Host.Document.SynchronizationContextExtensions.<>c__DisplayClass3.<SendAndMarshalExceptions>b__0(Object null) Exception rethrown at [0]: at Microsoft.Mashup.Host.Document.SynchronizationContextExtensions.SendAndMarshalExceptions(SynchronizationContext context, Action callback) at Microsoft.Mashup.Host.Document.SynchronizationContextExtensions.SendAndMarshalExceptions[T](SynchronizationContext context, Func`1 callback) at Microsoft.Mashup.Client.Excel.ExcelHost.TryGetTableNames(PackageReference packageReference, String[]& tableNames) at Microsoft.Mashup.Host.Document.Evaluation.EvaluatorHost.<CreateSession>b__4(PackageReference packageRef) at Microsoft.Mashup.Host.Document.Evaluation.ExcelService.TryGetTableNames(String[]& tableNames) at Microsoft.Mashup.Host.Document.Evaluation.Services.RemoteExcelServiceFactory.Stub.OnTableNamesRequest(IMessageChannel channel, TableNamesRequestMessage request) at Microsoft.Mashup.Evaluator.MessageHandlers.TryDispatch(IMessageChannel channel, Message message) at Microsoft.Mashup.Evaluator.ChannelMessenger.ChannelMessageHandlers.TryDispatch(IMessageChannel channel, Message message) at Microsoft.Mashup.Evaluator.MessageHandlers.Dispatch(IMessageChannel channel, Message message) at Microsoft.Mashup.Evaluator.ChannelMessenger.OnMessageWithUnknownChannel(IMessageChannel baseChannel, MessageWithUnknownChannel messageWithUnknownChannel) at Microsoft.Mashup.Evaluator.MessageHandlers.TryDispatch(IMessageChannel channel, Message message) at Microsoft.Mashup.Evaluator.ChannelMessenger.ChannelMessageHandlers.TryDispatch(IMessageChannel channel, Message message) at Microsoft.Mashup.Evaluator.MessageHandlers.Dispatch(IMessageChannel channel, Message message) at Microsoft.Mashup.Evaluator.Interface.IMessageChannelExtensions.WaitFor[T](IMessageChannel channel) at Microsoft.Mashup.Evaluator.RemotePreviewValueSource.PreviewValueSource.WaitFor(Func`1 condition, Boolean disposing) at Microsoft.Mashup.Evaluator.RemotePreviewValueSource.PreviewValueSource.get_TableSource() at Microsoft.Mashup.Host.Document.Analysis.PackageDocumentAnalysisInfo.PackagePartitionAnalysisInfo.SetPreviewValue(EvaluationResult2`1 result, Func`1 getStaleSince, Func`1 getSampled) at Microsoft.Mashup.Host.Document.Analysis.CachingDocumentAnalysisInfo.CachingPartitionAnalysisInfo.SetPreviewValue(EvaluationResult2`1 result, Func`1 getStaleSince, Func`1 getSampled) at Microsoft.Mashup.DocumentHost.DocumentAnalyzer.Analyze(IPartitionAnalysisInfo partitionInfo, AccessRecorder recorder, EvaluationResult2`1 result, Action`1 callback) at Microsoft.Mashup.DocumentHost.DocumentAnalyzer.<>c__DisplayClass10.<BeginAnalyzeDocumentPartition>b__d(EvaluationResult2`1 result) at Microsoft.Mashup.Evaluator.Interface.EvaluationResultExtensions.InvokeThenOnDispose(Action`1 callback, EvaluationResult2`1 result, Action action) at Microsoft.Mashup.Evaluator.Interface.EvaluationResultExtensions.InvokeThenOnDispose[T](Action`1 callback, EvaluationResult2`1 result, Action action) at Microsoft.Mashup.Evaluator.LimitedDocumentEvaluatorFactory.Evaluation`1.Complete(EvaluationResult2`1 result) at Microsoft.Mashup.Evaluator.Interface.EvaluationResultExtensions.InvokeThenOnDispose(Action`1 callback, EvaluationResult2`1 result, Action action) at Microsoft.Mashup.Evaluator.Interface.EvaluationResultExtensions.InvokeThenOnDispose[T](Action`1 callback, EvaluationResult2`1 result, Action action) at Microsoft.Mashup.Evaluator.LimitedDocumentEvaluatorFactory.Evaluation`1.Complete(EvaluationResult2`1 result) at Microsoft.Mashup.Evaluator.Interface.EvaluationResultExtensions.InvokeThenOnDispose(Action`1 callback, EvaluationResult2`1 result, Action action) at Microsoft.Mashup.Evaluator.Interface.EvaluationResultExtensions.InvokeThenOnDispose[T](Action`1 callback, EvaluationResult2`1 result, Action action) at Microsoft.Mashup.Evaluator.LimitedDocumentEvaluatorFactory.Evaluation`1.Complete(EvaluationResult2`1 result) at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.RemoteEvaluation`1.TryComplete(EvaluationResult2`1 result) at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.PreviewValueSourceRemoteEvaluation.GetResult(Boolean enableFirewall) at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.EvaluationThread(Object state) at Microsoft.Mashup.Evaluator.SafeThread2.<>c__DisplayClass15.<CreateAction>b__14(Object o)
Thursday, May 11, 2017 3:11 PM
Answers
-
Thanks Nate,
Can you please narrow down the problematic scenarios, so we would be able to reproduce it in our internal environment? For example, you open workbook A, then try to do some stuff, then open another workbook, then something happens etc.
If you can also send a problematic workbook and exact scenario it would be great.
Thank you,
Dan.
- Proposed as answer by Ehren - MSFTMicrosoft employee Wednesday, June 28, 2017 6:57 PM
- Marked as answer by Imke FeldmannMVP Monday, July 17, 2017 4:19 AM
Sunday, June 18, 2017 10:26 AM
All replies
-
Bump? Still happening.Monday, May 15, 2017 2:53 PM
-
Hi ngkrich,
Can you provide us with some technical details regarding your Excel version so we can better root cause this
1. build number: can be found under File -> Account.
2. Power Query version: can be found under Data -> Get Data -> Query Options -> Diagnostics -> Version
3. Is it a 64 bit or a 32 bit installation?
4. Are you experiencing this after an update?
5. Is this issue occurring for any file containing power query and any second file? or are there specific characteristics for these files (such as size bigger than usual, many queries/ large data loaded/not to the model)?
Thank you,
Ron.
Sunday, May 21, 2017 9:21 PM -
Hi Ron,
It is a 64 bit installation, this has been happening for several months.
2.30.4246.1721 64-bit
I never load anything to the model, I use it purely to reshape data. It happens with most power query files and any other file open along side it. Especially files with pivot tables.
This issue happens to me on both the most recent version of 2016 Excel and version 16.0.6741.2105, which I recent rolled back to due to the web queries being broken in that current release.
Let me know if you have any more questions.
Best,
Nate
Wednesday, May 24, 2017 2:36 PM -
Thanks Nate,
Can you please narrow down the problematic scenarios, so we would be able to reproduce it in our internal environment? For example, you open workbook A, then try to do some stuff, then open another workbook, then something happens etc.
If you can also send a problematic workbook and exact scenario it would be great.
Thank you,
Dan.
- Proposed as answer by Ehren - MSFTMicrosoft employee Wednesday, June 28, 2017 6:57 PM
- Marked as answer by Imke FeldmannMVP Monday, July 17, 2017 4:19 AM
Sunday, June 18, 2017 10:26 AM -
Same issue here.
Power Query in Excel:
Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Michael
Friday, December 7, 2018 12:43 PM