LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Running Python in 64 Bit CVI Build

Im trying to run a 64 bit project and use the python 64 bit lib. No matter what I do I cannot get it to not crash. I switch to a 32 bit build and 32 bit python and its fine. Any tips would be helpful.

Im thinking it has to do with unicode or size_t, but not sure how to NI labwindows works with these on 64 bit builds.

 

Using Labwindows 2012, Python 2.5.

Tweaked the pyconfig.h to make it compile, but crash with simple test code, get a segmentation fault with the call to Py_DECREF:

int main()
{
PyObject *pname;
Py_Initialize();
pname = PyString_FromString("test");
Py_DECREF(pname); <---- CRASH HERE
return 0;
}

 

Error is: The program has caused a "General Protection' fault at 0x0000000068894FDA.

 

WinDbg Log shows:

Executable search path is:
ModLoad: 00000000`00400000 00000000`0047e000 image00000000`00400000
ModLoad: 00000000`77130000 00000000`772d9000 ntdll.dll
ModLoad: 00000000`77010000 00000000`7712f000 C:\Windows\system32\kernel32.dll
ModLoad: 000007fe`fd380000 000007fe`fd3eb000 C:\Windows\system32\KERNELBASE.dll
ModLoad: 00000000`76f10000 00000000`7700a000 C:\Windows\system32\USER32.dll
ModLoad: 000007fe`fec60000 000007fe`fecc7000 C:\Windows\system32\GDI32.dll
ModLoad: 000007fe`fe4c0000 000007fe`fe4ce000 C:\Windows\system32\LPK.dll
ModLoad: 000007fe`fea90000 000007fe`feb59000 C:\Windows\system32\USP10.dll
ModLoad: 000007fe`fecd0000 000007fe`fed6f000 C:\Windows\system32\msvcrt.dll
ModLoad: 00000000`68420000 00000000`68b34000 C:\Windows\system32\cvirte.dll
ModLoad: 000007fe`f6610000 000007fe`f664b000 C:\Windows\system32\WINMM.dll
ModLoad: 000007fe`fd070000 000007fe`fd088000 C:\Windows\system32\MPR.dll
ModLoad: 000007fe`f5dc0000 000007fe`f5dc7000 C:\Windows\system32\MSIMG32.dll
ModLoad: 000007fe`fed70000 000007fe`fedbd000 C:\Windows\system32\WS2_32.dll
ModLoad: 000007fe`fe880000 000007fe`fe9ad000 C:\Windows\system32\RPCRT4.dll
ModLoad: 000007fe`ff430000 000007fe`ff438000 C:\Windows\system32\NSI.dll
ModLoad: 000007fe`f9160000 000007fe`f91d1000 C:\Windows\system32\WINSPOOL.DRV
ModLoad: 000007fe`fe9b0000 000007fe`fea8b000 C:\Windows\system32\ADVAPI32.dll
ModLoad: 000007fe`ff370000 000007fe`ff38f000 C:\Windows\SYSTEM32\sechost.dll
ModLoad: 000007fe`fd4d0000 000007fe`fe258000 C:\Windows\system32\SHELL32.dll
ModLoad: 000007fe`fd450000 000007fe`fd4c1000 C:\Windows\system32\SHLWAPI.dll
ModLoad: 000007fe`fedc0000 000007fe`fefc3000 C:\Windows\system32\ole32.dll
ModLoad: 000007fe`ff290000 000007fe`ff367000 C:\Windows\system32\OLEAUT32.dll
ModLoad: 00000000`1e000000 00000000`1e2b2000 C:\Windows\system32\python25.dll
ModLoad: 000007fe`fe6b0000 000007fe`fe6de000 C:\Windows\system32\IMM32.DLL
ModLoad: 000007fe`ff180000 000007fe`ff289000 C:\Windows\system32\MSCTF.dll
ModLoad: 000007fe`edb70000 000007fe`edc10000 C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_5.82.7601.17514_none_a4d6a923711520a9\Comctl32.dll
ModLoad: 000007fe`fb720000 000007fe`fb776000 C:\Windows\system32\uxtheme.dll
ModLoad: 000007fe`fb2f0000 000007fe`fb308000 C:\Windows\system32\dwmapi.dll
ModLoad: 000007fe`fcc50000 000007fe`fcc5f000 C:\Windows\system32\CRYPTBASE.dll
(6f4.17f0): Access violation - code c0000005 (first chance)
First chance exceptions are reported before any exception handling.
This exception may be expected and handled.
*** ERROR: Symbol file could not be found. Defaulted to export symbols for C:\Windows\system32\cvirte.dll -
cvirte!PtrPreCall+0xa:
00000000`68894fda 663902 cmp word ptr [rdx],ax ds:00000000`00000001=????

0 Kudos
Message 1 of 1
(1,373 Views)