Strange Program Termination
I can leave my server running for hours and it runs just fine sending packets between clients and server. However, if the server computer (this one) goes on to certain websites then the program gets shutdown. I get that little "Send Error To Microsoft" box which I think comes from something embedded on the websites I am viewing and when I look, my server has stopped.
Now in a real simulation in a perfect world, the server would do nothing other than run this program. It would not be used for web browsing and such so I am not really worried about the idea. It would however be nice to know what''s happening in order to make an attempt to correct it.
I''m sending on port 7900 and receiving on port 7901. Different sockets for sending and receiving. This only occurrs when I visit certain websites (namely ones with popups). I have a popup blocker but something is also causing my server to go down as well.
Anyone else ever have this happen?
Webby
Just kept refreshing Gamedev until I got one of the errors to occurr. The errors seem to be originating from the random banners. Some in particular cause this error (at least they are present when the error occcurs). I''ll not name names but here is the error box I get when it happens.
"Server.exe has encountered a problem and needs to close. We are sorry for the inconvenience.
If you were in the middle of something, the information you were working on might be lost.
Please tell Microsoft about this problem." yada yada yada
Debug Send Error Report Don''t Send
Of course I always click Don''t Send but I need to figure out what and why it is causing my server to go kaput.
If I don''t use the computer for anything else then it will run indefinitely. Indefinitely so far has been for 36 hours at which time I had to browse for something and then kaput![](wink.gif)
Anyone know what might be happening here?
Thanks,
Webby
"Server.exe has encountered a problem and needs to close. We are sorry for the inconvenience.
If you were in the middle of something, the information you were working on might be lost.
Please tell Microsoft about this problem." yada yada yada
Debug Send Error Report Don''t Send
Of course I always click Don''t Send but I need to figure out what and why it is causing my server to go kaput.
If I don''t use the computer for anything else then it will run indefinitely. Indefinitely so far has been for 36 hours at which time I had to browse for something and then kaput
![](wink.gif)
Anyone know what might be happening here?
Thanks,
Webby
It seems that when the shutdown occurrs, clicking the Debug button on that menu points to this line in my program
tempPacket->SendOn(iSendSocket);
For now, the program is only sending one type of packet "PacGeneric"
What is specifically being sent over is a structure containing
struct S
{
int iType;
int iPacketNumber;
}sInfo;
Here''s the code
Again, it only errors out when I view pages with certain popups.
Any clues here?
WindowsXP Platform. Winsock (of course).
Thanks,
Webby
tempPacket->SendOn(iSendSocket);
For now, the program is only sending one type of packet "PacGeneric"
What is specifically being sent over is a structure containing
struct S
{
int iType;
int iPacketNumber;
}sInfo;
Here''s the code
virtual void SendOn(int socket){ struct sockaddr_in toAddress; toAddress.sin_family = AF_INET; toAddress.sin_port = htons(iToPort); toAddress.sin_addr.s_addr = inet_addr(sToIPAddress.c_str()); memset(&(toAddress.sin_zero), ''\0'', 8); int iBytesSent = 0; int iSize = this->SizeOfData(); char* cpsInfo = (char*)&sInfo iBytesSent = sendto(socket, cpsInfo, iSize, 0, (struct sockaddr*)&toAddress, sizeof(toAddress)); }
Again, it only errors out when I view pages with certain popups.
Any clues here?
WindowsXP Platform. Winsock (of course).
Thanks,
Webby
> WindowsXP Platform
Could it be this is an upgraded machine (from Win2K or NT4) and you didn''t upgrade IE (now 6 SP1), Macromedia''s Flash and Shockwave players in a little while... Just a guess.
-cb
Could it be this is an upgraded machine (from Win2K or NT4) and you didn''t upgrade IE (now 6 SP1), Macromedia''s Flash and Shockwave players in a little while... Just a guess.
-cb
Once, using Photoshop for more than 10 minutes used to break my network card, I had to exit photoshop for like 5 minutes then it worked again (until I started photoshop of course).
How do you explain that one? ;p
How do you explain that one? ;p
OK well cb I updated what I could. This was an upgrade from ME to XP but I did a complete format and install of it back in May when I upgraded. I just checked, there were no updates for IE, or Flash but there was an update for Shockwave.
I was writing to say that everything appeared to be fine now but just as I was starting this sentence I got that error and the server terminated.
Not at all sure what this could be now. As I type I am waiting for it to terminate again so I can once again look at the Debug Report. The only banner on this page is at the very top and it was loaded already... Edging up on 8000 packets serviced so far and still going... Will keep you posted but right now I am completely clueless.
Webby
I was writing to say that everything appeared to be fine now but just as I was starting this sentence I got that error and the server terminated.
Not at all sure what this could be now. As I type I am waiting for it to terminate again so I can once again look at the Debug Report. The only banner on this page is at the very top and it was loaded already... Edging up on 8000 packets serviced so far and still going... Will keep you posted but right now I am completely clueless.
Webby
> using Photoshop {...}
I had numerous problems with Adobe products in general. It appears that Adobe is convinced it can outsmart graphics card manufacturers and talk to the chips directly. Apparently, they found a way to hijack INT5 and monitor screen refreshes so that they can "have absolute control over visual quality" ... *cough* B.S. *cough*. It so happens that INT5 is also shared with numerous network cards so they cease working because the OS isn't notified of events anymore.
> I am completely clueless
This is my only remaining trump card, as I am as clueless as you are: you have setup a 'PowerUser' account on your machine so that you can use VC6/VC.NET and you are also using other tools (IE) and your server under the same account. 'PowerUser' accounts have almost the same level of priviledges as 'Administrator' when it comes to installing software and poking around networking security (such as overriding an already opened port **of the same account**). If you have designed your server as an NT service rather than an executable that starts at logon, then you could make it 'Run As..' another user with different priviledges. Also, check if you could use a different port range; 7900 is within the 'assigned' range of ports.
-cb
[edited by - cbenoi1 on August 26, 2003 9:40:49 AM]
I had numerous problems with Adobe products in general. It appears that Adobe is convinced it can outsmart graphics card manufacturers and talk to the chips directly. Apparently, they found a way to hijack INT5 and monitor screen refreshes so that they can "have absolute control over visual quality" ... *cough* B.S. *cough*. It so happens that INT5 is also shared with numerous network cards so they cease working because the OS isn't notified of events anymore.
> I am completely clueless
This is my only remaining trump card, as I am as clueless as you are: you have setup a 'PowerUser' account on your machine so that you can use VC6/VC.NET and you are also using other tools (IE) and your server under the same account. 'PowerUser' accounts have almost the same level of priviledges as 'Administrator' when it comes to installing software and poking around networking security (such as overriding an already opened port **of the same account**). If you have designed your server as an NT service rather than an executable that starts at logon, then you could make it 'Run As..' another user with different priviledges. Also, check if you could use a different port range; 7900 is within the 'assigned' range of ports.
-cb
[edited by - cbenoi1 on August 26, 2003 9:40:49 AM]
Getting an Unhandled Exception...Access Violation in my program just before the other error box pops up. It''s pointing to the same old line (where I cann the packets virtual SendOn() function).
I''ve looked the code over and over and can''t see the problem.
I put some additional stubs in the program and I"m finding that some packets coming in are not the correct type. At least a check of
if (packetType != PACKET_GENERIC)
cout << "BAD PACKET TYPE"; will fire.
However, keeping a log of every packet that gets sent and recieved I am getting a 1/1 ratio and only the packets I specifically send are getting logged as outgoing and then as incoming. Something elsewhere is firing the invalid packet message.
AFAIK these ports are open until I run my program on them.
The layout is as such.
Main program pushes a packet onto a queue.
Sending thread pops a packet from the queue and calls it''s SendOn() function.
Then if there is something on the received queue, the main program pops is and prints out it''s number. Packets consist of nothing more than a type and an ID for now.
Another thread set to non blocking using select is doing all of the receives. So far all packets are arriving in order and the correct memory and info is being sent. Something somewhere however is causing it to kill over dead at random times.
I find that if I have the server print to the screen the number of every incoming packet as it''s processed then the program dies faster than if it doesn''t. In fact, if I turn off the cout statement I cann''t get it to die at all unless I intentionally shut it down.
It''s all really frustrating.
Webby
I''ve looked the code over and over and can''t see the problem.
I put some additional stubs in the program and I"m finding that some packets coming in are not the correct type. At least a check of
if (packetType != PACKET_GENERIC)
cout << "BAD PACKET TYPE"; will fire.
However, keeping a log of every packet that gets sent and recieved I am getting a 1/1 ratio and only the packets I specifically send are getting logged as outgoing and then as incoming. Something elsewhere is firing the invalid packet message.
AFAIK these ports are open until I run my program on them.
The layout is as such.
Main program pushes a packet onto a queue.
Sending thread pops a packet from the queue and calls it''s SendOn() function.
Then if there is something on the received queue, the main program pops is and prints out it''s number. Packets consist of nothing more than a type and an ID for now.
Another thread set to non blocking using select is doing all of the receives. So far all packets are arriving in order and the correct memory and info is being sent. Something somewhere however is causing it to kill over dead at random times.
I find that if I have the server print to the screen the number of every incoming packet as it''s processed then the program dies faster than if it doesn''t. In fact, if I turn off the cout statement I cann''t get it to die at all unless I intentionally shut it down.
It''s all really frustrating.
Webby
Still going as long as I don''t print out the packet numbers.
Here''s a thought.
I am currently using critical sections and maybe my knowledge of them is flawed.
Right now I am doing something similar to this.
//GLOBAL
int someInt;
//THREAD1
EnterCriticalSection(&cs111);
someInt = 5;
LeaveCriticalSection(&cs111);
//THREAD2
EnterCriticalSection(&cs222);
someInt = 6;
LeaveCriticalSection(&cs222);
My understanding is that the someInt variable would be locked after a call to EnterCriticalSection but maybe this is not the case because maybe Having 2 different Critical Sections surrounding the same memory will not block each other out?
So what could be happening is that both threads are still having access to someInt even though another thread might have a different CS around it?
Only thing I can see ATM.
Server is still running even though I''m searching pages that usually cause it to crash. If I give the command to start printing the packet numbers I bet it goes kaput.
LOL Just tried it. After only a couple thousand print statements the program poofed and the last line printed was
"0 Some Other Packet Received" which is what I print if the type of packet is not PACK_GENERIC.
I''m gonna go pull my hair out now.
Webby
Here''s a thought.
I am currently using critical sections and maybe my knowledge of them is flawed.
Right now I am doing something similar to this.
//GLOBAL
int someInt;
//THREAD1
EnterCriticalSection(&cs111);
someInt = 5;
LeaveCriticalSection(&cs111);
//THREAD2
EnterCriticalSection(&cs222);
someInt = 6;
LeaveCriticalSection(&cs222);
My understanding is that the someInt variable would be locked after a call to EnterCriticalSection but maybe this is not the case because maybe Having 2 different Critical Sections surrounding the same memory will not block each other out?
So what could be happening is that both threads are still having access to someInt even though another thread might have a different CS around it?
Only thing I can see ATM.
Server is still running even though I''m searching pages that usually cause it to crash. If I give the command to start printing the packet numbers I bet it goes kaput.
LOL Just tried it. After only a couple thousand print statements the program poofed and the last line printed was
"0 Some Other Packet Received" which is what I print if the type of packet is not PACK_GENERIC.
I''m gonna go pull my hair out now.
Webby
AHAA!
It seems like outside pages are somehow getting their packets into my code.
I switched over to only a single critical section being used to coordinate between each thread and the queue it abuses
Instead of a different critical section depending on the job. The result is that now I can''t get the program to crash by browsing the web. A good thing.
So I have a single critical section used both in the thread calling recieve and pushing the packet onto the recvQueue and the same CS around a function that pops a packet from the recvQueue. I''m Sleep(1) on the recv thread to force it to halt after every packet is received.
Similar stuff going on with Sending Thread and function to push packet onto SendQueue. So now I am down to only 2 Crit Secs each for a very specific and completely unrelated tasks and it''s working nicely.
This has allowed me to notice something else.
If the packet received is of type PAC_GENERIC then I print it''s number.
If it''s not then I print out
"0 UNRECOGNIZED PACKET"
I am seeing this message quite a lot but it is not crashing the program because I simply ignore the packet by deleting whatever it contained.
However, if I load a page with an animated banner then I see one of thse messages for every time the banner starts a new animation. Likewise, if I drag the application window around the screen (covering and uncovering other webpages) then I get the message each time a page is covered and uncovered presumably because IE is requesting the page to be refreshed thereby causing the banners to retransmit packets telling it what frame is being displayed.
Question now is, how in the world to stop these other pages from leaking into mine. I thought all HTTP requests were sent to a certain port (in the 60s?).
I''m sending and receiving on 192.168.000.001 (local network address) and now using ports 5501 and 5500.
Any ideas here?
TIA
Webby
PS Over 2 million packets serviced so far since the last kaput. It''s coming along nicely but man these errors are hard to track down.
It seems like outside pages are somehow getting their packets into my code.
I switched over to only a single critical section being used to coordinate between each thread and the queue it abuses
![](smile.gif)
So I have a single critical section used both in the thread calling recieve and pushing the packet onto the recvQueue and the same CS around a function that pops a packet from the recvQueue. I''m Sleep(1) on the recv thread to force it to halt after every packet is received.
Similar stuff going on with Sending Thread and function to push packet onto SendQueue. So now I am down to only 2 Crit Secs each for a very specific and completely unrelated tasks and it''s working nicely.
This has allowed me to notice something else.
If the packet received is of type PAC_GENERIC then I print it''s number.
If it''s not then I print out
"0 UNRECOGNIZED PACKET"
I am seeing this message quite a lot but it is not crashing the program because I simply ignore the packet by deleting whatever it contained.
However, if I load a page with an animated banner then I see one of thse messages for every time the banner starts a new animation. Likewise, if I drag the application window around the screen (covering and uncovering other webpages) then I get the message each time a page is covered and uncovered presumably because IE is requesting the page to be refreshed thereby causing the banners to retransmit packets telling it what frame is being displayed.
Question now is, how in the world to stop these other pages from leaking into mine. I thought all HTTP requests were sent to a certain port (in the 60s?).
I''m sending and receiving on 192.168.000.001 (local network address) and now using ports 5501 and 5500.
Any ideas here?
TIA
Webby
PS Over 2 million packets serviced so far since the last kaput. It''s coming along nicely but man these errors are hard to track down.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement