python调用dll报 violation readint 0x00000000 10C

dll 接口 business_handle(char *,char *) 接收2个指针入参
代码如下:
def business_handle(self,inputData,outputData):

inputData=ctypes.create_string_buffer(inputData)

business_handle = self._libc.BUSINESS_HANDLE
business_handle.argtypes=[ctypes.POINTER(ctypes.c_char),ctypes.POINTER(ctypes.c_char)]
business_handle.restype=ctypes.c_int
business_handle(inputData,outputData)

1个回答

下断点调试下,你传过去的指针是0,无效的指针。

zfq_java
zfq_java 回复caozhy: 你好,我用py2exe打包后,这个错误!cmd运行没有问题,用pyinstaller打包后也是这个错误!
大约 2 年之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
python 报reading location 0x00000000

由于对python不太熟悉,需用python调用dll; 现有dll接口函数:business_handle(char in, char * out) 下面代码cmd正常运行,打包后报:Access violation reading location 0x00000000 outputData=ctypes.create_string_buffer('/0'*100) business_handle = self._libc.BUSINESS_HANDLE business_handle.argtypes=[ctypes.c_char_p,ctypes.c_char_p] business_handle.restype=ctypes.c_int business_handle(inputData,outputData) 有哪位大神帮忙写个能正常调用的例子!

Python 调用C++ dll库文件函数提示WindowsError: exception: access violation writing 0x00905A4D

.H文件如下: /* 视频解码 */ #ifndef __BLL_AUTELVIDEODECODE_H #define __BLL_AUTELVIDEODECODE_H #ifdef AUTELVIDEODECODE_EXPORTS #define AUTELVIDEODECODE_API __declspec(dllexport) #else #define AUTELVIDEODECODE_API __declspec(dllimport) #endif #include "bll/UDPClient/UDPAsyncClient.h" #include "bll/DataManager/DataManager.h" #include "bll/Utils/CommonFuntion.h" #include "bll/frame.h" #include "bll/video_data_mgn.h" #include "bll/h264.h" extern "C" { //编码 #include "libavcodec/avcodec.h" //封装格式处理 #include "libavformat/avformat.h" //像素处理 #include "libswscale/swscale.h" #include "libavutil/avutil.h" #include "libavutil/imgutils.h" }; #pragma comment(lib,"avutil.lib") #pragma comment(lib,"avformat.lib") #pragma comment(lib,"avcodec.lib") #pragma comment(lib,"swscale.lib") #define VIDEO_UDP_PORT (1234) #define min(a, b) ((a) < (b) ? (a) : (b)) #define MAX_RECVBUF_SIZE (64 * 1024) #define MAX_FRAME_SIZE (1024 * 1024) #pragma pack(push, 1) struct Decoder { AVCodec *codec; AVFrame *frame; AVCodecContext *dec_ctx; }; typedef struct { uint8_t *data; int size; int64_t pts; int keyframe; int decode_only; } VideoPacket; typedef struct { int width; int height; int64_t pts; int keyframe; int decode_only; int opaque; uint8_t *data; int size; } YuvFrame; #pragma pack(pop) typedef void (WINAPIV *yuvFrame_func)(YuvFrame *yuv); class AUTELVIDEODECODE_API CAutelVideoDecode { public: explicit CAutelVideoDecode(std::string strHost="", int nPort=VIDEO_UDP_PORT); ~CAutelVideoDecode(void); inline void SetYuvframeCallback(yuvFrame_func pfn) { m_pfnyuvFrame = pfn; } //functions private: //通过udp实时获取视频数据包线程 void StartRecvPacketThread(); void StopRecvPacketThread(); static int WINAPIV recv_video_data_func(char* buf, int length, void* ctx, void* pObj); void DoRecvPacket(); static DWORD ThRecvPacket(LPVOID lpParam); //从buf里面读取视频帧数据进行渲染线程 void StartRenderThread(); void StopRenderThread(); void DoRenderFrame(); static DWORD ThRenderFrame(LPVOID lpParam); Decoder *Decoder_Create(void); int Decoder_Destroy(); int Decoder_Decode(VideoPacket *inpkt, YuvFrame *frame); int get_video_frame(AVFrame *frame, YuvFrame *yuv); void PushFrame(YuvFrame frame); YuvFrame FrontFrame(); //params private: //通过udp实时获取视频数据包线程 HANDLE m_hRecvVideoPacket; bool m_bStopRecvVideoPacket; //从buf里面读取视频帧数据进行渲染线程 HANDLE m_hRenderFrame; bool m_bStopRender; CUDPAsyncClient *m_pUdpClient; std::string m_strHostAddr; int m_udpPort; Decoder *m_pDecoder; yuvFrame_func m_pfnyuvFrame; typedef std::queue<YuvFrame> QUEUE_YUVFRAME; QUEUE_YUVFRAME m_que_yuvframe; CRITICAL_SECTION m_cri_yuvFramequeLocker; }; #endif CPP文件 // dllmain.cpp : Defines the entry point for the DLL application. #include "stdafx.h" #include "AutelVideoDecode.h" BOOL APIENTRY DllMain( HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved ) { switch (ul_reason_for_call) { case DLL_PROCESS_ATTACH: case DLL_THREAD_ATTACH: case DLL_THREAD_DETACH: case DLL_PROCESS_DETACH: break; } return TRUE; } extern "C" { AUTELVIDEODECODE_API CAutelVideoDecode* AutelVideoDecode() { return new CAutelVideoDecode(); } AUTELVIDEODECODE_API void SetYuvframeCallback(CAutelVideoDecode* pAutel, yuvFrame_func pfn) { pAutel->SetYuvframeCallback(pfn); } } #####编译成AutelVideoDecode.dll库后供python2.7程序调用。 ####Python程序如下 import sys,pygame import YUVFrame import thread from ctypes import * ObjAutelvideodecodeDLL = windll.LoadLibrary(".\\bin\\autelvideodecode.dll") class AutoTestAutelRealTimeVideo: def __init__(self): pygame.init() self.size = width, height = 1280, 720 self.black = 0, 0, 0 self.YUVFrame = None self.overlay =None self.IYUV = pygame.IYUV_OVERLAY self.lock = thread.allocate_lock() CALLFUCTION = CFUNCTYPE(None, POINTER(YUVFrame.YUVFrame)) self.PrenderYuvframe = CALLFUCTION(self.renderYuvframe) #ObjAutelvideodecodeDLL.AutelVideoDecode.argtype=c_char_p ObjAutelvideodecodeDLL.AutelVideoDecode.restype = c_void_p ObjAutelvideodecodeDLL.SetYuvframeCallback.argtypes = (c_void_p,c_void_p) #ObjAutelvideodecodeDLL.SetYuvframeCallback.restype = None self.AutelObj = ObjAutelvideodecodeDLL.AutelVideoDecode() def ...... 编译后出错: Connected to pydev debugger (build 129.782) Traceback (most recent call last): File "C:\Program Files (x86)\JetBrains\PyCharm 2.7.3\helpers\pydev\pydevd.py", line 1481, in <module> debugger.run(setup['file'], None, None) File "C:\Program Files (x86)\JetBrains\PyCharm 2.7.3\helpers\pydev\pydevd.py", line 1124, in run pydev_imports.execfile(file, globals, locals) #execute the script File "E:/AutoTestAutelRealTimeVideo/AutoTestAutelRealTimeVideo.py", line 84, in <module> test() File "E:/AutoTestAutelRealTimeVideo/AutoTestAutelRealTimeVideo.py", line 66, in test test = AutoTestAutelRealTimeVideo() File "E:/AutoTestAutelRealTimeVideo/AutoTestAutelRealTimeVideo.py", line 25, in __init__ self.AutelObj = ObjAutelvideodecodeDLL.AutelVideoDecode() WindowsError: exception: access violation writing 0x00905A4D

python 调用C++ dll (该dll 依赖其他dll)

问题描述: C++中有两个类 bclass 和 nclass,其中nclass 里面的一个private变量就是bclass。 这两个类目前都被写成了动态库 libbclass.so 和 libnclass.so。 当我在Python中利用ctypes模块希望调用libnclass.so的时候,程序报错 OSError: libbclass.so: cannot open shared object file: No such file or directory 我的问题: 1、如何调用libnclass.so 2、如何在python中创建一个nclass类的实例,并调用该实例的方法add

python调用DLL,c++,用vs编译的

我的程序是让一个csv文件生成多个csv文件!所以输入的参数有输入文件名,输出文件名,日期分割点等。c语言程序没有问题的,运行过了!dll也是正常生成的。但是用python运行后没有任何反应,没错误提示也没有生成需要的csv文件!!希望大神帮忙看看吧!!!分别是csv.c csv.h python的代码![图片说明](https://img-ask.csdn.net/upload/201706/12/1497254637_942334.png)![图片说明](https://img-ask.csdn.net/upload/201706/12/1497254643_96080.png)![图片说明](https://img-ask.csdn.net/upload/201706/12/1497254966_579917.png)

python如何调试C++编译的dll

如题,由c++编译dll提供接口给python调用。出现错误想知道执行到了哪一步。请问各位有没有好的调试方法。通过return返回值的方法已经被使用了,其实最好的解决方案是能够在python的控制台下有输出,请问这两个之间有没有什么方法,或者其他的解决方案。

用JNative方法调用dll

运行环境是JDK1.4 报异常信息: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x4769AA6 Function=[Unknown.] Library=C:\Windows\System32\BoostYccb.dll NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at org.xvolks.jnative.JNative.nInvoke(Native Method) at org.xvolks.jnative.JNative.invoke(JNative.java:807) at onlyfun.dllcall.UserCall.main(UserCall.java:101) Dynamic libraries: 0x00400000 - 0x00407000 D:\JDK1.4\bin\javaw.exe 0x77A50000 - 0x77BD0000 C:\Windows\SysWOW64\ntdll.dll 0x75700000 - 0x75810000 C:\Windows\syswow64\kernel32.dll 0x76E40000 - 0x76E87000 C:\Windows\syswow64\KERNELBASE.dll 0x75220000 - 0x752C0000 C:\Windows\syswow64\ADVAPI32.dll 0x752C0000 - 0x7536C000 C:\Windows\syswow64\msvcrt.dll 0x770B0000 - 0x770C9000 C:\Windows\SysWOW64\sechost.dll 0x76CB0000 - 0x76DA0000 C:\Windows\syswow64\RPCRT4.dll 0x75110000 - 0x75170000 C:\Windows\syswow64\SspiCli.dll 0x75100000 - 0x7510C000 C:\Windows\syswow64\CRYPTBASE.dll 0x76E90000 - 0x76F90000 C:\Windows\syswow64\USER32.dll 0x76C10000 - 0x76CA0000 C:\Windows\syswow64\GDI32.dll 0x75EC0000 - 0x75ECA000 C:\Windows\syswow64\LPK.dll 0x770D0000 - 0x7716D000 C:\Windows\syswow64\USP10.dll 0x76DA0000 - 0x76E00000 C:\Windows\system32\IMM32.DLL 0x75CF0000 - 0x75DBC000 C:\Windows\syswow64\MSCTF.dll 0x08000000 - 0x08136000 D:\JDK1.4\jre\bin\client\jvm.dll 0x74E00000 - 0x74E32000 C:\Windows\system32\WINMM.dll 0x724F0000 - 0x7253C000 C:\Windows\system32\apphelp.dll 0x10000000 - 0x10007000 D:\JDK1.4\jre\bin\hpi.dll 0x00340000 - 0x0034E000 D:\JDK1.4\jre\bin\verify.dll 0x00350000 - 0x00368000 D:\JDK1.4\jre\bin\java.dll 0x00370000 - 0x0037D000 D:\JDK1.4\jre\bin\zip.dll 0x04730000 - 0x047D3000 C:\Windows\System32\BoostYccb.dll 0x75370000 - 0x753FF000 C:\Windows\syswow64\oleaut32.dll 0x75400000 - 0x7555C000 C:\Windows\syswow64\ole32.dll 0x047E0000 - 0x047EB000 C:\Windows\system32\borlndmm.dll 0x75000000 - 0x75007000 C:\Windows\system32\wsock32.dll 0x76E00000 - 0x76E35000 C:\Windows\syswow64\WS2_32.dll 0x77A20000 - 0x77A26000 C:\Windows\syswow64\NSI.dll 0x74F20000 - 0x74FA4000 C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.7601.18201_none_ec80f00e8593ece5\comctl32.dll 0x04BB0000 - 0x04C7D000 C:\Windows\System32\JNativeCpp.dll 0x6E700000 - 0x6E780000 C:\Windows\system32\uxtheme.dll 0x75AA0000 - 0x75ACB000 C:\Windows\syswow64\imagehlp.dll 0x743E0000 - 0x744CB000 C:\Windows\syswow64\dbghelp.dll 0x76CA0000 - 0x76CA5000 C:\Windows\syswow64\PSAPI.DLL Heap at VM Abort: Heap def new generation total 576K, used 183K [0x10010000, 0x100b0000, 0x104f0000) eden space 512K, 23% used [0x10010000, 0x1002dc60, 0x10090000) from space 64K, 99% used [0x100a0000, 0x100afff8, 0x100b0000) to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) tenured generation total 1408K, used 45K [0x104f0000, 0x10650000, 0x14010000) the space 1408K, 3% used [0x104f0000, 0x104fb518, 0x104fb600, 0x10650000) compacting perm gen total 4096K, used 1532K [0x14010000, 0x14410000, 0x18010000) the space 4096K, 37% used [0x14010000, 0x1418f150, 0x1418f200, 0x14410000) Local Time = Fri Nov 14 16:11:22 2014 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2-b28 mixed mode) # # An error report file has been saved as hs_err_pid13592.log. # Please refer to the file for further information. # 求大师指导。

用JAVA通过JNA的方式调用DLL出错

我自定义通过vs生成了dll文件,但根据网上的做法,用java调用该dll时出错。而我用同样的方式,调用一个也是自定义的、功能单一的dll文件时,就可以成功。具体方式如下: 根据网上的主流方式: 1.导入jna.jar包 2.使用Native.loadLibrary("dll文件名", xxx.class);方式读取dll文件,并且也没有写入dll后缀 3.通过Depends.exe分析自定义的dll所依赖的库,也一一找到了 4.将自定义的dll和其所依赖的dll文件,都放在了Java项目的根目录下了(即跟src同级目录) 5.生成dll的平台为32位,Java调用dll的平台也为32位。 运行程序后报如下错误: A fatal error has been detected by the Java Runtime Environment: EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6b602b86,pid=5912,tid=5980 JRE version:7.0_25-b17 Java VM:Java HotSpot(TM) Client VM (23.25-b01 mixed mode,sharing windows-x86) Problematic frame: C [pthreadVC2.dll+0x2b86] pthread_mutex_unlock+0x16 Failed to write core dump.Minidumps are not enabled by default on client versions of Windows 跪求大神指点!是不是我的cpp那里的代码写错了?但底层的代码已经测过,是通的。。。

调用DLL中函数时出现异常,求大神指教!

本人用vs2010根据网上教程编写了一个调用DLL的小程序,但是出现了0x00a163b8 处有未经处理的异常: 0xC0000005: Access violation的异常。调试模式的位置是 mainret = main(argc, argv, envp);请各位指出问题所在。代码如下: #include <iostream> #include <Windows.h> using namespace std; int main(){ typedef int (*OpenComPort)(int,unsigned char *,unsigned char,int *); typedef int (*GetReaderInformation)(unsigned char *, unsigned char *, unsigned char *, unsigned char *,unsigned char *, unsigned char *, unsigned char *,unsigned char *, int); typedef int (*SetWorkMode)(unsigned char *, unsigned char * , int ); typedef int (*SetRelay)(unsigned char *,unsigned char *, unsigned char *,int ); typedef int (*Inventory_G2)(unsigned char *, unsigned char , unsigned char , unsigned char , unsigned char ,unsigned char ,unsigned char *, int * , int *,int); typedef int (*CloseComPort)(void); typedef int (*CloseSpecComPort)(int); int Port = 3; unsigned char ComAdr = 0xFF; unsigned char Baud = 5;//对应的波特率见说明文件 int handle = 0; unsigned char VersionInfo[2] = {0,0}; unsigned char ReaderType = 0; unsigned char TrType = 0; unsigned char dmaxfre = 0; unsigned char dminfre = 0; unsigned char powerdBm = 0; unsigned char ScanTime = 0; unsigned char Parameter[6] = {0x01,0x0a,0x04,0x00,0x10,0x00}; unsigned char Qvalue = 0; unsigned char Session = 0; unsigned char AdrTID = 0x00; unsigned char LenTID = 0x03; unsigned char TIDFlag = 1; unsigned char EPClenandEPC[1000]; int Totallen = 0,CardNum = 0; HMODULE hDLL = LoadLibrary("UHFReader188.dll"); //加载dll文件 if(hDLL != NULL){ OpenComPort fp1 = OpenComPort(GetProcAddress(hDLL,"OpenComPort")); //得到dll中的第一个函数 GetReaderInformation fp2 = GetReaderInformation(GetProcAddress(hDLL,"GetReaderInformation")); SetWorkMode fp3 = SetWorkMode(GetProcAddress(hDLL,"SetWorkMode")); SetRelay fp4 = SetRelay(GetProcAddress(hDLL,"SetRelay")); Inventory_G2 fp5 = Inventory_G2(GetProcAddress(hDLL,"Inventory_G2")); CloseComPort fp6 = CloseComPort(GetProcAddress(hDLL,"CloseComPort")); if(fp1 != NULL){ cout << "it can run the dll." << endl; int a = fp1(Port,&ComAdr,Baud,&handle); cout << a << " " << handle << endl; cout << int(ComAdr) << endl; } else{ cout<<"Cannot Find Function "<<"OpenComPort"<<endl; } //ComAdr = 0xFF; if (fp2 != NULL){ cout << "it can run the function2 of dll." <<endl; cout << fp2(&ComAdr,VersionInfo,&ReaderType,&TrType,&dmaxfre,&dminfre,&powerdBm,&ScanTime,handle) << endl; //代码执行到此处,出现异常。 cout << handle << endl; cout << int(ComAdr) <<endl; } else{ cout<<"Cannot Find Function2 "<<"GetReaderInformation"<<endl; } if (fp3 != NULL){ cout << "it can run the function3 of dll." <<endl; cout << fp3(&ComAdr,Parameter,handle) <<endl; } else{ cout << "Cannot Find Function3 " << "SetWorkMode" << endl; } if (fp4 != NULL){ cout << "it can run the function4 of dll." << endl; cout << fp4(&ComAdr,&Qvalue,&Session,handle) << endl; } else{ cout<<"Cannot Find Function4 "<<"SetRelay"<<endl; } if (fp5 != NULL){ cout << "it can run the function5 of dll." <<endl; cout << fp5(&ComAdr,Qvalue,Session,AdrTID,LenTID,TIDFlag,EPClenandEPC,&Totallen,&CardNum,handle) << endl; cout << "all is ok!!" <<endl; } else{ cout<<"Cannot Find Function5"<<"Inventory_G2"<<endl; } if (fp6 != NULL){ cout << "it can run the function6 of dll." <<endl; cout << fp6() <<endl; } else{ cout<<"Cannot Find Function6"<<"CloseComPort"<<endl; } } else{ std::cout<<"Cannot Find "<<"dll"<<std::endl; } FreeLibrary(hDLL); return 1; }

delphi 简单dll调用出错

library wjfz; { Important note about DLL memory management: ShareMem must be the first unit in your library's USES clause AND your project's (select Project-View Source) USES clause if your DLL exports any procedures or functions that pass strings as parameters or function results. This applies to all strings passed to and from your DLL--even those that are nested in records and classes. ShareMem is the interface unit to the BORLNDMM.DLL shared memory manager, which must be deployed along with your DLL. To avoid using BORLNDMM.DLL, pass string information using PChar or ShortString parameters. } uses shellapi, ShareMem, System.SysUtils, System.Classes; {$R *.res} function DelDirectory(X,Y:integer): integer; stdcall; begin Result :=X+Y; end; exports DelDirectory; // DelDirectory12; begin end. 这是简单的dll,求和 unit Unit2; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs , shellapi, Vcl.StdCtrls; type TForm2 = class(TForm) Button1: TButton; Label1: TLabel; Label2: TLabel; Edit1: TEdit; Edit2: TEdit; Edit3: TEdit; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form2: TForm2; implementation {$R *.dfm} function DelDirectory(X,Y:integer): integer; stdcall; external 'wjfz.dll' ; procedure TForm2.Button1Click(Sender: TObject); begin edit3.Text:=inttostr(DelDirectory(1,2)); end; end. 用一个按钮实现1+2的和 他就报错! access violation at address......

Eclipse 运行时问题:EXCEPTION_ACCESS_VIOLATION (0xc0000005)

# # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x05f0831c, pid=2064, tid=6100 # # JRE version: 6.0_20-b02 # Java VM: Java HotSpot(TM) Client VM (16.3-b01 mixed mode, sharing windows-x86 ) # Problematic frame: # C [libapr-1.dll+0x831c] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x044a7400): JavaThread "Worker-2" [_thread_in_native, id=6100, stack(0x07d30000,0x07e30000)] siginfo: ExceptionCode=0xc0000005, reading address 0x00000000 Registers: EAX=0x011cf070, EBX=0x00000000, ECX=0x00000000, EDX=0x00000000 ESP=0x07e2759c, EBP=0x07e275a8, ESI=0x0052ff80, EDI=0x00000000 EIP=0x05f0831c, EFLAGS=0x00010246 Top of Stack: (sp=0x07e2759c) 0x07e2759c: 00000000 0052ff80 011cf070 07e295d4 0x07e275ac: 04a01f32 07e295d0 011cf070 00000000 。。。。。。。。。。。。。。 下面是一堆数字和英文的组合,就没必要了。 谢谢游览的,出主意的

0xC0000005: 读取位置 0x00000000 时发生访问冲突。

部分源代码如下: using namespace std; fitsfile *fptr; fitsfile *fptr1; int status; int existkeys, morekeys, keynum; int bitpix; long ii,jj; int datatype=0; long *fpixel=NULL; void *nulval=NULL; unsigned char *nwarray=NULL; int *anynul=NULL; LONGLONG nelem; LONGLONG naxis1=0; LONGLONG naxis2=0; char comment[FLEN_COMMENT]; ffopen(&fptr, "R2512137P.fit", 1, &status); ffgkyjj(fptr, "NAXIS1", &naxis1, comment, &status); ffgkyjj(fptr, "NAXIS2", &naxis2, comment, &status); nelem=(LONGLONG)naxis1*(LONGLONG)naxis2; ffgpxv(fptr, datatype, fpixel, nelem, nulval, nwarray, anynul, &status); for (ii = 0; ii < naxis2; ii++) for (jj = 0; jj < naxis1; jj++) { hdc->SetPixel(ii,jj,RGB(nwarray[(ii-1)*(long)naxis1+jj],nwarray[(ii-1)*(long)naxis1+jj],nwarray[(ii-1)*(long)naxis1+jj])); } 出现如题问题,不知道是何原因,求大神指教!

0x0001af3a 处有未经处理的异常: 0xC0000005: Access violation

opengl程序在自己的电脑vs2010上面运行出错,在别人电脑没问题,重新配置了n次glew都不行,每次都弹出:0x0001af3a 处有未经处理的异常: 0xC0000005: Access violation,并且自动打开gs_support.c跳到 cookie = systime.ft_struct.dwLowDateTime;!![CSDN移动问答][1] [1]: http://zhidao.baidu.com/question/936332428647718532.html?quesup2&oldq=1

eclipse 经常自动关闭怎么回事?求大神帮忙看看!错误日志如下,万分感谢哦

# A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0000000062140af0, pid=4372, tid=4240 # # JRE version: Java(TM) SE Runtime Environment (7.0_79-b15) (build 1.7.0_79-b15) # Java VM: Java HotSpot(TM) 64-Bit Server VM (24.79-b02 mixed mode windows-amd64 compressed oops) # Problematic frame: # V [jvm.dll+0x40af0] # # Failed to write core dump. Minidumps are not enabled by default on client versions of Windows # # If you would like to submit a bug report, please visit: # http://bugreport.java.com/bugreport/crash.jsp GC Heap History (10 events): Event: 1004.781 GC heap after Heap after GC invocations=52 (full 18): PSYoungGen total 93184K, used 9133K [0x00000000f5500000, 0x00000000fd200000, 0x0000000100000000) eden space 59904K, 0% used [0x00000000f5500000,0x00000000f5500000,0x00000000f8f80000) from space 33280K, 27% used [0x00000000fae80000,0x00000000fb76b6b0,0x00000000fcf00000) to space 31744K, 0% used [0x00000000f8f80000,0x00000000f8f80000,0x00000000fae80000) ParOldGen total 277504K, used 130727K [0x00000000e0000000, 0x00000000f0f00000, 0x00000000f5500000) object space 277504K, 47% used [0x00000000e0000000,0x00000000e7fa9d78,0x00000000f0f00000) PSPermGen total 117760K, used 104529K [0x00000000d8000000, 0x00000000df300000, 0x00000000e0000000) object space 117760K, 88% used [0x00000000d8000000,0x00000000de614668,0x00000000df300000) } Event: 1005.333 GC heap before {Heap before GC invocations=53 (full 18): PSYoungGen total 93184K, used 69037K [0x00000000f5500000, 0x00000000fd200000, 0x0000000100000000) eden space 59904K, 100% used [0x00000000f5500000,0x00000000f8f80000,0x00000000f8f80000) from space 33280K, 27% used [0x00000000fae80000,0x00000000fb76b6b0,0x00000000fcf00000) to space 31744K, 0% used [0x00000000f8f80000,0x00000000f8f80000,0x00000000fae80000) ParOldGen total 277504K, used 130727K [0x00000000e0000000, 0x00000000f0f00000, 0x00000000f5500000) object space 277504K, 47% used [0x00000000e0000000,0x00000000e7fa9d78,0x00000000f0f00000) PSPermGen total 117760K, used 104537K [0x00000000d8000000, 0x00000000df300000, 0x00000000e0000000) object space 117760K, 88% used [0x00000000d8000000,0x00000000de616780,0x00000000df300000) Event: 1005.350 GC heap after Heap after GC invocations=53 (full 18): PSYoungGen total 91648K, used 15104K [0x00000000f5500000, 0x00000000fd700000, 0x0000000100000000) eden space 59904K, 0% used [0x00000000f5500000,0x00000000f5500000,0x00000000f8f80000) from space 31744K, 47% used [0x00000000f8f80000,0x00000000f9e40380,0x00000000fae80000) to space 32768K, 0% used [0x00000000fb700000,0x00000000fb700000,0x00000000fd700000) ParOldGen total 277504K, used 130735K [0x00000000e0000000, 0x00000000f0f00000, 0x00000000f5500000) object space 277504K, 47% used [0x00000000e0000000,0x00000000e7fabd78,0x00000000f0f00000) PSPermGen total 117760K, used 104537K [0x00000000d8000000, 0x00000000df300000, 0x00000000e0000000) object space 117760K, 88% used [0x00000000d8000000,0x00000000de616780,0x00000000df300000) } Event: 1046.368 GC heap before {Heap before GC invocations=54 (full 18): PSYoungGen total 91648K, used 32514K [0x00000000f5500000, 0x00000000fd700000, 0x0000000100000000) eden space 59904K, 29% used [0x00000000f5500000,0x00000000f6600668,0x00000000f8f80000) from space 31744K, 47% used [0x00000000f8f80000,0x00000000f9e40380,0x00000000fae80000) to space 32768K, 0% used [0x00000000fb700000,0x00000000fb700000,0x00000000fd700000) ParOldGen total 277504K, used 130735K [0x00000000e0000000, 0x00000000f0f00000, 0x00000000f5500000) object space 277504K, 47% used [0x00000000e0000000,0x00000000e7fabd78,0x00000000f0f00000) PSPermGen total 117760K, used 104542K [0x00000000d8000000, 0x00000000df300000, 0x00000000e0000000) object space 117760K, 88% used [0x00000000d8000000,0x00000000de6179d8,0x00000000df300000) Event: 1046.379 GC heap after Heap after GC invocations=54 (full 18): PSYoungGen total 97280K, used 352K [0x00000000f5500000, 0x00000000fd400000, 0x0000000100000000) eden space 67584K, 0% used [0x00000000f5500000,0x00000000f5500000,0x00000000f9700000) from space 29696K, 1% used [0x00000000fb700000,0x00000000fb758000,0x00000000fd400000) to space 31232K, 0% used [0x00000000f9700000,0x00000000f9700000,0x00000000fb580000) ParOldGen total 277504K, used 130735K [0x00000000e0000000, 0x00000000f0f00000, 0x00000000f5500000) object space 277504K, 47% used [0x00000000e0000000,0x00000000e7fabd78,0x00000000f0f00000) PSPermGen total 117760K, used 104542K [0x00000000d8000000, 0x00000000df300000, 0x00000000e0000000) object space 117760K, 88% used [0x00000000d8000000,0x00000000de6179d8,0x00000000df300000) } Event: 1046.379 GC heap before {Heap before GC invocations=55 (full 19): PSYoungGen total 97280K, used 352K [0x00000000f5500000, 0x00000000fd400000, 0x0000000100000000) eden space 67584K, 0% used [0x00000000f5500000,0x00000000f5500000,0x00000000f9700000) from space 29696K, 1% used [0x00000000fb700000,0x00000000fb758000,0x00000000fd400000) to space 31232K, 0% used [0x00000000f9700000,0x00000000f9700000,0x00000000fb580000) ParOldGen total 277504K, used 130735K [0x00000000e0000000, 0x00000000f0f00000, 0x00000000f5500000) object space 277504K, 47% used [0x00000000e0000000,0x00000000e7fabd78,0x00000000f0f00000) PSPermGen total 117760K, used 104542K [0x00000000d8000000, 0x00000000df300000, 0x00000000e0000000) object space 117760K, 88% used [0x00000000d8000000,0x00000000de6179d8,0x00000000df300000) Event: 1047.010 GC heap after Heap after GC invocations=55 (full 19): PSYoungGen total 97280K, used 0K [0x00000000f5500000, 0x00000000fd400000, 0x0000000100000000) eden space 67584K, 0% used [0x00000000f5500000,0x00000000f5500000,0x00000000f9700000) from space 29696K, 0% used [0x00000000fb700000,0x00000000fb700000,0x00000000fd400000) to space 31232K, 0% used [0x00000000f9700000,0x00000000f9700000,0x00000000fb580000) ParOldGen total 277504K, used 130820K [0x00000000e0000000, 0x00000000f0f00000, 0x00000000f5500000) object space 277504K, 47% used [0x00000000e0000000,0x00000000e7fc1338,0x00000000f0f00000) PSPermGen total 115712K, used 104542K [0x00000000d8000000, 0x00000000df100000, 0x00000000e0000000) object space 115712K, 90% used [0x00000000d8000000,0x00000000de617818,0x00000000df100000) } Event: 1106.374 GC heap before {Heap before GC invocations=56 (full 19): PSYoungGen total 97280K, used 415K [0x00000000f5500000, 0x00000000fd400000, 0x0000000100000000) eden space 67584K, 0% used [0x00000000f5500000,0x00000000f5567d28,0x00000000f9700000) from space 29696K, 0% used [0x00000000fb700000,0x00000000fb700000,0x00000000fd400000) to space 31232K, 0% used [0x00000000f9700000,0x00000000f9700000,0x00000000fb580000) ParOldGen total 277504K, used 130820K [0x00000000e0000000, 0x00000000f0f00000, 0x00000000f5500000) object space 277504K, 47% used [0x00000000e0000000,0x00000000e7fc1338,0x00000000f0f00000) PSPermGen total 115712K, used 104542K [0x00000000d8000000, 0x00000000df100000, 0x00000000e0000000) object space 115712K, 90% used [0x00000000d8000000,0x00000000de617818,0x00000000df100000) Event: 1106.384 GC heap after Heap after GC invocations=56 (full 19): PSYoungGen total 68096K, used 64K [0x00000000f5500000, 0x00000000fd100000, 0x0000000100000000) eden space 67584K, 0% used [0x00000000f5500000,0x00000000f5500000,0x00000000f9700000) from space 512K, 12% used [0x00000000f9700000,0x00000000f9710000,0x00000000f9780000) to space 29696K, 0% used [0x00000000fb400000,0x00000000fb400000,0x00000000fd100000) ParOldGen total 277504K, used 130820K [0x00000000e0000000, 0x00000000f0f00000, 0x00000000f5500000) object space 277504K, 47% used [0x00000000e0000000,0x00000000e7fc1338,0x00000000f0f00000) PSPermGen total 115712K, used 104542K [0x00000000d8000000, 0x00000000df100000, 0x00000000e0000000) object space 115712K, 90% used [0x00000000d8000000,0x00000000de617818,0x00000000df100000) } Event: 1106.384 GC heap before {Heap before GC invocations=57 (full 20): PSYoungGen total 68096K, used 64K [0x00000000f5500000, 0x00000000fd100000, 0x0000000100000000) eden space 67584K, 0% used [0x00000000f5500000,0x00000000f5500000,0x00000000f9700000) from space 512K, 12% used [0x00000000f9700000,0x00000000f9710000,0x00000000f9780000) to space 29696K, 0% used [0x00000000fb400000,0x00000000fb400000,0x00000000fd100000) ParOldGen total 277504K, used 130820K [0x00000000e0000000, 0x00000000f0f00000, 0x00000000f5500000) object space 277504K, 47% used [0x00000000e0000000,0x00000000e7fc1338,0x00000000f0f00000) PSPermGen total 115712K, used 104542K [0x00000000d8000000, 0x00000000df100000, 0x00000000e0000000) object space 115712K, 90% used [0x00000000d8000000,0x00000000de617818,0x00000000df100000)

java调用dll文件,调用失败# Problematic frame: # C [MSVCR100D.dll+0x7bbbc]

java使用jna.Native的方式调用dll文件,报错: ``` # Problematic frame: # C [MSVCR100D.dll+0x7bbbc] ``` 错误日志头: ``` # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6ba2bbbc, pid=14344, tid=0x0000312c # # JRE version: Java(TM) SE Runtime Environment (8.0_231-b11) (build 1.8.0_231-b11) # Java VM: Java HotSpot(TM) Client VM (25.231-b11 mixed mode windows-x86 ) # Problematic frame: # C [MSVCR100D.dll+0x7bbbc] # # Core dump written. Default location: E:\sboot\hs_err_pid14344.mdmp # # If you would like to submit a bug report, please visit: # http://bugreport.java.com/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. ``` 主要错误: ``` Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j com.sun.jna.Native.invokePointer(JI[Ljava/lang/Object;)J+0 j com.sun.jna.Function.invokePointer(I[Ljava/lang/Object;)Lcom/sun/jna/Pointer;+6 j com.sun.jna.Function.invokeString(I[Ljava/lang/Object;Z)Ljava/lang/String;+3 j com.sun.jna.Function.invoke([Ljava/lang/Object;Ljava/lang/Class;Z)Ljava/lang/Object;+544 j com.sun.jna.Function.invoke(Ljava/lang/Class;[Ljava/lang/Object;Ljava/util/Map;)Ljava/lang/Object;+214 j com.sun.jna.Library$Handler.invoke(Ljava/lang/Object;Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object;+341 j com.sun.proxy.$Proxy0.InterfaceFunc(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;+76 j com.itliuyue.sboot.utils.CAlgorithmByTES.main([Ljava/lang/String;)V+41 v ~StubRoutines::call_stub ```

(MFC42D.DLL):0xC0000005:Access Violation

void CMyscanDlg::OnButton1Start() { // TODO: Add your control notification handler code here CString btnTxt,IP; UINT nSinglePort; BYTE f1,f2,f3,f4; TCHAR temp[10]="\0"; m_cProgress.SetPos(0); m_cResult.DeleteAllItems();//清空所有条目 POSITION p=m_pStatusList->GetHeadPosition(); while(p) { POSITION temp=p; DATA* pNode=(DATA*)m_pStatusList->GetNext(p); m_pStatusList->RemoveAt(temp); if (pNode)//pNode!=null delete pNode; } //判断IP是否为空 if(m_cIP.IsBlank()) { MessageBox("请输入主机IP地址"); return; } if(m_cIP.GetAddress(f1,f2,f3,f4)<4)//判断输入IP是否有误 { MessageBox("请输入有效的IP地址"); return; } IP=_itoa(f1,temp,10); IP+=_T('.'); IP+=_itoa(f2,temp,10); IP+=_T('.'); IP+=_itoa(f3,temp,10); IP+=_T('.'); IP+=_itoa(f4,temp,10); m_cBtnStop.EnableWindow();//停止按键默认允许 m_cBtnScan.EnableWindow(false);//扫描按键被禁止 if(m_bSinglePort) { CString port; m_cSinglePort.GetWindowText(port); //最大端口等于最小端口视为单个端口扫描 m_minPort=m_maxPort=nSinglePort=atoi(port); } else { CString port1,port2; m_cPortFrom.GetWindowText(port1); m_cPortTo.GetWindowText(port2); m_minPort=atoi(port1); m_maxPort=atoi(port2); //进度条 m_cProgress.SetRange32(0,m_maxPort-m_minPort+1); m_cProgress.SetStep(1); } if (m_maxPort<m_minPort) { MessageBox(_T("您输入的端口范围有误,请重新输入")); return; } UINT m_nMaxAttempts=GetDlgItemInt(IDC_EDIT_ATTEMPTS); for(m_nCounter=m_minPort;m_nCounter<=m_maxPort;m_nCounter++) { BOOL bIsOpen=false; UINT nAttempt=1; //尝试次数 while(nAttempt<=m_nMaxAttempts && !bIsOpen) { TCHAR temp[10]="\0"; CString str=_T("尝试连接端口:"); str+=itoa(m_nCounter,temp,10); str+=_T(", IP地址为="); str+=IP; str+=_T(", 尝试次数为="); str+=itoa(nAttempt,temp,10); CStatic* pStatic=(CStatic*)GetDlgItem(IDC_STATIC_STATUS); pStatic->SetWindowText(str);//(也有用这个函数的SetStatusBarText) str.Empty(); bIsOpen=TestConnection(IP,m_nCounter); if(bIsOpen) { DATA* pNode=new DATA; ASSERT(pNode); strcpy(pNode->IPAddress,IP.GetBuffer(IP.GetLength())); strcpy(pNode->port,_itoa(m_nCounter,temp,10)); pNode->bStatus=1; //打开 pNode->nAttempts=nAttempt; m_pStatusList->AddTail(pNode); } nAttempt++; } if (!bIsOpen) { DATA* pNode=new DATA; ASSERT(pNode); strcpy(pNode->IPAddress,IP.GetBuffer(IP.GetLength())); strcpy(pNode->port,_itoa(m_nCounter,temp,10)); pNode->bStatus=0; //关闭 pNode->nAttempts=nAttempt-1; m_pStatusList->AddTail(pNode); } MSG message; if (::PeekMessage(&message,NULL,0,0,PM_REMOVE)) { ::TranslateMessage(&message); ::DispatchMessage(&message); } m_cProgress.StepIt(); } //设定状态栏 CStatic* pStatic=(CStatic*)GetDlgItem(IDC_STATIC_STATUS); pStatic->SetWindowText((CString)_T("当前扫描状态")); m_cBtnScan.EnableWindow(); m_cBtnStop.EnableWindow(false); //填充报表视图 UINT nIndex=0; POSITION pos=m_pStatusList->GetHeadPosition(); while(pos) { DATA* pNode=(DATA*)m_pStatusList->GetNext(pos); /*/////////////////////////////////////(自己尝试的另一种输出列表,无视无视) m_cResult.InsertItem(nIndex,NULL); m_cResult.SetItemText(nIndex,0,pNode->IPAddress); m_cResult.SetItemText(nIndex,1,pNode->port);*/ AddItem(nIndex,0,pNode->IPAddress,0); AddItem(nIndex,1,pNode->port,0); if (pNode->bStatus) { //m_cResult.SetItemText(nIndex,2,"开"); //m_cResult.SetItemText(nIndex,4,"get"); AddItem(nIndex,2,_T("开"),0); AddItem(nIndex,4,_T("⊙▽⊙"),0); } else { //m_cResult.SetItemText(nIndex,2,"关"); //m_cResult.SetItemText(nIndex,4,"no way"); AddItem(nIndex,2,_T("关"),0); AddItem(nIndex,4,_T("T T"),0); } //m_cResult.SetItemText(nIndex++,3,itoa(pNode->nAttempts,temp,10)); AddItem(nIndex++,3,_itoa(pNode->nAttempts,temp,10),0); } } ``` 网上应该很多这个代码,我运行这个代码之后就出现![图片说明](https://img-ask.csdn.net/upload/201501/02/1420206303_65279.jpg) list_s.cpp文件的171行 POSITION CStringList::AddTail(const CString& newElement) { ASSERT_VALID(this); CNode* pNewNode = NewNode(m_pNodeTail, NULL); pNewNode->data = newElement; if (m_pNodeTail != NULL) m_pNodeTail->pNext = pNewNode; else m_pNodeHead = pNewNode; m_pNodeTail = pNewNode; return (POSITION) pNewNode; } ``` 研究了下应该是 //增加一列标题栏字符 void CMyscanDlg::AddHeader(LPTSTR hdr) { if(m_pColumns) m_pColumns->AddTail(hdr); } 这个函数出问题了,但是不知道怎么改,就把添加标题栏的方式换了一种。 结果窗口出来了,但是开始扫描之后就显示已停止工作_(:3」∠)_ debug检查弹出的窗口显示unhandled exception in *.exe (MFC42D.DLL):0xC0000005:Access Violation 已经不知道怎么改的我,求大神指点

使用RXTXxcomm报错 EXCEPTION_ACCESS_VIOLATION (0xc0000005) C [rxtxSerial.dll+0x5b00]

我是个新手,想用rxtxcomm读一个传感器通过USB传来的数据的,结果一直报错,搞了两天都没有解决。郁闷,求高手指导啊。 源码如下: package com.comm; import java.io.IOException; import java.io.InputStream; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.UnsupportedCommOperationException; public class ComPollingListener { public static void main(String[] args) { //1.定义变量 CommPortIdentifier com = null; //未打开的端口 SerialPort serialCom = null; //打开的端口 InputStream inputStream = null; //端口输入流 try { //2.获取并打开串口COM com=CommPortIdentifier.getPortIdentifier("COM3"); //com口为COM3 serialCom=(SerialPort) com.open("ComEventListener", 1000); //设置端口参数 try { serialCom.setSerialPortParams( 15200,//波特率 SerialPort.DATABITS_8,//数据位数 SerialPort.STOPBITS_1,//停止位 SerialPort.PARITY_NONE//奇偶位 ); }catch (UnsupportedCommOperationException e) { e.printStackTrace(); } //3.获取串口的输入流对象 inputStream = serialCom.getInputStream(); //4.从串口读入数据 //定义用于缓存读入数据的数组 byte[] cache = new byte[2]; //记录已经到达串口COM且未被读取的数据的字节(Byte)数。 int availableBytes = 0; //无限循环,每隔20毫秒对串口COM进行一次扫描,检查是否有数据到达 while(true){ //获取串口COM收到的可用字节数 availableBytes = inputStream.available(); //如果可用字节数大于零则开始循环并获取数据 System.out.println(availableBytes+";"); while(availableBytes > 0){ //从串口的输入流对象中读入数据并将数据存放到缓存数组中 inputStream.read(cache); // System.out.println("进来了"); System.out.println(cache.length); //将获取到的数据进行转码并输出 for(int j = 0;j < cache.length && j < availableBytes; j++){ //因为COM口发送的是使用byte数组表示的字符串,所以在此将接收到的每个字节的数据都强制装换为char对象即可, //这是一个简单的编码转换,可以根据需要进行更加复杂的编码转换 System.out.print((char)cache[j]); // System.out.println(cache.length); } // System.out.println("完成"); //更新循环条件 availableBytes = inputStream.available(); } //让线程睡眠20毫秒 Thread.sleep(20); } }catch (InterruptedException e){ e.printStackTrace(); }catch (NoSuchPortException e) { //找不到串口的情况下抛出该异常 e.printStackTrace(); }catch (PortInUseException e) { //如果因为端口被占用而导致打开失败,则抛出该异常 e.printStackTrace(); }catch (IOException e) { //如果获取输出流失败,则抛出该异常 e.printStackTrace(); } } } 异常为: # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0000000180005b00, pid=9664, tid=7652 # # JRE version: Java(TM) SE Runtime Environment (11.0.1+13) (build 11.0.1+13-LTS) # Java VM: Java HotSpot(TM) 64-Bit Server VM (11.0.1+13-LTS, mixed mode, tiered, compressed oops, g1 gc, windows-amd64) # Problematic frame: # C [rxtxSerial.dll+0x5b00] # # No core dump will be written. Minidumps are not enabled by default on client versions of Windows

TensorFlow1.14.0 训练自己模型出错 Windows fatal exception: access violation Current thread 0x00002c38 (most recent call first)

W0424 18:27:53.741117 11320 deprecation_wrapper.py:119] From D:\Anaconda\envs\tensorflow\lib\site-packages\object_detection-0.1-py3.6.egg\object_detection\data_decoders\tf_example_decoder.py:197: The name tf.VarLenFeature is deprecated. Please use tf.io.VarLenFeature instead. Windows fatal exception: access violation Current thread 0x00002c38 (most recent call first): File "D:\Anaconda\envs\tensorflow\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 84 in _preread_check File "D:\Anaconda\envs\tensorflow\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 122 in read File "D:\Anaconda\envs\tensorflow\lib\site-packages\object_detection-0.1-py3.6.egg\object_detection\utils\label_map_util.py", line 139 in load_labelmap File "D:\Anaconda\envs\tensorflow\lib\site-packages\object_detection-0.1-py3.6.egg\object_detection\utils\label_map_util.py", line 172 in get_label_map_dict File "D:\Anaconda\envs\tensorflow\lib\site-packages\object_detection-0.1-py3.6.egg\object_detection\data_decoders\tf_example_decoder.py", line 64 in __init__ File "D:\Anaconda\envs\tensorflow\lib\site-packages\object_detection-0.1-py3.6.egg\object_detection\data_decoders\tf_example_decoder.py", line 319 in __init__ File "D:\Anaconda\envs\tensorflow\lib\site-packages\object_detection-0.1-py3.6.egg\object_detection\builders\dataset_builder.py", line 130 in build File "train.py", line 122 in get_next File "D:\Anaconda\envs\tensorflow\lib\site-packages\object_detection-0.1-py3.6.egg\object_detection\legacy\trainer.py", line 60 in create_input_queue File "D:\Anaconda\envs\tensorflow\lib\site-packages\object_detection-0.1-py3.6.egg\object_detection\legacy\trainer.py", line 281 in train File "train.py", line 181 in main File "D:\Anaconda\envs\tensorflow\lib\site-packages\tensorflow\python\util\deprecation.py", line 324 in new_func File "D:\Anaconda\envs\tensorflow\lib\site-packages\absl\app.py", line 250 in _run_main File "D:\Anaconda\envs\tensorflow\lib\site-packages\absl\app.py", line 299 in run File "D:\Anaconda\envs\tensorflow\lib\site-packages\tensorflow\python\platform\app.py", line 40 in run File "train.py", line 185 in <module> ``` ``` 两三天了还没有解决,尝试换到1.12.0-gpu版本会出现tensorflow._api.compat没有v1的问题。求大神解答!!!!

C++ 程序报错 Access violation reading location 0xcdcdcdcf.

#include<iostream> #include<string.h> using namespace std; class Record { public: Record(); bool getvacant(); private: bool vacant; }; Record::Record() { vacant = true; } bool Record::getvacant() { return vacant; } class RecordManager { public: RecordManager(); ~RecordManager(); bool find(); private: Record * pRecordArr; }; RecordManager::RecordManager() { Record *pRecordArr = new Record[4]; } RecordManager::~RecordManager() { delete [] pRecordArr; } bool RecordManager::find() { bool i; i = pRecordArr[2].getvacant(); return i; } int main() { RecordManager *pR = new RecordManager; pR->find(); return 0; }

从Go调用DLL-我在做什么错?

<div class="post-text" itemprop="text"> <p>I'm trying to convert a program from Python (2.7, 32-bit) to Go (1.12.5, 32bit), and failing miserably with an access violation. The program calls a function in a 32-bit dll (ehlapi32.dll).</p> <p>The following clips of the Python code appear to work perfectly (I'm not affirming that they are correct!):</p> <pre><code>class ehlapi32: hllDll = "C:\Program Files (x86)\IBM\Personal Communications\EHLAPI32.dll" hllDll = ctypes.WinDLL(hllDll) hllApiProto = ctypes.WINFUNCTYPE(ctypes.c_int,ctypes.c_void_p,ctypes.c_void_p, ctypes.c_void_p,ctypes.c_void_p) hllApiParams = (1, "p1", 0), (1, "p2", 0), (1, "p3",0), (1, "p4",0), hllApi = hllApiProto (("HLLAPI", hllDll), hllApiParams) pFunConnect = ctypes.c_int(1) ... def connect(self): shlSession = self.session + b'\0\0\0' pText = ctypes.c_char_p (shlSession) pLength = ctypes.c_int (len(shlSession)) pReturn = ctypes.c_int (13) ehlapi32.hllApi (ctypes.byref (ehlapi32.pFunConnect), pText, ctypes.byref (pLength), ctypes.byref (pReturn)) </code></pre> <p>Now here's what I'm trying as the Go equivalent. This fails:</p> <pre><code>// ElFunc: EHLLAPI Functions type ElFunc uint32 const ( eConnect ElFunc = 1 // Connect to a terminal ) ... // Session: a 3270 session handle type Session struct { SessId string SysId string Entry string Result []string Headers int Footers int Rows int Cols int Scroll int Proc *syscall.LazyProc } ... func (s Session) Connect() uint32 { // Load EHLLAPI DLL dll := syscall.NewLazyDLL(dllName) s.Proc = dll.NewProc(dllProc) // Connect to session rc := s.ecall(eConnect, s.SessId, 1, 0) if rc == 0 { defer s.Disconnect() } ... // ecall: provides simplified EHLLAPI DLL calls func (s Session) ecall(fun ElFunc, buffer string, count uint32, ps uint32) uint32 { rc := ps _, _, _ = s.Proc.Call( uintptr(unsafe.Pointer(uintptr(uint32(fun)))), uintptr(unsafe.Pointer(&amp;buffer)), uintptr(unsafe.Pointer(uintptr(count))), uintptr(unsafe.Pointer(uintptr(rc))), ) return rc } </code></pre> <p>The failure looks like an access violation at <code>s.Proc.Call</code> in <code>ecall()</code>.</p> <p>I realise that <code>syscall</code> is deprecated; I have also tried with <code>golang.org/x/sys/windows</code>, without success. I have no constraints as to which I use.</p> <p>I'll confess I'm way out of my depth here.</p> </div>

在中国程序员是青春饭吗?

今年,我也32了 ,为了不给大家误导,咨询了猎头、圈内好友,以及年过35岁的几位老程序员……舍了老脸去揭人家伤疤……希望能给大家以帮助,记得帮我点赞哦。 目录: 你以为的人生 一次又一次的伤害 猎头界的真相 如何应对互联网行业的「中年危机」 一、你以为的人生 刚入行时,拿着傲人的工资,想着好好干,以为我们的人生是这样的: 等真到了那一天,你会发现,你的人生很可能是这样的: ...

程序员请照顾好自己,周末病魔差点一套带走我。

程序员在一个周末的时间,得了重病,差点当场去世,还好及时挽救回来了。

C++(数据结构与算法)78:---分而治之

一、分而治之的思想 分而治之方法与软件设计的模块化方法非常相似 分而治之通常不用于解决问题的小实例,而要解决一个问题的大实例。一般步骤为: ①把一个大实例分为两个或多个更小的实例 ②分别解决每个小实例 ③把这些小实例的解组合成原始大实例的解 二、实际应用之找出假币 问题描述 一个袋子有16个硬币,其中只有一个是假币,这个假币比其他的真币重量轻(其他所有真币的重量都是相同的)...

springboot+jwt实现token登陆权限认证

一 前言 此篇文章的内容也是学习不久,终于到周末有时间码一篇文章分享知识追寻者的粉丝们,学完本篇文章,读者将对token类的登陆认证流程有个全面的了解,可以动态搭建自己的登陆认证过程;对小项目而已是个轻量级的认证机制,符合开发需求;更多精彩原创内容关注公主号知识追寻者,读者的肯定,就是对作者的创作的最大支持; 二 jwt实现登陆认证流程 用户使用账号和面发出post请求 服务器接受到请求后使用私...

技术大佬:我去,你写的 switch 语句也太老土了吧

昨天早上通过远程的方式 review 了两名新来同事的代码,大部分代码都写得很漂亮,严谨的同时注释也很到位,这令我非常满意。但当我看到他们当中有一个人写的 switch 语句时,还是忍不住破口大骂:“我擦,小王,你丫写的 switch 语句也太老土了吧!” 来看看小王写的代码吧,看完不要骂我装逼啊。 private static String createPlayer(PlayerTypes p...

win10暴力查看wifi密码

刚才邻居打了个电话说:喂小灰,你家wifi的密码是多少,我怎么连不上了。 我。。。 我也忘了哎,就找到了一个好办法,分享给大家: 第一种情况:已经连接上的wifi,怎么知道密码? 打开:控制面板\网络和 Internet\网络连接 然后右击wifi连接的无线网卡,选择状态 然后像下图一样: 第二种情况:前提是我不知道啊,但是我以前知道密码。 此时可以利用dos命令了 1、利用netsh wlan...

女程序员,为什么比男程序员少???

昨天看到一档综艺节目,讨论了两个话题:(1)中国学生的数学成绩,平均下来看,会比国外好?为什么?(2)男生的数学成绩,平均下来看,会比女生好?为什么?同时,我又联想到了一个技术圈经常讨...

副业收入是我做程序媛的3倍,工作外的B面人生是怎样的?

提到“程序员”,多数人脑海里首先想到的大约是:为人木讷、薪水超高、工作枯燥…… 然而,当离开工作岗位,撕去层层标签,脱下“程序员”这身外套,有的人生动又有趣,马上展现出了完全不同的A/B面人生! 不论是简单的爱好,还是正经的副业,他们都干得同样出色。偶尔,还能和程序员的特质结合,产生奇妙的“化学反应”。 @Charlotte:平日素颜示人,周末美妆博主 大家都以为程序媛也个个不修边幅,但我们也许...

MySQL数据库面试题(2020最新版)

文章目录数据库基础知识为什么要使用数据库什么是SQL?什么是MySQL?数据库三大范式是什么mysql有关权限的表都有哪几个MySQL的binlog有有几种录入格式?分别有什么区别?数据类型mysql有哪些数据类型引擎MySQL存储引擎MyISAM与InnoDB区别MyISAM索引与InnoDB索引的区别?InnoDB引擎的4大特性存储引擎选择索引什么是索引?索引有哪些优缺点?索引使用场景(重点)...

如果你是老板,你会不会踢了这样的员工?

有个好朋友ZS,是技术总监,昨天问我:“有一个老下属,跟了我很多年,做事勤勤恳恳,主动性也很好。但随着公司的发展,他的进步速度,跟不上团队的步伐了,有点...

我入职阿里后,才知道原来简历这么写

私下里,有不少读者问我:“二哥,如何才能写出一份专业的技术简历呢?我总感觉自己写的简历太烂了,所以投了无数份,都石沉大海了。”说实话,我自己好多年没有写过简历了,但我认识的一个同行,他在阿里,给我说了一些他当年写简历的方法论,我感觉太牛逼了,实在是忍不住,就分享了出来,希望能够帮助到你。 01、简历的本质 作为简历的撰写者,你必须要搞清楚一点,简历的本质是什么,它就是为了来销售你的价值主张的。往深...

程序员写出这样的代码,能不挨骂吗?

当你换槽填坑时,面对一个新的环境。能够快速熟练,上手实现业务需求是关键。但是,哪些因素会影响你快速上手呢?是原有代码写的不够好?还是注释写的不够好?昨夜...

带了6个月的徒弟当了面试官,而身为高级工程师的我天天修Bug......

即将毕业的应届毕业生一枚,现在只拿到了两家offer,但最近听到一些消息,其中一个offer,我这个组据说客户很少,很有可能整组被裁掉。 想问大家: 如果我刚入职这个组就被裁了怎么办呢? 大家都是什么时候知道自己要被裁了的? 面试软技能指导: BQ/Project/Resume 试听内容: 除了刷题,还有哪些技能是拿到offer不可或缺的要素 如何提升面试软实力:简历, 行为面试,沟通能...

优雅的替换if-else语句

场景 日常开发,if-else语句写的不少吧??当逻辑分支非常多的时候,if-else套了一层又一层,虽然业务功能倒是实现了,但是看起来是真的很不优雅,尤其是对于我这种有强迫症的程序"猿",看到这么多if-else,脑袋瓜子就嗡嗡的,总想着解锁新姿势:干掉过多的if-else!!!本文将介绍三板斧手段: 优先判断条件,条件不满足的,逻辑及时中断返回; 采用策略模式+工厂模式; 结合注解,锦...

!大部分程序员只会写3年代码

如果世界上都是这种不思进取的软件公司,那别说大部分程序员只会写 3 年代码,恐怕就没有程序员这种职业。

离职半年了,老东家又发 offer,回不回?

有小伙伴问松哥这个问题,他在上海某公司,在离职了几个月后,前公司的领导联系到他,希望他能够返聘回去,他很纠结要不要回去? 俗话说好马不吃回头草,但是这个小伙伴既然感到纠结了,我觉得至少说明了两个问题:1.曾经的公司还不错;2.现在的日子也不是很如意。否则应该就不会纠结了。 老实说,松哥之前也有过类似的经历,今天就来和小伙伴们聊聊回头草到底吃不吃。 首先一个基本观点,就是离职了也没必要和老东家弄的苦...

2020阿里全球数学大赛:3万名高手、4道题、2天2夜未交卷

阿里巴巴全球数学竞赛( Alibaba Global Mathematics Competition)由马云发起,由中国科学技术协会、阿里巴巴基金会、阿里巴巴达摩院共同举办。大赛不设报名门槛,全世界爱好数学的人都可参与,不论是否出身数学专业、是否投身数学研究。 2020年阿里巴巴达摩院邀请北京大学、剑桥大学、浙江大学等高校的顶尖数学教师组建了出题组。中科院院士、美国艺术与科学院院士、北京国际数学...

为什么你不想学习?只想玩?人是如何一步一步废掉的

不知道是不是只有我这样子,还是你们也有过类似的经历。 上学的时候总有很多光辉历史,学年名列前茅,或者单科目大佬,但是虽然慢慢地长大了,你开始懈怠了,开始废掉了。。。 什么?你说不知道具体的情况是怎么样的? 我来告诉你: 你常常潜意识里或者心理觉得,自己真正的生活或者奋斗还没有开始。总是幻想着自己还拥有大把时间,还有无限的可能,自己还能逆风翻盘,只不是自己还没开始罢了,自己以后肯定会变得特别厉害...

男生更看重女生的身材脸蛋,还是思想?

往往,我们看不进去大段大段的逻辑。深刻的哲理,往往短而精悍,一阵见血。问:产品经理挺漂亮的,有点心动,但不知道合不合得来。男生更看重女生的身材脸蛋,还是...

为什么程序员做外包会被瞧不起?

二哥,有个事想询问下您的意见,您觉得应届生值得去外包吗?公司虽然挺大的,中xx,但待遇感觉挺低,马上要报到,挺纠结的。

当HR压你价,说你只值7K,你该怎么回答?

当HR压你价,说你只值7K时,你可以流畅地回答,记住,是流畅,不能犹豫。 礼貌地说:“7K是吗?了解了。嗯~其实我对贵司的面试官印象很好。只不过,现在我的手头上已经有一份11K的offer。来面试,主要也是自己对贵司挺有兴趣的,所以过来看看……”(未完) 这段话主要是陪HR互诈的同时,从公司兴趣,公司职员印象上,都给予对方正面的肯定,既能提升HR的好感度,又能让谈判气氛融洽,为后面的发挥留足空间。...

面试:第十六章:Java中级开发

HashMap底层实现原理,红黑树,B+树,B树的结构原理 Spring的AOP和IOC是什么?它们常见的使用场景有哪些?Spring事务,事务的属性,传播行为,数据库隔离级别 Spring和SpringMVC,MyBatis以及SpringBoot的注解分别有哪些?SpringMVC的工作原理,SpringBoot框架的优点,MyBatis框架的优点 SpringCould组件有哪些,他们...

早上躺尸,晚上干活:硅谷科技公司这么流行迟到?

硅谷科技公司上班时间OPEN早已不是什么新鲜事,早九晚五是常态,但有很多企业由于不打卡,员工们10点、11点才“姗姗来迟”的情况也屡见不鲜。 这种灵活的考勤制度为人羡慕,甚至近年来,国内某些互联网企业也纷纷效仿。不过,硅谷普遍弹性的上班制度是怎么由来的呢?这种“流行性迟到”真的有那么轻松、悠哉吗? 《动态规划专题班》 课程试听内容: 动态规划的解题要领 动态规划三大类 求最值/计数/可行性 常...

面试阿里p7,被按在地上摩擦,鬼知道我经历了什么?

面试阿里p7被问到的问题(当时我只知道第一个):@Conditional是做什么的?@Conditional多个条件是什么逻辑关系?条件判断在什么时候执...

Python爬虫,高清美图我全都要(彼岸桌面壁纸)

爬取彼岸桌面网站较为简单,用到了requests、lxml、Beautiful Soup4

无代码时代来临,程序员如何保住饭碗?

编程语言层出不穷,从最初的机器语言到如今2500种以上的高级语言,程序员们大呼“学到头秃”。程序员一边面临编程语言不断推陈出新,一边面临由于许多代码已存在,程序员编写新应用程序时存在重复“搬砖”的现象。 无代码/低代码编程应运而生。无代码/低代码是一种创建应用的方法,它可以让开发者使用最少的编码知识来快速开发应用程序。开发者通过图形界面中,可视化建模来组装和配置应用程序。这样一来,开发者直...

面试了一个 31 岁程序员,让我有所触动,30岁以上的程序员该何去何从?

最近面试了一个31岁8年经验的程序猿,让我有点感慨,大龄程序猿该何去何从。

大三实习生,字节跳动面经分享,已拿Offer

说实话,自己的算法,我一个不会,太难了吧

程序员垃圾简历长什么样?

已经连续五年参加大厂校招、社招的技术面试工作,简历看的不下于万份 这篇文章会用实例告诉你,什么是差的程序员简历! 疫情快要结束了,各个公司也都开始春招了,作为即将红遍大江南北的新晋UP主,那当然要为小伙伴们做点事(手动狗头)。 就在公众号里公开征简历,义务帮大家看,并一一点评。《启舰:春招在即,义务帮大家看看简历吧》 一石激起千层浪,三天收到两百多封简历。 花光了两个星期的所有空闲时...

Java岗开发3年,公司临时抽查算法,离职后这几题我记一辈子

前几天我们公司做了一件蠢事,非常非常愚蠢的事情。我原以为从学校出来之后,除了找工作有测试外,不会有任何与考试有关的事儿。 但是,天有不测风云,公司技术总监、人事总监两位大佬突然降临到我们事业线,叫上我老大,给我们组织了一场别开生面的“考试”。 那是一个风和日丽的下午,我翘着二郎腿,左手端着一杯卡布奇诺,右手抓着我的罗技鼠标,滚动着轮轴,穿梭在头条热点之间。 “淡黄的长裙~蓬松的头发...

立即提问
相关内容推荐