Getting PInvokeStackImbalance when using webdriver 2.5.1 - selenium

Im getting a PInvokeStackImbalance error when running debug in VS2010 using selenium webdriver 2.5.1 dlls.
If i do exactly the same but switch the dlls to the old 2.4 version there's no problems
Am i missing something??
Error message:
PInvokeStackImbalance was detected
Message: A call to PInvoke function 'WebDriver!OpenQA.Selenium.IE.InternetExplorerDriverServer+StartServerFunction::Invoke' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature.
Calling code:
_driver = new InternetExplorerDriver();
Thx for the help.

This is a known issue. It's already been fixed in the trunk of the project. If you are able to build from source, you can pick up the fix now. If you are unable to do so, the fix should be available in the next binary release.

Related

AutoMapper 10.0 failing with message "Instance property 'Current' is not defined for type 'System.Collections.IDictionaryEnumerator'"

I'm using AutoMapper in a project, and it was using version 9.0.0 along with version 7.0.0 of AutoMapper.Extensions.Microsoft.DependencyInjection, and everything was working.
I have a call to GetService on my IServiceProvider to resolve a service, and after upgrading to version 10.0.0 (and version 8.0.1 of the DI project), the call is failing with the following message:
'Instance property 'Current' is not defined for type 'System.Collections.IDictionaryEnumerator'
I tried to look into the code to see if I can find out why it's happening, but I wasn't successful.
Although I did find that this line in the source code is failing for me
Any help is greatly appreciated.
Thank you

Reflexil deobfustication error

I'm trying to modify a .net application and I'm new to this. First step is attempting to deobfuscate the code using reflexil and I get the following error:
Reflexil is unable to clean this assembly: Member 'System.RuntimeTypeHandle "bunch of obfustatcated jibberish"(System.Int32)' is declared in another module and needs to be imported
The application comes with a bunch of dll's that it certainly uses, so I assume the declaration is in one of those files. How do I import this module?
In case it's helpful, reflexil says it was obfuscated with .NET Reactor 4.1
I decided to try de4not to deobfuscate and it worked without this issue.

JNI UnsatisfiedLinkError- how do I load libraries correctly?

I'm trying to work with the Java sample Database program from the CardScan SDK.
I am working with files located in Java/JNI and Java/Database. The program must be run with a 32 bit JRE. I was able to do so on a 64 bit machine by uninstalling Java and installing the 32 bit version, then re-adding the system path for Java. I can run the program and interface with a CardScan database file (.cdb) successfully by double clicking the SDKData.bat file, but when I open the source files for editing and edit the Java.library.path to include the required library (CRTK_JNI.dll), I get UnsatisfiedLinkErrors everywhere:
Exception in thread "main" java.lang.UnsatisfiedLinkError: sdkdata.CRTK.CRTK_Init([I)I
at sdkdata.CRTK.CRTK_Init(Native Method)
at sdkdata.CRTK.(CRTK.java:239)
at sdkdata.SDKData.(SDKData.java:97)
at sdkdata.SDKData.main(SDKData.java:643)
Java Result: 1
Presumably this is happening because the library is not loading properly.
What do I need to do to run and edit the program at full capacity (with all the native functions from CRTK_JNI in working order)?
Presumably this is happening because the library is not loading properly.
On the contrary. The library load is complete. You aren't getting that from a System.load()/loadLibrary() call, you are getting the error when calling your native method, the one that should have the signature:
package sdkdata;
public class CRTK
{
public native int CRTK_Init(int[]);
}
So it isn't there, or you have changed the signature without regenerating the .h and .c files, or you have manually mangled the declaration some other way.
Post your code.
To clarify, this Java sample program is officially unsupported by the CardScan API - it was a bad idea to try to use the API with an unsupported language relying solely on an experimental implementation. I ended up using one of the supported languages (Visual Basic) to work with the SDK; if anyone looking at this question happens to be struggling with using the CardScan API, here is my VB implementation on Github.

What does this error mean in the Botan crypto library?

I'm using the c++ crypto library called Botan, and at arbitrary times I am getting the following error at runtime. What does it mean?
terminate called after throwing an instance of 'Botan::PRNG_Unseeded'
what(): Botan: PRNG not seeded: X9.31(AES-256)
I ran into the same error message, which was caused by missing any entropy source.
You can try to enable a entropy source when building Botan library or generating single source file.
For windows platform, add win32_stats module into option --enable-modules. For linux, use dev_random.
e.g. configure.py --enable-modules=win32_stats,...
Well it looks to me like you forgot to seed the PRNG (pseudo random number generator). Having failed to do so, the Botan library threw the aforementioned exception which seems to have caused the terminate function to be called.
The most likely answer is that you are using v 1.8.2 which had problems with its autoseeding routines. Upgrading to 1.8.4 or 1.8.5 has fixed this for everyone who had reported this problem up to now.

When a DLL is not found while P/Invoking, how can I get a message about the specific unmanaged DLL that is missing?

When you link to an unmanaged library (say 'A.dll') which in turn links to another library ('B.dll'), and B.dll is missing, you will get a run-time error message about failing to load 'B.dll'.
But when you P/Invoke into 'A.dll' from managed code, you'll get a general exception of this form:
Unhandled Exception: System.DllNotFoundException: Unable to load DLL 'A.dll': The specified module could not be found.
How can I get an error message that pinpoints the specific unmanaged dll file that failed to load, when p/invoking from managed code ?
I don't think there's any specific API you can use to pinpoint why LoadLibrary (the underlying Win32 API) failed for 'A.dll'. I recommend the use of a tool like Dependency Walker to troubleshoot DLL loading errors.
I'm not sure how you can get this in the form of an exception. When I run into this problem I usually try and open the DLL with depends.exe. It's pretty good and reporting missing dependencies that exist if the DLL is simply loaded from it's current location.
You won't be able to get an answer from the exception, but you can do it (with a lot of work) through Process Monitor. This article discusses how and also includes a tool to scan Process Monitor logs to find the specific problem.
http://tech.blinemedical.com/debug-could-not-load-file-or-assembly-or-one-of-its-dependencies/
The Fusion Log Viewer is a good tool to debug assembly loading problems in .NET apps.
For identifying general file-load problems, you can use Process Monitor.