程序运行结束后总是显示:Run-Time Check Failure #2

程序运行结束后总是显示:Run-Time Check Failure #2 - Stack around the variable 'cmd_value' was corrupted.

程序过程运行正确,调试发现程序运行结束之后就会报告这个错误。
而且**只有d的数值在0到1(不包括1)**才会发生这样的错误。
我的编程环境是vs2010.

double d=0;
BYTE cmd_star[]="$";
BYTE cmd_cmd[]="001";
BYTE cmd_mid[]=",";
char cmd_value[7];
_gcvt_s(cmd_value,sizeof(cmd_value),d,5);
BYTE cmd_end[]="#";
BYTE cmd2[13];

memcpy(cmd2,cmd_star,sizeof(char));
memcpy(cmd2+1,cmd_cmd,3*sizeof(char));
memcpy(cmd2+4,cmd_mid,sizeof(char));
memcpy(cmd2+5,cmd_value,6*sizeof(char));
memcpy(cmd2+11,cmd_end,sizeof(char));

CWnd * pMain=(CWnd*)AfxGetMainWnd();

Eol.hEvent=CreateEvent(NULL,        
    TRUE,           // manual-reset event 
    FALSE,          // not signaled
    NULL);

if(!::SetCommState(hComFile,&m_BCD))
{
    //AfxMessageBox("SetCommState() error!");
    errmsg = "串口设置失败!";
    p = (LPSTR)(LPCTSTR)errmsg;
    ::SendMessage(pMain->m_hWnd,UM_ERRORMSG,0,(LPARAM)p);
    return ;
}

::EscapeCommFunction(hComFile,SETDTR);

if(WriteData(cmd2,13)!=13)
{
    //AfxMessageBox("Write com error!");
    errmsg = "串口写入失败!";
    p = (LPSTR)(LPCTSTR)errmsg;
    ::SendMessage(pMain->m_hWnd,UM_ERRORMSG,0,(LPARAM)p);
    return;
}
if (Eol.hEvent!=NULL)
{
    ResetEvent(Eol.hEvent);
}

CloseHandle(Eol.hEvent);

4个回答

BYTE cmd_star[]="$";
BYTE cmd_cmd[]="001";
BYTE cmd_mid[]=",";
这些都是常量,而且大小都很小。你把这些都定义的大一些不可以么

willzoe
willzoe 执行这些语句的时候都是正常的,只是这段代码执行完毕之后就会弹出对话框提示这个错误。
4 年多之前 回复

一般是内存操作失败造成的。有可能是你的字符数组拷贝出错了。

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
程序调试显示run-time check failure #2,stack around the variable 'xxx' was corrupted

看过其他大神的解释,但是还是没懂本代码为何bao'cuo ``` #include<stdio.h> #include<math.h> int main() { double l[3], a, b; printf("请输入一个坐标:"); scanf_s("%lf,%lf",&a,&b); printf("\n"); l[0] = sqrt(pow(a - 2, 2) + pow(b - 2, 2)); l[1] = sqrt(pow(a - 2, 2) + pow(b + 2, 2)); l[2] = sqrt(pow(a + 2, 2) + pow(b + 2, 2)); l[3] = sqrt(pow(a + 2, 2) + pow(b - 2, 2)); printf("a=%lf,b=%lf\n", a, b); printf("L1=%lf\nL2=%lf\nL3=%lf\nL4=%lf\n", l[0], l[1], l[2], l[3]); if (l[0] > 1 && l[1] > 1 && l[2] > 1 && l[3] > 1) printf("该点的建筑高度为0M"); else printf("该点的建筑高度为10M"); return(0); } ``` 提示如下 ![图片说明](https://img-ask.csdn.net/upload/201901/06/1546753900_721123.jpg)

run-time check failure #2 stack around variable

能输出正确结果可是弹出这个错误窗口是怎么回事? ``` #include<stdio.h> #include<math.h> int main(){ int a[3]; for (a[0] = 1; a[0] < 21; a[0]++) for (a[1] = 1; a[1] < a[0]; a[1]++) for (a[2] = 1; a[2] < a[1]; a[2]++) for (a[3] = 1; a[3] < a[2]; a[3]++) { if (abs(1.0 / a[0] + 1.0 / a[1] + 1.0 / a[2] + 1.0 / a[3] - 1) < 0.0001) printf("%d %d %d %d\n", a[0], a[1], a[2], a[3]); } return 0; } ```

Stack around the variable 'test' was corrupted

#include<stdio.h> int main(void) { unsigned char test; scanf("%hhd", &test); printf("The number %hhd 's ASCII code is %c.\n", test, test); return 0; }

mongoDB c++ 更新插入数据时BSONObjBuilder对象在函数返回时出错

``` BSONObjBuilder data; data.append("Date",newtime); data.append("OpenPrice",strOpenPrice); data.append("HighPrice",HighPrice); data.append("LowPrice",LowPrice); data.append("ClosePrice",ClosePrice); data.append("AvgPrice",strAvgPrice); data.append("Amount",strAmount); data.append("Hold",strHold); BSONObjBuilder builder; builder.append("$set",data.obj()); conn.update(ns,condition,builder.obj(),true,true); ``` 函数里这段代码执行完以后当函数返回时报错: Run-Time Check Failure #2 - Stack around the variable 'builder' was corrupted. Run-Time Check Failure #2 - Stack around the variable 'data' was corrupted.

VTK 使用中, 遇到异常报错。

我使用VS2005, 使用 cmake2.8.7 编译的 VTK5.8.0 。 我在自己的MFC框架内想调用 VTK 函数, 编译没有任何问题,但是运行时总是异常报错。 错误显示: Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention. 为了查找问题, 我将调用VTK函数的地方做了修改,只是简单使用了VTK自带cone例子中的几句话: void CMyWorkClassView::OnProcDisplay() { vtkConeSource *cone = vtkConeSource::New(); cone->SetHeight( 3.0 ); cone->SetRadius( 1.0 ); cone->SetResolution( 10 ); return; } 错误依旧。 但是我单纯用VS2005编译VTK自带的cone例子是没有任何问题的。 我将执行程序拷贝给同事,让同事帮我运行,同事运行正常。同事是XP系统,我是win7,我俩都是VS2005,可能VTK版本不一样,但是使用的vtkConeSource类应该是一样的。 哪位大神可以帮忙看下到底怎么回事。 我的MFC框架是利用系统模板建立的,而且目前还没有怎么改动,问题应该不大。 项目属性配置中c/c++的常规,以及项目属性中链接 的 常规,输入等,我都配置了。 C/C++ 常规 :"D:\VTK VS2005\VTK\include\vtk-5.8" 链接器 常规 :"D:\VTK VS2005\VTK\lib\vtk-5.8" 链接器 输入 :vtkMFC.lib delayimp.lib vtkexpat.lib vtkWidgets.lib vtkzlib.lib vtkRendering.lib vtksys.lib vtktiff.lib vtkVolumeRendering.lib vtkHybrid.lib vtkpng.lib vtkImaging.lib vtkIO.lib vtkjpeg.lib vtkNetCDF.lib vtkGraphics.lib vtkFiltering.lib vtkfreetype.lib vtkftgl.lib vtkGenericFiltering.lib odbc32.lib odbccp32.lib vtkCommon.lib vtkDICOMParser.lib vtkexoIIc.lib oleaut32.lib uuid.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib opengl32.lib kernel32.lib user32.lib gdi32.lib

{汇编语言} 在使用栈时出现的一个小问题

我想把寄存器中的数据保存到栈里,为什么使用的时候结果就会出问题,但如果直接在程序中打出来结果就是正确的 call enter_stack ======================= call out_stack enter_stack:push di push si push cx ret out_stack :pop cx pop si pop di ret 整个代码: assume cs:code data segment ;0123456789ABCDEF 07H黑底白字 db 'conversation' data ends stack segment db 16 dup(0) stack ends code segment start :mov ax,data mov ds,ax mov ax,stack mov ss,ax mov sp,16 mov ax,0B800H mov es,ax mov di,12*80*2+40*2-8*2 mov cx,12 mov si,0 push di push si push cx call show ;显示小写字符 pop cx pop si pop di call cube ;原字符变大写 mov di,13*80*2+40*2-8*2 mov cx,12 mov si,0 call show ;显示大写字符 mov ax,4c00h int 21h show: mov dl,ds:[si] mov dh,07H ;白底黑字 mov es:[di],dx inc si add di,2 loop show ret cube: and byte ptr ds:[si],11011111b inc si loop cube ret enter_stack:push di push si push cx ret out_stack:pop cx pop si pop di ret code ends end start 直接用push和pop就没有问题,但用call enter__stack和out__stack就有问题了,想问为什么会这样?

Stack around the variable 'array' was corrupted.

数组排序的代码,在运行时显示:Stack around the variable 'array' was corrupted. 以下为源代码: ``` #include<stdio.h> main() { //定义数组 int array[10]; int p; int i,j; int min; for (i = 0;i < 10;i = i + 1) { scanf_s("%d", &array[i]); } //取最小值 for (i = 0;i < 9;i = i + 1) { min = array[i];//设置当前为最小值 p = i + 1;//元素位置 for (j = i + 1;j < 10;j = j + 1) { if (array[j] < min) { min = array[j]; p = j + 1; } } array[j] = array[i]; array[i] = min; } //交换元素值 for (i = 0;i < 10;i =i + 1) { printf("%d", array[i]); printf(" "); } } ``` 求指出错在何处

VC和BCB编写DLL。 DWORD WINAPI 怪问题

函数原型是:DWORD (WINAPI* m_pfnGetInfo)(int nInfo, void* pBuf); 2个动态库,原来用BCB写的,没问题, C++ BULIDER中这样: extern "C" __declspec(dllexport) DWORD WINAPI GetInfo(int nInfo,void * pBuf) VC2008,同样写 extern "C" __declspec(dllexport) DWORD WINAPI GetInfo(int nInfo,void * pBuf) 结果是GetProcAddress返回空, 改成这样: extern "C" __declspec(dllexport) DWORD GetInfo(int nInfo,void * pBuf) GetProcAddress返回正常,但调用时出错,信息为:Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention. 百思不得其姐!

EPS错误,通过调整Basic Runtime Checks设置解决的原理

最近再编写C#与C++双向交互的程序。 昨天解决了一个程序的bug,但是原理不清楚,望大神指点。 具体Bug:C#调用C++动态库的一个函数(如A),函数中做了很多C++与C#双向交互的工作,方法执行全部没有问题,其中双向调用的函数也都执行完毕,但是在A函数返回跳到C#后,跳下述错误: Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention. 如果继续执行,会导致整个计算机系统崩溃。 解决办法:将C++ Code Generation中的Basic Runtime Checks 设为 Default。如此更改后,程序运行完全正常,后续代码运行正常,多次调用函数A也没有问题。 疑问:后续查了一下关于这个属性的定义,是不进行ESP检查。可是ESP是函数出入前后栈的检查,如果栈出错,按说程序无法回到原代码区,怎么会简单修改一个check属性后就可执行通过。另外为什么会出现check不通过的现象。 备注:非stdcall问题

MFC中pDl->OnSend(nErrorCode)

使用此语句:pDl->OnSend(nErrorCode),出现如下错误: Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention. 请问是什么原因,该怎么解决?

MFC pDl->OnSend(nErrorCode);

![![图片说明](https://img-ask.csdn.net/upload/201504/20/1429523701_23840.jpg)图片说明](https://img-ask.csdn.net/upload/201504/20/1429523692_595811.jpg) 出现如下问题 Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.

maven错误:Could not find goal 'compile' in plugin

[INFO] Scanning for projects... [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 0.258s [INFO] Finished at: Sun Aug 27 20:30:18 CST 2017 [INFO] Final Memory: 6M/16M [INFO] ------------------------------------------------------------------------ [ERROR] Could not find goal 'compile' in plugin org.codehaus.mojo:tomcat-maven-plugin:1.1 among available goals run-war-only, redeploy, roles, run-war, deploy-only, help, sessions, deploy, run, start, exploded, stop, inplace, reload, resources, shutdown, list, undeploy, info -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoNotFoundException

GetProcAddress 返回 NULL, 错误代码 127

# 本问题作废,错误: if (hinstLib = NULL) ------------ 源程序改自 《程序员的自我修养:链接、装载与库》 第1版 第9 章 编译环境 VS2017/Win SDK 10.0. # 问题概要 DLL动态库,LoadLibrary() 成功, GetProcAddress()失败, GetLastError()返回127. 但是 dumpbin 能够找到所需要的符号. 请问如何改可以正确执行 # 详细描述 ## 动态库 Math.dll 代码 Math.c ``` __declspec(dllexport) double Add(double a, double b) { return a + b; } ``` 生成 DLL ``` cl /LDd Math.c ``` 查看导出结果 ``` dumpbin /EXPORTS Math.dll ... ordinal hint RVA name 1 0 00001000 Add ... ``` ## 主程序调用 程序代码 main.c ``` #include <windows.h> #include <stdio.h> typedef double (*Func)(double, double); int main(int argc, char **argv) { Func function; double result; // Load DLL. HINSTANCE hinstLib = LoadLibrary("Math.dll"); if (hinstLib = NULL) { printf("ERROR: unable to load DLL\n"); return 1; } // Get function address. function = (Func)GetProcAddress(hinstLib, "Add"); if (function == NULL) { printf("ERROR: unable to find DLL function, " "GetLastError() returns %d.\n", GetLastError()); FreeLibrary(hinstLib); return 1; } // Call function. result = function(1.0, 2.0); // Unload DLL file. FreeLibrary(hinstLib); // Display result. printf("Result = %f\n", result); return 0; } ``` 编译链接 ``` cl main.c ``` 运行 ``` ERROR: unable to find DLL function, GetLastError() returns 127. ```

C语言数组溢出问题求指点

#include<stdio.h> #define N 5 main() { int i,a[N]; for(i=0;i<N;i++) a[N]=i; for(i=0;i<N;i++) printf("%5d",a[N]); printf("\n"); } 在第六行 警告 1 warning C4789: 缓冲区“a”(大小为 20 字节)将溢出;4 字节将在偏移 20 时开始写入 Run-Time Check Failure #2 - Stack around the variable 'a' was corrupted. 可是运行时有结果啊 4 4 4 4 4 而且是正确的,这是为什么呢?为什么会溢出呢?损坏的到底是什么空间?

使用IDEA和maven做注册时候遇到如下问题:

"E:\IntelliJ IDEA 2016.2.1\jdk1.8.0_91\bin\java" "-Dmaven.home=E:\IntelliJ IDEA 2016.2.1\plugins\maven\lib\maven3" "-Dclassworlds.conf=E:\IntelliJ IDEA 2016.2.1\plugins\maven\lib\maven3\bin\m2.conf" -Didea.launcher.port=7533 "-Didea.launcher.bin.path=E:\IntelliJ IDEA 2016.2.1\bin" -Dfile.encoding=UTF-8 -classpath "E:\IntelliJ IDEA 2016.2.1\plugins\maven\lib\maven3\boot\plexus-classworlds-2.4.jar;E:\IntelliJ IDEA 2016.2.1\lib\idea_rt.jar" com.intellij.rt.execution.application.AppMain org.codehaus.classworlds.Launcher -Didea.version=2016.2.1 tomcat:run [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building zhuce Maven Webapp 1.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] >>> tomcat-maven-plugin:1.1:run (default-cli) @ zhuce >>> [WARNING] The POM for com.google.guava:guava:jar:15.0 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details [WARNING] The POM for javax.servlet:javax.servlet-api:jar:3.1.0 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details [WARNING] The POM for org.glassfish.jersey.containers:jersey-container-grizzly2-servlet:jar:2.13 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details [WARNING] The POM for org.glassfish.jersey.containers:jersey-container-servlet-core:jar:2.13 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details [WARNING] The POM for commons-io:commons-io:jar:2.4 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details [WARNING] The POM for org.glassfish.jersey.core:jersey-client:jar:2.13 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details [WARNING] The POM for org.apache.bval:bval-jsr303:jar:0.5 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details [WARNING] The POM for log4j:log4j:jar:1.2.14 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details [WARNING] The POM for org.apache.httpcomponents:httpclient:jar:4.1 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details [WARNING] The POM for com.tustcs.java:base:jar:1.0 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details [WARNING] The POM for org.json:json:jar:20140107 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details [INFO] [INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ zhuce --- [debug] execute contextualize [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! [INFO] Copying 0 resource [INFO] [INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ zhuce --- [WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent! [INFO] Compiling 2 source files to F:\zhuce\target\classes [INFO] ------------------------------------------------------------- [ERROR] COMPILATION ERROR : [INFO] ------------------------------------------------------------- [ERROR] Failure executing javac, but could not parse the error: 错误: 读取C:\Users\ZILI\.m2\repository\com\google\guava\guava\15.0\guava-15.0.jar时出错; error in opening zip file 错误: 读取C:\Users\ZILI\.m2\repository\javax\servlet\javax.servlet-api\3.1.0\javax.servlet-api-3.1.0.jar时出错; error in opening zip file 错误: 读取C:\Users\ZILI\.m2\repository\org\glassfish\jersey\containers\jersey-container-grizzly2-servlet\2.13\jersey-container-grizzly2-servlet-2.13.jar时出错; error in opening zip file 错误: 读取C:\Users\ZILI\.m2\repository\org\glassfish\jersey\containers\jersey-container-servlet-core\2.13\jersey-container-servlet-core-2.13.jar时出错; error in opening zip file 错误: 读取C:\Users\ZILI\.m2\repository\commons-io\commons-io\2.4\commons-io-2.4.jar时出错; error in opening zip file 错误: 读取C:\Users\ZILI\.m2\repository\org\glassfish\jersey\core\jersey-client\2.13\jersey-client-2.13.jar时出错; error in opening zip file 错误: 读取C:\Users\ZILI\.m2\repository\org\apache\bval\bval-jsr303\0.5\bval-jsr303-0.5.jar时出错; error in opening zip file 错误: 读取C:\Users\ZILI\.m2\repository\log4j\log4j\1.2.14\log4j-1.2.14.jar时出错; error in opening zip file 错误: 读取C:\Users\ZILI\.m2\repository\org\apache\httpcomponents\httpclient\4.1\httpclient-4.1.jar时出错; error in opening zip file 错误: 读取C:\Users\ZILI\.m2\repository\com\tustcs\java\base\1.0\base-1.0.jar时出错; error in opening zip file 错误: 读取C:\Users\ZILI\.m2\repository\org\json\json\20140107\json-20140107.jar时出错; error in opening zip file 11 个错误 [INFO] 1 error [INFO] ------------------------------------------------------------- [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 13.436s [INFO] Finished at: Mon Oct 10 10:44:37 CST 2016 [INFO] Final Memory: 10M/77M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project zhuce: Compilation failure [ERROR] Failure executing javac, but could not parse the error: [ERROR] 错误: 读取C:\Users\ZILI\.m2\repository\com\google\guava\guava\15.0\guava-15.0.jar时出错; error in opening zip file [ERROR] 错误: 读取C:\Users\ZILI\.m2\repository\javax\servlet\javax.servlet-api\3.1.0\javax.servlet-api-3.1.0.jar时出错; error in opening zip file [ERROR] 错误: 读取C:\Users\ZILI\.m2\repository\org\glassfish\jersey\containers\jersey-container-grizzly2-servlet\2.13\jersey-container-grizzly2-servlet-2.13.jar时出错; error in opening zip file [ERROR] 错误: 读取C:\Users\ZILI\.m2\repository\org\glassfish\jersey\containers\jersey-container-servlet-core\2.13\jersey-container-servlet-core-2.13.jar时出错; error in opening zip file [ERROR] 错误: 读取C:\Users\ZILI\.m2\repository\commons-io\commons-io\2.4\commons-io-2.4.jar时出错; error in opening zip file [ERROR] 错误: 读取C:\Users\ZILI\.m2\repository\org\glassfish\jersey\core\jersey-client\2.13\jersey-client-2.13.jar时出错; error in opening zip file [ERROR] 错误: 读取C:\Users\ZILI\.m2\repository\org\apache\bval\bval-jsr303\0.5\bval-jsr303-0.5.jar时出错; error in opening zip file [ERROR] 错误: 读取C:\Users\ZILI\.m2\repository\log4j\log4j\1.2.14\log4j-1.2.14.jar时出错; error in opening zip file [ERROR] 错误: 读取C:\Users\ZILI\.m2\repository\org\apache\httpcomponents\httpclient\4.1\httpclient-4.1.jar时出错; error in opening zip file [ERROR] 错误: 读取C:\Users\ZILI\.m2\repository\com\tustcs\java\base\1.0\base-1.0.jar时出错; error in opening zip file [ERROR] 错误: 读取C:\Users\ZILI\.m2\repository\org\json\json\20140107\json-20140107.jar时出错; error in opening zip file [ERROR] 11 个错误 [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException Process finished with exit code 1 ``` ```

Dynamic_cast 和强制类型转换的区别

void GameMap::Draw() { CCObject* obj = NULL; CCArray* p = m_MapsArr; CCARRAY_FOREACH(m_MapsArr,obj) { IEnvBody* envBody = dynamic_cast<IEnvBody*>(obj); envBody ->Draw(); } } 在 void HelloWorld::draw() { m_Entity ->Draw(); m_GameMap ->Draw(); } 中被调用 m_MapsArr 放入的是EnvTriangle 并且重写了父类中的Draw 类图如下 ![图片说明](https://img-ask.csdn.net/upload/201512/10/1449730339_394076.png) 为什么 IEnvBody* envBody = (IEnvBody*)(obj); 就会有 Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention. 的错误 请求指教

使用call指令调用一个dll中的函数的时候,是怎么知道要调用函数的入口地址的?

调用dll函数本质的探究,当我们使用call指令调用一个dll中的函数的时候,是怎么知道要调用函数的入口地址的?如果用调试器调试,怎么也用同样的方法获得这个地址?

由于网络问题,经常重新启动Pod

<div class="post-text" itemprop="text"> <p><strong>Description:</strong></p> <p>We have a services what running on the Google Container Engine, based on the golang library <a href="https://github.com/micro/go-micro" rel="nofollow noreferrer">go-micro</a> and these services running fine, except random restarting during the day. </p> <p><strong>Problem:</strong></p> <p>Pods is restarting pretty often during the day. This affects to our services and core services like kube-dns or nginx-ingress. After checking of the logs, it looks like a networking problem, after this docker daemon and kubelet is restarting, and takes to restart our services. It might happen 10 times per day or 2 times per day. This is not constantly. </p> <p><strong>Details:</strong></p> <p>Version:</p> <pre><code>kubectl version Client Version: version.Info{Major:"1", Minor:"5", GitVersion:"v1.5.2", GitCommit:"08e099554f3c31f6e6f07b448ab3ed78d0520507", GitTreeState:"clean", BuildDate:"2017-01-12T04:57:25Z", GoVersion:"go1.7.4", Compiler:"gc", Platform:"linux/amd64"} Server Version: version.Info{Major:"1", Minor:"5", GitVersion:"v1.5.3", GitCommit:"029c3a408176b55c30846f0faedf56aae5992e9b", GitTreeState:"clean", BuildDate:"2017-02-15T06:34:56Z", GoVersion:"go1.7.4", Compiler:"gc", Platform:"linux/amd64"} </code></pre> <p>OS:</p> <pre><code>uname -a Linux microservices-g1-small-25eedb64-w265 4.4.21+ #1 SMP Thu Nov 10 02:50:15 PST 2016 x86_64 Intel(R) Xeon(R) CPU @ 2.30GHz GenuineIntel GNU/Linux cat /etc/lsb-release CHROMEOS_AUSERVER=https://tools.google.com/service/update2 CHROMEOS_RELEASE_BOARD=lakitu-signed-mpkeys CHROMEOS_RELEASE_BRANCH_NUMBER=0 CHROMEOS_RELEASE_BUILDER_PATH=lakitu-release/R56-8977.0.0 CHROMEOS_RELEASE_BUILD_NUMBER=8977 CHROMEOS_RELEASE_BUILD_TYPE=Official Build CHROMEOS_RELEASE_CHROME_MILESTONE=56 CHROMEOS_RELEASE_DESCRIPTION=8977.0.0 (Official Build) dev-channel lakitu CHROMEOS_RELEASE_NAME=Chrome OS CHROMEOS_RELEASE_PATCH_NUMBER=0 CHROMEOS_RELEASE_TRACK=dev-channel CHROMEOS_RELEASE_VERSION=8977.0.0 DEVICETYPE=OTHER GOOGLE_RELEASE=8977.0.0 HWID_OVERRIDE=LAKITU DOGFOOD </code></pre> <p>Golang microservice framework <a href="https://github.com/micro/go-micro" rel="nofollow noreferrer">go-micro</a></p> <p>I tried to check the logs for figure out what happening and what i found:</p> <pre> rvices-g1-small-25eedb64-s0p6 update_engine[899]: [0310/064853:INFO:update_manager-inl.h(52)] ChromeOSPolicy::UpdateCheckAllowed: START Mar 10 06:53:28 gke-microservices-g1-small-25eedb64-s0p6 update_engine[899]: [0310/064908:WARNING:evaluation_context-inl.h(43)] Error reading Variable update_disabled: "No value set for update_disabled" Mar 10 06:53:28 gke-microservices-g1-small-25eedb64-s0p6 update_engine[899]: [0310/064932:WARNING:evaluation_context-inl.h(43)] Error reading Variable release_channel_delegated: "No value set for release_channel_delegated" Mar 10 06:53:28 gke-microservices-g1-small-25eedb64-s0p6 update_engine[899]: [0310/065015:INFO:chromeos_policy.cc(314)] Periodic check interval not satisfied, blocking until 3/10/2017 6:58:27 GMT Mar 10 06:53:28 gke-microservices-g1-small-25eedb64-s0p6 update_engine[899]: [0310/065025:INFO:update_manager-inl.h(74)] ChromeOSPolicy::UpdateCheckAllowed: END Mar 10 06:53:28 gke-microservices-g1-small-25eedb64-s0p6 health-monitor.sh[1435]: Docker daemon failed! Mar 10 06:53:28 gke-microservices-g1-small-25eedb64-s0p6 health-monitor.sh[1435]: Docker daemon failed! Mar 10 06:53:28 gke-microservices-g1-small-25eedb64-s0p6 health-monitor.sh[1435]: Docker daemon failed! Mar 10 06:53:28 gke-microservices-g1-small-25eedb64-s0p6 health-monitor.sh[1435]: Docker daemon failed! Mar 10 06:53:28 gke-microservices-g1-small-25eedb64-s0p6 metrics_daemon[903]: [INFO:upload_service.cc(103)] Metrics disabled. Don't upload metrics samples. Mar 10 06:53:29 gke-microservices-g1-small-25eedb64-s0p6 health-monitor.sh[1432]: okKubelet is unhealthy! Mar 10 06:53:29 gke-microservices-g1-small-25eedb64-s0p6 docker[24076]: time="2017-03-10T06:53:05.302107123Z" level=error msg="Force shutdown daemon" Mar 10 06:53:29 gke-microservices-g1-small-25eedb64-s0p6 kubelet[30078]: I0310 06:53:17.997217 30078 helpers.go:101] Unable to get network stats from pid 27012: couldn't read network stats: failure opening /proc/27012/net/d Mar 10 06:53:29 gke-microservices-g1-small-25eedb64-s0p6 kubelet[30078]: I0310 06:53:18.134978 30078 helpers.go:101] Unable to get network stats from pid 26236: couldn't read network stats: failure opening /proc/26236/net/d Mar 10 06:53:29 gke-microservices-g1-small-25eedb64-s0p6 kubelet[30078]: I0310 06:53:18.135389 30078 helpers.go:101] Unable to get network stats from pid 27581: couldn't read network stats: failure opening /proc/27581/net/d Mar 10 06:53:29 gke-microservices-g1-small-25eedb64-s0p6 kubelet[30078]: I0310 06:53:18.135801 30078 helpers.go:101] Unable to get network stats from pid 27581: couldn't read network stats: failure opening /proc/27581/net/d Mar 10 06:53:29 gke-microservices-g1-small-25eedb64-s0p6 kubelet[30078]: W0310 06:53:18.430715 30078 prober.go:98] No ref for container "docker://4a90f704319f64738915bc353515403263a60ad04d5859174b50bb47c255db12" (social-syn Mar 10 06:53:29 gke-microservices-g1-small-25eedb64-s0p6 kubelet[30078]: I0310 06:53:18.430740 30078 prober.go:106] Liveness probe for "social-sync-deployment-2745944389-rftmf_on-deploy-dev(80a79ba8-04b6-11e7-be05-42010 Mar 10 06:53:29 gke-microservices-g1-small-25eedb64-s0p6 kubelet[30078]: W0310 06:53:18.431064 30078 prober.go:98] No ref for container "docker://964f8ef2da5de63196f5ddfaec156f6b93fb05671be3dd7f2d90e4efb91cbd34" (heapster-v Mar 10 06:53:29 gke-microservices-g1-small-25eedb64-s0p6 kubelet[30078]: I0310 06:53:18.431076 30078 prober.go:106] Liveness probe for "heapster-v1.2.0.1-1382115970-l9h4q_kube-system(7f0f2677-04b6-11e7-be05-42010af00129):he Mar 10 06:53:29 gke-microservices-g1-small-25eedb64-s0p6 health-monitor.sh[1432]: % Total % Received % Xferd Average Speed Time Time Time Current Mar 10 06:53:29 gke-microservices-g1-small-25eedb64-s0p6 health-monitor.sh[1432]: Dload Upload Total Spent Left Speed Mar 10 06:53:29 gke-microservices-g1-small-25eedb64-s0p6 docker[24076]: time="2017-03-10T06:53:12Z" level=info msg="stopping containerd after receiving terminated" Mar 10 06:53:29 gke-microservices-g1-small-25eedb64-s0p6 kubelet[30078]: W0310 06:53:18.525414 30078 prober.go:98] No ref for container "docker://6fa84a9c20b7c8600048a98d06974817e85652b3b66b8c64d6390735de5bbf19" (kube-dns-4 Mar 10 06:53:29 gke-microservices-g1-small-25eedb64-s0p6 kubelet[30078]: I0310 06:53:18.525458 30078 prober.go:106] Readiness probe for "kube-dns-4101612645-bkt6z_kube-system(7f12f616-04b6-11e7-be05-42010af00129):kubedns" f Mar 10 06:53:29 gke-microservices-g1-small-25eedb64-s0p6 kubelet[30078]: E0310 06:53:18.631190 30078 generic.go:197] GenericPLEG: Unable to retrieve pods: operation timeout: context deadline exceeded Mar 10 06:53:29 gke-microservices-g1-small-25eedb64-s0p6 kubelet[30078]: E0310 06:53:18.646004 30078 container_manager_linux.go:625] error opening pid file /var/run/docker.pid: open /var/run/docker.pid: no such file or dire Mar 10 06:53:29 gke-microservices-g1-small-25eedb64-s0p6 kubelet[30078]: E0310 06:53:18.893042 30078 kubelet_pods.go:710] Error listing containers: dockertools.operationTimeout{err:context.deadlineExceededError{}} Mar 10 06:53:29 gke-microservices-g1-small-25eedb64-s0p6 kubelet[30078]: E0310 06:53:18.893091 30078 kubelet.go:1860] Failed cleaning pods: operation timeout: context deadline exceeded Mar 10 06:53:29 gke-microservices-g1-small-25eedb64-s0p6 kubelet[30078]: I0310 06:53:18.947556 30078 logs.go:41] http: TLS handshake error from 127.0.0.1:39224: EOF Mar 10 06:53:29 gke-microservices-g1-small-25eedb64-s0p6 kubelet[30078]: W0310 06:53:18.990182 30078 prober.go:98] No ref for container "docker://964f8ef2da5de63196f5ddfaec156f6b93fb05671be3dd7f2d90e4efb91cbd34" (heapster-v Mar 10 06:53:29 gke-microservices-g1-small-25eedb64-s0p6 kubelet[30078]: I0310 06:53:18.990207 30078 prober.go:106] Liveness probe for "heapster-v1.2.0.1-1382115970-l9h4q_kube-system(7f0f2677-04b6-11e7-be05-42010af00129):he Mar 10 06:53:29 gke-microservices-g1-small-25eedb64-s0p6 kubelet[30078]: W0310 06:53:18.990268 30078 prober.go:98] No ref for container "docker://4a90f704319f64738915bc353515403263a60ad04d5859174b50bb47c255db12" (social-syn Mar 10 06:53:29 gke-microservices-g1-small-25eedb64-s0p6 health-monitor.sh[1432]: [1.9K blob data] Mar 10 06:53:29 gke-microservices-g1-small-25eedb64-s0p6 docker[24076]: time="2017-03-10T06:53:13.043529322Z" level=error msg="Stop container error: Stop container d0c295d50409a171745524d6171a845fc3d29fd6db26da3fc883653fce1e4 Mar 10 06:53:29 gke-microservices-g1-small-25eedb64-s0p6 docker[24076]: time="2017-03-10T06:53:13.077975854Z" level=error msg="Stop container error: Stop container 4712afe5f084cf3163bef94ac21e3d63a5179190e73a8a0fa906a59630b80 Mar 10 06:53:29 gke-microservices-g1-small-25eedb64-s0p6 docker[24076]: time="2017-03-10T06:53:13.078034531Z" level=error msg="Stop container error: Stop container 1b18343beedfbe58403017fa532b85604c7ec2c96f15bd503747c19ac37f6 Mar 10 06:53:29 gke-microservices-g1-small-25eedb64-s0p6 docker[24076]: time="2017-03-10T06:53:13.078074791Z" level=error msg="Stop container error: Stop container 1fb54295ff5ecc734bf12c576880131cb98011cb98e37b5fa982bdd257b69 Mar 10 06:53:29 gke-microservices-g1-small-25eedb64-s0p6 docker[24076]: time="2017-03-10T06:53:13.078113450Z" level=error msg="Stop container error: Stop container b8e52eafa29a8b02263894b3d0d1371a92f1656fea981a6b9842c42b5d939 Mar 10 06:53:29 gke-microservices-g1-small-25eedb64-s0p6 docker[24076]: time="2017-03-10T06:53:13.078150890Z" level=error msg="Stop container error: Stop container 9b9021078f15bc3ea03770c0c135e978326f8e279e60e9663885218070026 Mar 10 06:53:29 gke-microservices-g1-small-25eedb64-s0p6 kubelet[30078]: I0310 06:53:18.990280 30078 prober.go:106] Liveness probe for "social-sync-deployment-2745944389-rftmf_on-deploy-dev(80a79ba8-04b6-11e7-be05-42010 Mar 10 06:53:29 gke-microservices-g1-small-25eedb64-s0p6 kubelet[30078]: E0310 06:53:19.219709 30078 eviction_manager.go:204] eviction manager: unexpected err: failed ImageStats: failed to list docker images - operation tim Mar 10 06:53:29 gke-microservices-g1-small-25eedb64-s0p6 kubelet[30078]: I0310 06:53:19.285843 30078 logs.go:41] http: TLS handshake error from 127.0.0.1:39414: write tcp 127.0.0.1:10250-&gt;127.0.0.1:39414: write: broken pipe Mar 10 06:53:29 gke-microservices-g1-small-25eedb64-s0p6 kubelet[30078]: I0310 06:53:19.400005 30078 kubelet.go:1725] skipping pod synchronization - [container runtime is down] Mar 10 06:53:29 gke-microservices-g1-small-25eedb64-s0p6 kubelet[30078]: W0310 06:53:19.400065 30078 prober.go:98] No ref for container "docker://6d63f67520d9b76446a00e1f6d81422f12f2fa93a1a9f85a656c0b49e457ba0c" (social-acc Mar 10 06:53:29 gke-microservices-g1-small-25eedb64-s0p6 kubelet[30078]: I0310 06:53:19.400079 30078 prober.go:106] Liveness probe for "social-accounts-deployment-983093656-h9frj_on-deploy-dev(8071bfd6-04b6-11e7-be05-42 Mar 10 06:53:29 gke-microservices-g1-small-25eedb64-s0p6 kubelet[30078]: W0310 06:53:19.400318 30078 prober.go:98] No ref for container "docker://963021c2befd5e53a61c16ba2f7c97446b4c045bbf92f723e3b899c4fb2cde21" (post-metri Mar 10 06:53:29 gke-microservices-g1-small-25eedb64-s0p6 kubelet[30078]: I0310 06:53:19.400333 30078 prober.go:106] Liveness probe for "post-metrics-deployment-556584274-z3p67_on-deploy-dev(7f9d4125-04b6-11e7-be05-42010 Mar 10 06:53:29 gke-microservices-g1-small-25eedb64-s0p6 kubelet[30078]: W0310 06:53:19.400476 30078 prober.go:98] No ref for container "docker://dc65f853b22eb25bdfaf1ce5bf1d0d6f48e57379caffa526f80a71b086d5247f" (notificati Mar 10 06:53:29 gke-microservices-g1-small-25eedb64-s0p6 health-monitor.sh[1432]: [1.9K blob data] Mar 10 06:53:29 gke-microservices-g1-small-25eedb64-s0p6 docker[24076]: time="2017-03-10T06:53:13.078188154Z" level=error msg="Stop container error: Stop container 8ee3de7c4dd56136b8c8a444f9b58316d190d2dad496472e233f23bf27596 Mar 10 06:53:29 gke-microservices-g1-small-25eedb64-s0p6 docker[24076]: time="2017-03-10T06:53:13.078226785Z" level=error msg="Stop container error: Stop container a9fefcd23efb7f6472b209d6e383b8050da054c3f4b1ad2c6bf531f3b1475 Mar 10 06:53:29 gke-microservices-g1-small-25eedb64-s0p6 docker[24076]: time="2017-03-10T06:53:13.078276076Z" level=error msg="Stop container error: Stop container 874fdb93aafc0a13bcbeada66f8f031cd52c01f0cec59913a49bf93917ce5 Mar 10 06:53:29 gke-microservices-g1-small-25eedb64-s0p6 docker[24076]: time="2017-03-10T06:53:13.565783448Z" level=error msg="Stop container error: Stop container 42b9b796470a3a0a345229227cb7fa223967c56ce3b8e2765c3d9a48e963c Mar 10 06:53:29 gke-microservices-g1-small-25eedb64-s0p6 docker[24076]: time="2017-03-10T06:53:13.565846865Z" level=error msg="Stop container error: Stop container add6806333a7185aa4944b9bde0c9b2be973a09e59d2b80c09e98e549b180 Mar 10 06:53:29 gke-microservices-g1-small-25eedb64-s0p6 docker[24076]: time="2017-03-10T06:53:13.565886676Z" level=error msg="Stop container error: Stop container 5631ba532f8b2a4ac262b97fabd2df07a8fe6b0202879e1347a763a5a8921 Mar 10 06:53:29 gke-microservices-g1-small-25eedb64-s0p6 kubelet[30078]: I0310 06:53:19.400485 30078 prober.go:106] Liveness probe for "notifications-deployment-3662335406-r668m_on-deploy-dev(880c38dc-0425-11e7-be05-420 </pre> <p>At every time, when it trying to update a ChromeOS, it starts to occurs docker daemon issues, networking issues etc.</p> <p>kube-proxy.log</p> <pre> I0310 06:53:17.392671 5 proxier.go:750] Deleting connection tracking state for service IP 10.3.240.10, endpoint IP 10.0.5.223 Flag --resource-container has been deprecated, This feature will be removed in a later releas e. I0310 06:54:12.615435 5 iptables.go:176] Could not connect to D-Bus system bus: dial un ix /var/run/dbus/system_bus_socket: connect: no such file or directory I0310 06:54:12.615488 5 server.go:168] setting OOM scores is unsupported in this build I0310 06:54:12.687932 5 server.go:215] Using iptables Proxier. I0310 06:54:12.690596 5 server.go:227] Tearing down userspace rules. I0310 06:54:12.690844 5 healthcheck.go:119] Initializing kube-proxy health checker I0310 06:54:12.702034 5 conntrack.go:81] Set sysctl 'net/netfilter/nf_conntrack_max' to 131072 I0310 06:54:12.702366 5 conntrack.go:66] Setting conntrack hashsize to 32768 I0310 06:54:12.702927 5 conntrack.go:81] Set sysctl 'net/netfilter/nf_conntrack_tcp_tim eout_established' to 86400 I0310 06:54:12.702951 5 conntrack.go:81] Set sysctl 'net/netfilter/nf_conntrack_tcp_tim eout_close_wait' to 3600 I0310 06:54:12.714134 5 proxier.go:802] Not syncing iptables until Services and Endpoin ts have been received from master </pre> <p>More logs:</p> <pre> g1-small-25eedb64-w265 kubelet[3344]: I0310 06:50:45.445978 3344 docker_manager.go:1975] Need to restart pod infra container for "roles-deployment-1745993421-qxf7z_on-a Mar 10 06:50:45 gke-microservices-g1-small-25eedb64-w265 kubelet[3344]: I0310 06:50:45.574227 3344 operation_executor.go:917] MountVolume.SetUp succeeded for volume "kubernetes.io/secret/e257aff1-055d-1 Mar 10 06:50:45 gke-microservices-g1-small-25eedb64-w265 kubelet[3344]: I0310 06:50:45.575943 3344 docker_manager.go:1975] Need to restart pod infra container for "social-accounts-deployment-983093656-v Mar 10 06:50:45 gke-microservices-g1-small-25eedb64-w265 kubelet[3344]: I0310 06:50:45.774316 3344 operation_executor.go:917] MountVolume.SetUp succeeded for volume "kubernetes.io/secret/e2762a4c-055d-1 Mar 10 06:50:46 gke-microservices-g1-small-25eedb64-w265 kubelet[3344]: I0310 06:50:46.056277 3344 docker_manager.go:1975] Need to restart pod infra container for "tags-srv-deployment-626769860-js4h5_on Mar 10 06:50:46 gke-microservices-g1-small-25eedb64-w265 kernel: IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready Mar 10 06:50:46 gke-microservices-g1-small-25eedb64-w265 systemd-udevd[6680]: Could not generate persistent MAC address for veth37abc82a: No such file or directory Mar 10 06:50:46 gke-microservices-g1-small-25eedb64-w265 systemd-timesyncd[570]: Network configuration changed, trying to establish connection. Mar 10 06:50:46 gke-microservices-g1-small-25eedb64-w265 kernel: IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready Mar 10 06:50:46 gke-microservices-g1-small-25eedb64-w265 kernel: device veth37abc82a entered promiscuous mode Mar 10 06:50:46 gke-microservices-g1-small-25eedb64-w265 kernel: cbr0: port 3(veth37abc82a) entered forwarding state Mar 10 06:50:46 gke-microservices-g1-small-25eedb64-w265 kernel: cbr0: port 3(veth37abc82a) entered forwarding state Mar 10 06:50:46 gke-microservices-g1-small-25eedb64-w265 systemd-timesyncd[570]: Synchronized to time server 169.254.169.254:123 (169.254.169.254). Mar 10 06:50:46 gke-microservices-g1-small-25eedb64-w265 systemd-networkd[611]: veth37abc82a: Gained carrier Mar 10 06:50:46 gke-microservices-g1-small-25eedb64-w265 systemd-timesyncd[570]: Network configuration changed, trying to establish connection. Mar 10 06:50:46 gke-microservices-g1-small-25eedb64-w265 systemd-timesyncd[570]: Synchronized to time server 169.254.169.254:123 (169.254.169.254). Mar 10 06:50:46 gke-microservices-g1-small-25eedb64-w265 kubelet[3344]: I0310 06:50:46.626937 3344 conversion.go:134] failed to handle multiple devices for container. Skipping Filesystem stats Mar 10 06:50:46 gke-microservices-g1-small-25eedb64-w265 kubelet[3344]: I0310 06:50:46.627371 3344 conversion.go:134] failed to handle multiple devices for container. Skipping Filesystem stats Mar 10 06:50:46 gke-microservices-g1-small-25eedb64-w265 kernel: IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready Mar 10 06:50:46 gke-microservices-g1-small-25eedb64-w265 systemd-timesyncd[570]: Network configuration changed, trying to establish connection. Mar 10 06:50:46 gke-microservices-g1-small-25eedb64-w265 systemd-udevd[6745]: Could not generate persistent MAC address for veth07d02159: No such file or directory Mar 10 06:50:46 gke-microservices-g1-small-25eedb64-w265 systemd-timesyncd[570]: Synchronized to time server 169.254.169.254:123 (169.254.169.254). Mar 10 06:50:46 gke-microservices-g1-small-25eedb64-w265 systemd-timesyncd[570]: Network configuration changed, trying to establish connection. Mar 10 06:50:46 gke-microservices-g1-small-25eedb64-w265 systemd-timesyncd[570]: Synchronized to time server 169.254.169.254:123 (169.254.169.254). Mar 10 06:50:46 gke-microservices-g1-small-25eedb64-w265 kernel: IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready Mar 10 06:50:46 gke-microservices-g1-small-25eedb64-w265 systemd-networkd[611]: veth07d02159: Gained carrier Mar 10 06:50:46 gke-microservices-g1-small-25eedb64-w265 systemd-timesyncd[570]: Network configuration changed, trying to establish connection. Mar 10 06:50:46 gke-microservices-g1-small-25eedb64-w265 systemd-timesyncd[570]: Synchronized to time server 169.254.169.254:123 (169.254.169.254). Mar 10 06:50:46 gke-microservices-g1-small-25eedb64-w265 kernel: device veth07d02159 entered promiscuous mode Mar 10 06:50:46 gke-microservices-g1-small-25eedb64-w265 kernel: cbr0: port 12(veth07d02159) entered forwarding state Mar 10 06:50:46 gke-microservices-g1-small-25eedb64-w265 kernel: cbr0: port 12(veth07d02159) entered forwarding state Mar 10 06:50:46 gke-microservices-g1-small-25eedb64-w265 kernel: IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready Mar 10 06:50:46 gke-microservices-g1-small-25eedb64-w265 systemd-udevd[6771]: Could not generate persistent MAC address for veth2b02253d: No such file or directory Mar 10 06:50:46 gke-microservices-g1-small-25eedb64-w265 systemd-timesyncd[570]: Network configuration changed, trying to establish connection. Mar 10 06:50:46 gke-microservices-g1-small-25eedb64-w265 systemd-timesyncd[570]: Synchronized to time server 169.254.169.254:123 (169.254.169.254). Mar 10 06:50:46 gke-microservices-g1-small-25eedb64-w265 systemd-timesyncd[570]: Network configuration changed, trying to establish connection. Mar 10 06:50:46 gke-microservices-g1-small-25eedb64-w265 systemd-timesyncd[570]: Synchronized to time server 169.254.169.254:123 (169.254.169.254). Mar 10 06:50:46 gke-microservices-g1-small-25eedb64-w265 kernel: IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready Mar 10 06:50:46 gke-microservices-g1-small-25eedb64-w265 systemd-networkd[611]: veth2b02253d: Gained carrier Mar 10 06:50:46 gke-microservices-g1-small-25eedb64-w265 systemd-timesyncd[570]: Network configuration changed, trying to establish connection. Mar 10 06:50:46 gke-microservices-g1-small-25eedb64-w265 systemd-timesyncd[570]: Synchronized to time server 169.254.169.254:123 (169.254.169.254). Mar 10 06:50:46 gke-microservices-g1-small-25eedb64-w265 kernel: device veth2b02253d entered promiscuous mode Mar 10 06:50:46 gke-microservices-g1-small-25eedb64-w265 kernel: cbr0: port 23(veth2b02253d) entered forwarding state Mar 10 06:50:46 gke-microservices-g1-small-25eedb64-w265 kernel: cbr0: port 23(veth2b02253d) entered forwarding state Mar 10 06:50:46 gke-microservices-g1-small-25eedb64-w265 kernel: IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready Mar 10 06:50:46 gke-microservices-g1-small-25eedb64-w265 systemd-timesyncd[570]: Network configuration changed, trying to establish connection. Mar 10 06:50:46 gke-microservices-g1-small-25eedb64-w265 systemd-udevd[6796]: Could not generate persistent MAC address for veth55143c6b: No such file or directory Mar 10 06:50:46 gke-microservices-g1-small-25eedb64-w265 systemd-timesyncd[570]: Synchronized to time server 169.254.169.254:123 (169.254.169.254). Mar 10 06:50:46 gke-microservices-g1-small-25eedb64-w265 systemd-timesyncd[570]: Network configuration changed, trying to establish connection. Mar 10 06:50:46 gke-microservices-g1-small-25eedb64-w265 systemd-timesyncd[570]: Synchronized to time server 169.254.169.254:123 (169.254.169.254). Mar 10 06:50:46 gke-microservices-g1-small-25eedb64-w265 kernel: IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready Mar 10 06:50:46 gke-microservices-g1-small-25eedb64-w265 systemd-timesyncd[570]: Network configuration changed, trying to establish connection. Mar 10 06:50:46 gke-microservices-g1-small-25eedb64-w265 systemd-networkd[611]: veth55143c6b: Gained carrier Mar 10 06:50:46 gke-microservices-g1-small-25eedb64-w265 systemd-timesyncd[570]: Synchronized to time server 169.254.169.254:123 (169.254.169.254). Mar 10 06:50:46 gke-microservices-g1-small-25eedb64-w265 kernel: device veth55143c6b entered promiscuous mode Mar 10 06:50:46 gke-microservices-g1-small-25eedb64-w265 kernel: cbr0: port 30(veth55143c6b) entered forwarding state Mar 10 06:50:46 gke-microservices-g1-small-25eedb64-w265 kernel: cbr0: port 30(veth55143c6b) entered forwarding state Mar 10 06:50:46 gke-microservices-g1-small-25eedb64-w265 kernel: IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready Mar 10 06:50:46 gke-microservices-g1-small-25eedb64-w265 systemd-timesyncd[570]: Network configuration changed, trying to establish connection. Mar 10 06:50:46 gke-microservices-g1-small-25eedb64-w265 systemd-udevd[6821]: Could not generate persistent MAC address for vethe38b8eee: No such file or directory Mar 10 06:50:46 gke-microservices-g1-small-25eedb64-w265 systemd-timesyncd[570]: Synchronized to time server 169.254.169.254:123 (169.254.169.254). Mar 10 06:50:46 gke-microservices-g1-small-25eedb64-w265 systemd-timesyncd[570]: Network configuration changed, trying to establish connection. Mar 10 06:50:46 gke-microservices-g1-small-25eedb64-w265 systemd-timesyncd[570]: Synchronized to time server 169.254.169.254:123 (169.254.169.254). Mar 10 06:50:47 gke-microservices-g1-small-25eedb64-w265 kernel: IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready Mar 10 06:50:47 gke-microservices-g1-small-25eedb64-w265 systemd-networkd[611]: vethe38b8eee: Gained carrier Mar 10 06:50:47 gke-microservices-g1-small-25eedb64-w265 systemd-timesyncd[570]: Network configuration changed, trying to establish connection. Mar 10 06:50:47 gke-microservices-g1-small-25eedb64-w265 systemd-timesyncd[570]: Synchronized to time server 169.254.169.254:123 (169.254.169.254). Mar 10 06:50:47 gke-microservices-g1-small-25eedb64-w265 kernel: device vethe38b8eee entered promiscuous mode Mar 10 06:50:47 gke-microservices-g1-small-25eedb64-w265 kernel: cbr0: port 31(vethe38b8eee) entered forwarding state Mar 10 06:50:47 gke-microservices-g1-small-25eedb64-w265 kernel: cbr0: port 31(vethe38b8eee) entered forwarding state Mar 10 06:50:47 gke-microservices-g1-small-25eedb64-w265 kubelet[3344]: I0310 06:50:47.113442 3344 docker_manager.go:2236] Determined pod ip after infra change: "roles-deployment-1745993421-qxf7z Mar 10 06:50:47 gke-microservices-g1-small-25eedb64-w265 kubelet[3344]: I0310 06:50:47.115417 3344 kubelet.go:1816] SyncLoop (PLEG): "social-accounts-deployment-983093656-vh2xt-deploy-dev(e257aff Mar 10 06:50:47 gke-microservices-g1-small-25eedb64-w265 docker[3264]: time="2017-03-10T06:50:47.118506356Z" level=error msg="Handler for GET /v1.23/images/b.gcr.io-container-registry/microservice Mar 10 06:50:47 gke-microservices-g1-small-25eedb64-w265 kubelet[3344]: I0310 06:50:47.194220 3344 provider.go:119] Refreshing cache for provider: *gcp_credentials.dockerConfigKeyProvider Mar 10 06:50:47 gke-microservices-g1-small-25eedb64-w265 kernel: IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready Mar 10 06:50:47 gke-microservices-g1-small-25eedb64-w265 systemd-udevd[6847]: Could not generate persistent MAC address for veth2228e3ba: No such file or directory Mar 10 06:50:47 gke-microservices-g1-small-25eedb64-w265 systemd-timesyncd[570]: Network configuration changed, trying to establish connection. Mar 10 06:50:47 gke-microservices-g1-small-25eedb64-w265 systemd-timesyncd[570]: Synchronized to time server 169.254.169.254:123 (169.254.169.254). Mar 10 06:50:47 gke-microservices-g1-small-25eedb64-w265 systemd-timesyncd[570]: Network configuration changed, trying to establish connection. Mar 10 06:50:47 gke-microservices-g1-small-25eedb64-w265 systemd-timesyncd[570]: Synchronized to time server 169.254.169.254:123 (169.254.169.254). </pre> <p><strong>Question:</strong> This is possible to avoid/reduce amount of restarts and solve networking issues to make our system more stable?</p> </div>

VC++、DLL、虚函数、调用约定

关于“VC++、DLL、虚函数、调用约定”的一个问题折腾我很久了,希望CSDN的朋友可以助我解决问题。 DLL里,接口类的虚函数(非纯虚函数),应该怎样调用约定? --------------------------------------------------- 背景描述: 一个DLL工程A(接口),有个接口类AI,里面全是纯虚函数。 一个EXE工程B(平台),有个成员变量mc类型是类AI。 一个DLL工程C(游戏),有个类是类AI的子类,即实现类,对类AI的所有接口(纯虚函数)进行了实现。 原理是: 平台只有一个在跑,而游戏是N个,工程B(平台)的mc被赋值成工程C(游戏)的对象,通过工程A的接口,mc可以调用工程C(游戏)里的函数(接口的实现)。 问题: 我在开发一个新游戏时,发现工程A(接口)类AI的接口不够用,想新增一个接口,于是加入了一个”虚函数“,注意不是“纯虚函数”,为的是不影响之前所有已有的游戏(不然之前的游戏不作任何改动而编译 会报error C2259: 不能实例化抽象类),即之前的游戏不用实现这个接口,修改工程B(平台)调用这个函数时是工程A(接口)新增的接口,若游戏实现这个接口,就调用游戏里的实现函数;若游戏没有定义这个接口(之前的游戏),则调用工程A(接口)类AI里的虚函数(里面只有一句调试打印)。 但发现,有的游戏是正常的,有的游戏不正常。不正常的游戏,调试工程B(平台)在调用新接口时提示: Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention. 百度了一下,很多人说是调名约定的问题。 工程A、工程B、所有的游戏工程C,工程选项里都是 __cdecl (/Gd)。 于是我在工程A、工程C里下面几种尝试: virtual void OnEventABC(int a, bool b); //没写调用约定,有的游戏正常,有的游戏出错 virtual void __stdcall OnEventABC(int a, bool b); //所有的游戏都出错 virtual void __cdecl OnEventABC(int a, bool b); //所有的游戏都出错 virtual void WINAPI OnEventABC(int a, bool b); //所有的游戏都出错 --------------------------------------------------- 请问大家,怎么解决这个问题,是调名约定的问题,还是其它什么问题?

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

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

删库了,我们一定要跑路吗?

在工作中,我们误删数据或者数据库,我们一定需要跑路吗?我看未必,程序员一定要学会自救,神不知鬼不觉的将数据找回。 在 mysql 数据库中,我们知道 binlog 日志记录了我们对数据库的所有操作,所以 binlog 日志就是我们自救的利器。 接下来就来开启程序员自救之路。 想要自救成功,binlog 这把利器一定要好,在自己之前,我们一定要确定我们有 binlog 这把利器,以下就是确保有 bi...

再不跳槽,应届毕业生拿的都比我多了!

跳槽几乎是每个人职业生涯的一部分,很多HR说“三年两跳”已经是一个跳槽频繁与否的阈值了,可为什么市面上有很多程序员不到一年就跳槽呢?他们不担心影响履历吗? PayScale之前发布的**《员工最短任期公司排行榜》中,两家码农大厂Amazon和Google**,以1年和1.1年的员工任期中位数分列第二、第四名。 PayScale:员工最短任期公司排行榜 意外的是,任期中位数极小的这两家公司,薪资...

我以为我学懂了数据结构,直到看了这个导图才发现,我错了

数据结构与算法思维导图

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

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

华为初面+综合面试(Java技术面)附上面试题

华为面试整体流程大致分为笔试,性格测试,面试,综合面试,回学校等结果。笔试来说,华为的难度较中等,选择题难度和网易腾讯差不多。最后的代码题,相比下来就简单很多,一共3道题目,前2题很容易就AC,题目已经记不太清楚,不过难度确实不大。最后一题最后提交的代码过了75%的样例,一直没有发现剩下的25%可能存在什么坑。 笔试部分太久远,我就不怎么回忆了。直接将面试。 面试 如果说腾讯的面试是挥金如土...

和黑客斗争的 6 天!

互联网公司工作,很难避免不和黑客们打交道,我呆过的两家互联网公司,几乎每月每天每分钟都有黑客在公司网站上扫描。有的是寻找 Sql 注入的缺口,有的是寻找线上服务器可能存在的漏洞,大部分都...

讲一个程序员如何副业月赚三万的真实故事

loonggg读完需要3分钟速读仅需 1 分钟大家好,我是你们的校长。我之前讲过,这年头,只要肯动脑,肯行动,程序员凭借自己的技术,赚钱的方式还是有很多种的。仅仅靠在公司出卖自己的劳动时...

上班一个月,后悔当初着急入职的选择了

最近有个老铁,告诉我说,上班一个月,后悔当初着急入职现在公司了。他之前在美图做手机研发,今年美图那边今年也有一波组织优化调整,他是其中一个,在协商离职后,当时捉急找工作上班,因为有房贷供着,不能没有收入来源。所以匆忙选了一家公司,实际上是一个大型外包公司,主要派遣给其他手机厂商做外包项目。**当时承诺待遇还不错,所以就立马入职去上班了。但是后面入职后,发现薪酬待遇这块并不是HR所说那样,那个HR自...

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

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

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

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

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

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

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

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

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

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

外包程序员的幸福生活

今天给你们讲述一个外包程序员的幸福生活。男主是Z哥,不是在外包公司上班的那种,是一名自由职业者,接外包项目自己干。接下来讲的都是真人真事。 先给大家介绍一下男主,Z哥,老程序员,是我十多年前的老同事,技术大牛,当过CTO,也创过业。因为我俩都爱好喝酒、踢球,再加上住的距离不算远,所以一直也断断续续的联系着,我对Z哥的状况也有大概了解。 Z哥几年前创业失败,后来他开始干起了外包,利用自己的技术能...

现代的 “Hello, World”,可不仅仅是几行代码而已

作者 |Charles R. Martin译者 | 弯月,责编 | 夕颜头图 |付费下载自视觉中国出品 | CSDN(ID:CSDNnews)新手...

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

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

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

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

HTTP与HTTPS的区别

面试官问HTTP与HTTPS的区别,我这样回答让他竖起大拇指!

程序员毕业去大公司好还是小公司好?

虽然大公司并不是人人都能进,但我仍建议还未毕业的同学,尽力地通过校招向大公司挤,但凡挤进去,你这一生会容易很多。 大公司哪里好?没能进大公司怎么办?答案都在这里了,记得帮我点赞哦。 目录: 技术氛围 内部晋升与跳槽 啥也没学会,公司倒闭了? 不同的人脉圈,注定会有不同的结果 没能去大厂怎么办? 一、技术氛围 纵观整个程序员技术领域,哪个在行业有所名气的大牛,不是在大厂? 而且众所...

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

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

程序员为什么千万不要瞎努力?

本文作者用对比非常鲜明的两个开发团队的故事,讲解了敏捷开发之道 —— 如果你的团队缺乏统一标准的环境,那么即使勤劳努力,不仅会极其耗时而且成果甚微,使用...

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

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

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

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

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

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

终于懂了TCP和UDP协议区别

终于懂了TCP和UDP协议区别

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

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

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

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

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

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

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

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

立即提问
相关内容推荐