XLL launching crashes Excel immediately.

361 vistas
Ir al primer mensaje no leído

cris...@gmail.com

no leída,
1 jul 2016, 11:41:11 a.m.1/7/2016
para Excel-DNA
When launching my XLL on my non development machine, excel immediately crashes after double clicking the xll. 
The Add-in uses the Ribbon, and UDF functionality and is running on excel 2013 in both cases. Except my dev machine is x32, and the failing machine uses x64.


Also one important thing is that when running Excel as administrator on the failing machine the add-in works. 

But I'm not able to use that as a long term solution because other machines wont be able to elevate their security. 


I tried creating a super simple add-in to profile against as suggested and that also crashes excel immediately.
The simple test case just creates a function JoinThem("abc", 123)

 <DnaLibrary Language="CS" RuntimeVersion="v4.0">
    <![CDATA[

        using ExcelDna.Integration;
                public class MyFunctions
                {
                        [ExcelFunction(Description="Joins a string to a number", Category="My functions")]
                        public static string JoinThem(string str, double val)
                        {
                                return str + val;
                        }
                }
    ]]>
    </DnaLibrary> 


I have also tried to use process monitor to see the registry edits that occur on both machines to see if there is a difference or any obvious failures. 

the only difference i see is that the failing machine performs less operations before it quits. The machine that works will complete more registry operations. 

I have attached my findings in an image. 


This is the line that the failing machine never reaches, or maybe it does reach and just blows up here. 

EXCEL.EXE Desired Access: Read Data/List Directory, Execute/Traverse, Synchronize, Disposition: Open, Options: Synchronous IO Non-Alert, Non-Directory File, Attributes: n/a, ShareMode: Read, Delete, AllocationSize: n/a, OpenResult: Opened


This is the exception that occurs on the failing machine. 

Unhandled exception at 0x0000000000058C00 in EXCEL.EXE: 0xC0000005: Access violation executing location 0x0000000000058C00.

 If there is a handler for this exception, the program may be safely continued.



When debugging with the Excel.DNA integration source project attached to my diagnostic test solution I never hit any of the break points I set in the Com Interop, Com registration classes. 
I'm just wondering at what point does Excel.DNA integration start accessing the registry and if there's some information you could provide.

Also excel crashes before any of my logging kicks in as well. 



Thank you


Compare Failing Machine vs Dev Machine.png

Govert van Drimmelen

no leída,
1 jul 2016, 3:00:07 p.m.1/7/2016
para Excel-DNA

In the simple test case where you only have a single UDF, and no ribbons etc., Excel-DNA should not be doing any registry access at all.

 

The type of  Access violation exception you show comes from an internal error in Excel (e.g. a corrupt pointer), and not from failing some security check.

 

Depending on your patience you could:

·         Check for any unusual security-related software, e.g. EMET any anti-virus software

·         Reinstall Excel and .NET, or

·         Test a native code add-in build with the Excel SDK, and see whether that loads. This would eliminate .NET and Excel-DNA from the equation.

 

-Govert

cris...@gmail.com

no leída,
1 jul 2016, 5:57:24 p.m.1/7/2016
para Excel-DNA
I'm going to try to create an add-in with the Excel 2013 SDK


Thanks for the suggestions. 

cris...@gmail.com

no leída,
15 jul 2016, 2:13:56 p.m.15/7/2016
para Excel-DNA
I had to wait some time to see if the findings were confirmed before posting. 

After making a custom XLL via the Excel 2013 SDK I noticed the same crashes on start up were occurring. Meaning this isn't related to anything in ExcelDNA.
When debugging the custom XLL I saw that a simple operation such as OutputDebugString would cause an Access violation at a memory location. 
Then after debugging the same XLL in Admin mode worked without any issues. I did a compare as to what is being accessed and noticed that there is a difference between loading as Admin and Non Admin. 
The non admin instance was referring to a specific location on the users AppData, and starting up something called WatchDox. 
Removing WatchDox from starting up with Excel allowed the XLL to run without any issues. 
It seems that this application is interfering with any Excel SDK based addins, and causes immediate crashes. 
The odd thing is that it doesn't show up as an Addin but does startup with Excel, so to fix the issue remove the application or remove it from the registry so it never starts up with Excel. 

 Look in these locations for the entry for WatchDox. 

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run"= WatchDox.exe
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run""= WatchDox.exe

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Associations  WatchDox.exe



Hopefully this helps someone else. 

Govert van Drimmelen

no leída,
15 jul 2016, 2:33:53 p.m.15/7/2016
para exce...@googlegroups.com
Thank you for posting the feedback!

I'm glad you found the source of the problem.

-Govert


From: exce...@googlegroups.com [exce...@googlegroups.com] on behalf of cris...@gmail.com [cris...@gmail.com]
Sent: 15 July 2016 08:13 PM
To: Excel-DNA
Subject: [ExcelDna] Re: XLL launching crashes Excel immediately.

--
You received this message because you are subscribed to the Google Groups "Excel-DNA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to exceldna+u...@googlegroups.com.
To post to this group, send email to exce...@googlegroups.com.
Visit this group at https://groups.google.com/group/exceldna.
For more options, visit https://groups.google.com/d/optout.
Responder a todos
Responder al autor
Reenviar
0 mensajes nuevos