WindowsError: exception: access violation

Benjamin Kaplan benjamin.kaplan at case.edu
Thu Jul 21 22:17:49 EDT 2011


On Thu, Jul 21, 2011 at 6:42 PM, Sathish S <sathish at solitontech.com> wrote:
> Hi Ppl,
>
>  I have been trying to call a C DLL built in GCC with cygwin and Eclipse IDE
> from python. Since this DLL was built using cygwin it had the following two
> DLL's as dependency. cygwin1.dll and cyggcc_s-1.dll
>
> I'm calling the cygwin_dll_init method in the cygwin1.dll before accessing
> my DLL. When I call one of the methods within my DLL I get the WindowsError:
> exception: access violation... error
>
> the functions prototype is like: int function(char *, char *) I'm calling
> the function as: DLL = cdll.LoadLibrary (DLL_NAME) print
> DLL.function(c_char_p("string1"),c_char_p("string2)")
>
> This error is not consistent with all the stations. I occurs consistently in
> many XP machines, while in Windows 7, this occurs once in a while. In Win 7
> in starts up a Pythonw.exe process when calling function successfully. I'm
> not sure why this error occurs. Any help ??
>

An access violation is what is usually referred to as a seg fault. It
means something isn't getting initialized properly. Are you using a
Cygwin build of Python? Trying to mix Cygwin with normal Windows
programs doesn't usually work very well.



More information about the Python-list mailing list