简体   繁体   English

在Windows XP中多次启动程序和DLL有问题吗?

[英]Problems with starting a program + DLL multiple times in Windows XP?

We develop a network library that uses TCP and UDP sockets. 我们开发了一个使用TCP和UDP套接字的网络库。 This DLL is used by a testclient, which is started multiple times at the same PC for a load test. 该DLL由testclient使用,它在同一台PC上多次启动以进行负载测试。

In Windows Vista, it is no problem to start the testclient many times. 在Windows Vista中,多次启动testclient没问题。 In Windows XP, starting it up to 5 times is no problem, but if we start it 6 times or more, and then closing one client, ALL of them crash with apparently random stack traces. 在Windows XP中,将其启动最多5次是没有问题的,但是如果我们将其启动6次或更多次,然后关闭一个客户端,则所有这些都将崩溃,并且显然带有随机堆栈跟踪。

Yes, although we do not use any interprocess code (only sockets between the clients), the termination of one of the client leads to the crash of all of them. 是的,尽管我们不使用任何进程间代码(仅使用客户端之间的套接字),但其中一个客户端的终止会导致所有这些客户端的崩溃。

Our DLL is compiled with MSVC and uses Boost and Crypto++ libs (statically linked). 我们的DLL是使用MSVC编译的,并使用Boost和Crypto ++库(静态链接)。

Any idea why the different processes could influence each other? 知道为什么不同的过程会相互影响吗?

We'll need a little bit more data in order to diagnose your problem. 我们将需要更多数据才能诊断您的问题。 However considering that shutting down one client crashes all of the clients, you need to consider all the ways in which the clients can affect each other (inter process communication). 但是,考虑到关闭一个客户端会使所有客户端崩溃,您需要考虑客户端相互影响的所有方式(进程间通信)。 Either implicitly or explicitly. 隐式或显式地。 So I would start by looking at 所以我先来看

  • What does the server do when the 6th client is closed. 当第六个客户端关闭时,服务器将执行什么操作。 Does it send out a special packet that the other 5 clients just can't handle? 它是否发送其他五个客户端无法处理的特殊数据包?
  • Are you reading or writing anything to the file system? 您正在向文件系统读取或写入任何内容吗?
  • Do you use shared memory? 您是否使用共享内存?

In general though, I've found that having a seemingly random stack trace in C++ is usually caused by one of the following 虽然总的来说,我发现在C ++中看似随机的堆栈跟踪通常是由以下原因之一引起的

  • Data Corruption 数据损坏
  • Race Condition in the threading logic. 线程逻辑中的竞争条件。

An idea: You have some bug. 一个想法:您有一些错误。

Seriously, there is no way to know what's your problem without any information what so ever. 认真地说,如果没有任何信息,就无法知道您的问题所在。
When a process crashes it usually has a very good reason to do so. 当进程崩溃时,通常有很好的理由这样做。 find out what that is. 找出那是什么。 Compile your dlls and executables in debug, attach a debugger and make sense of the stack trace you get. 在调试中编译您的dll和可执行文件,附加一个调试器并使您获得的堆栈跟踪有意义。 if you get a nonsense stack trace, find out why that is. 如果您得到一个废话堆栈跟踪,找出原因。

As with many problems, this one is likely to be solved by "Just debugging it" 与许多问题一样,这一问题很可能可以通过“仅调试它”来解决

Modification of the DLL or locking the DLL may cause programs that depend on it to crash. DLL的修改或锁定DLL可能导致依赖于它的程序崩溃。 Typically, changes to the DLL will be locked by the file system but it could be possible that in your application, you are doing something out of the ordinary. 通常,对DLL的更改将由文件系统锁定,但是在您的应用程序中,您可能会做一些不寻常的事情。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM