BIND error after crash: how to reset winsock ?

  • Permalink
  • submit to reddit
  • Email
  • Follow


Hello, I have a common problem, after my program crash without
cleaningup winsock correctly I can't bind anymore on the same port,
the only way I found is to restat my windows session.
I tried using SO_REUSEADDR but it just make the bind error hidding not
allowing the communication anymore.

Then as it don't seems to be a material problem (I tried
uninstalling / reinstalling my network card and still can't bind) I
would like to know how to reset the windows component handling the
bind fonction, in other words I would like to reset winsock.

Thanks
0
Reply Greg2fs 4/12/2010 6:48:17 AM

See related articles to this posting


Greg2fs wrote:
> Hello, I have a common problem, after my program crash without
> cleaningup winsock correctly I can't bind anymore on the same port,
> the only way I found is to restat my windows session.
> I tried using SO_REUSEADDR but it just make the bind error hidding not
> allowing the communication anymore.
> 
> Then as it don't seems to be a material problem (I tried
> uninstalling / reinstalling my network card and still can't bind) I
> would like to know how to reset the windows component handling the
> bind fonction, in other words I would like to reset winsock.

That's the wrong solution. The right solution is to find out why your 
program is crashing, and fix it so that it doesn't crash any more.

-- 
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
"Usenet is a strange place" - dmr 29 July 1999
Sig line vacant - apply within
0
Reply Richard 4/12/2010 6:50:23 AM

On Apr 11, 11:48=A0pm, Greg2fs <greg...@gmail.com> wrote:

> Hello, I have a common problem, after my program crash without
> cleaningup winsock correctly I can't bind anymore on the same port,

What happens when you try?

> the only way I found is to restat my windows session.
> I tried using SO_REUSEADDR but it just make the bind error hidding not
> allowing the communication anymore.

What bind error?

> Then as it don't seems to be a material problem (I tried
> uninstalling / reinstalling my network card and still can't bind) I
> would like to know how to reset the windows component handling the
> bind fonction, in other words I would like to reset winsock.

You forgot to describe your problem. Does some Winsock function return
an error? If so, what function and what error? Or do the functions
succeed and then something doesn't happen? If so, what?

DS
0
Reply David 4/12/2010 8:01:46 AM

On Apr 12, 7:50=A0am, Richard Heathfield <r...@see.sig.invalid> wrote:

> That's the wrong solution. The right solution is to find out why your
> program is crashing, and fix it so that it doesn't crash any more.

Of course he should be investigating the crashes but he'll be able to
do that a lot quicker if he doesn't have to restart his machine after
each crash. :)
0
Reply Leo 4/12/2010 8:18:59 AM

Greg2fs wrote:
> Hello, I have a common problem, after my program crash without
> cleaningup winsock correctly I can't bind anymore on the same port,
> the only way I found is to restat my windows session.
> I tried using SO_REUSEADDR but it just make the bind error hidding not
> allowing the communication anymore.

The reason for that is probably that the socket is still considered in use,
which is also why you can patch it partially by using SO_REUSEADDR. There
are two reasons that could be the case:
1. The program is actually still running. A crash can mean pretty much
anything, it doesn't have to be the executable being terminated, which
would normally clean up the resources.
2. The timeout for the socket hasn't elapsed yet. I think that without
properly shutting down, it can take a minute until the port can be bound
again.

Uli

-- 
Sator Laser GmbH
Geschäftsführer: Thorsten Föcking, Amtsgericht Hamburg HR B62 932

0
Reply Ulrich 4/12/2010 10:36:50 AM

My problem is than the bind function return -1
If I use SO_REUSEADDR the bind function doesn't return an error but
communcation between my server and client are like if the had returned
-1

For sur I have to avoid my program crashing and I do, but I often have
to stop debugging without letting my program close normaly and it
make me loosing a part of my time. And I think about if the problem
occurs for my users, they will say "f*c#ing app ! Uninstalling... !"

They from what you say it seems that there's no way to reset winsock...
0
Reply Greg2fs 4/12/2010 2:52:41 PM

Greg2fs wrote:
> For sur I have to avoid my program crashing and I do, but I often have
> to stop debugging without letting my program close normaly and it
> make me loosing a part of my time. And I think about if the problem
> occurs for my users, they will say "f*c#ing app ! Uninstalling... !"

Greg, I'm working on a program here that includes a webserver, and I also
often kill the program from the debugger or when it crashes, but I never
had the problem you describe. I'm almost sure that it is something
different that's going wrong, I can't imagine an OS that is not capable of
cleaning up after an application has terminated.

Uli

-- 
Sator Laser GmbH
Geschäftsführer: Thorsten Föcking, Amtsgericht Hamburg HR B62 932

0
Reply Ulrich 4/12/2010 3:12:58 PM

On Apr 12, 7:52=A0am, Greg2fs <greg...@gmail.com> wrote:

> My problem is than the bind function return -1
> If I use SO_REUSEADDR the bind function doesn't return an error but
> communcation between my server and client are like if the had returned
> -1

I'm not sure how that could be. If 'bind' fails, then 'listen' will
also fail. Are you saying when you use SO_REUSEADDR, 'listen' also
fails? What error does it report? You seem to be leaving out all the
details.

> For sur I have to avoid my program crashing and I do, but I often have
> to stop debugging without letting my program close normaly and it
> make me loosing a part of my time. And I think about if the problem
> occurs for my users, they will say "f*c#ing app ! Uninstalling... !"

For sure your users will be angry if your application crashes a lot.

DS
0
Reply David 4/12/2010 4:17:18 PM

Greg2fs wrote:
> My problem is than the bind function return -1

Please read the docs at http://msdn.microsoft.com. It tells you exactly how
to detect errors and how to find further info.

Uli

-- 
Sator Laser GmbH
Geschäftsführer: Thorsten Föcking, Amtsgericht Hamburg HR B62 932

0
Reply Ulrich 4/13/2010 6:41:14 AM

I don't use "listen" I work with udp conections...
For some days I finaly use SO_REUSEADDR and I didn't have problem
these days,
don't know what did make my program coundn't communicate.
But thanks for your help.
0
Reply Greg2fs 4/14/2010 6:46:31 PM
comp.os.programmer.win32 14362 articles. 0 followers. Post

9 Replies
508 Views

Similar Articles

[PageSpeed] 8


  • Permalink
  • submit to reddit
  • Email
  • Follow


Reply:

Similar Artilces:

bind Bind or BIND?
When talk to others, I never describe it clearly for naming bind. is it "bind" or "Bind" or "BIND"? is bind an abbreviation word? Thanks. ...

Crash-Crash-Crash
Eudora's acting up agian. Latest release, it's been doing this since I paid to upgrade to 6. (nice reward eh?) It runs fine for a few days, then it gets into a fit of crashing. When it crashes, on the next time I run the program, tons of emails that I had already received and filtered are in my inbox, unfiltered, with a few new ones. Sometimes I don't even get done cleaning the mess from the crash before it crashes again. Now I have thousands of duplicate mails in all my mail folders, and no practical way to find and eliminate them.. -- www.Micro...

Bind 9.2.3 crashes with a timer error
Here is the output from /var/log/messages running Bind 9.2.3. After this is shown of course it just dies. Anybody seen this before or have any idea? Sep 30 01:21:54 uranus named[2076]: timer.c:684: REQUIRE((((t2) != ((void *)0)) && (((const isc__magi c_t *)(t2))->magic == ((('T') << 24 | ('I') << 16 | ('M') << 8 | ('R')))))) failed Sep 30 01:21:54 uranus named[2076]: exiting (due to assertion failure) ...

Question about error message on SOME COMPUTERS after doing NETSH RESET WINSOCK CATALOG
I got 2 cases, where the computer cannot connect anywhere or browse anywhere, even with a cat-5e patch chord placed in the ethernet adaptor, the local area connection enabled and on DHCP, with a DHCP daemon present on the NAT router, where I did NETSH RESET WINSOCK CATALOG and it failed with the message: " NETSH COULD NOT LOCATE THE HOST FILE THE RESET OF THE CATALOG HAS NOT BEEN COMPLETED SUCCESSFULLY" (quote from memory, as shown by XP). What is the reason for this ? There are 2 computers on the LAN, and all work fine, all respond to the command fine as well, and all 3 comput...

Question about error message on SOME COMPUTERS after doing NETSH RESET WINSOCK CATALOG
I got 2 cases, where the computer cannot connect anywhere or browse anywhere, even with a cat-5e patch chord placed in the ethernet adaptor, the local area connection enabled and on DHCP, with a DHCP daemon present on the NAT router, where I did NETSH RESET WINSOCK CATALOG and it failed with the message: " NETSH COULD NOT LOCATE THE HOST FILE THE RESET OF THE CATALOG HAS NOT BEEN COMPLETED SUCCESSFULLY" (quote from memory, as shown by XP). What is the reason for this ? There are 2 computers on the LAN, and all work fine, all respond to the command fine as well, and all 3 comput...

ISC Security Advisory: BIND 9 Resolver crashes after logging an error in query.c
This is a multi-part message in MIME format. --------------020102060909030707090308 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit BIND 9 Resolver crashes after logging an error in query.c Summary: Organizations across the Internet reported crashes interrupting service on BIND 9 nameservers performing recursive queries. Affected servers crashed after logging an error in query.c with the following message: "INSIST(! dns_rdataset_isassociated(sigrdataset))" Multiple versions were reported being affected, including all currently supported rele...

BUG report, BIND crash when dlz postgresql driver receives error from database server.
--001a11c306285e1ebb04fef26c4b Content-Type: text/plain; charset=UTF-8 I attempted to submit this bug report via the online form, but that failed ("Failed to send your message. Please try later or contact the administrator by another method.") Bind, configured with "dlz postgresql", successfully connects to the database, but crashes (or corrupts the heap, randomly) on the very first query submitted, if the "find zone" query receives a "permission denied" error from Postgresql. The problem goes away when I correct the permissions on the...

Re: BIND 9.5.0-P2 crash on solaris 8 : socket.c:2586: fatal error:
Hello, What does "ulimit -a" say for the shell and user that named process is running in? open files should be >= 8192 I am not sure if this is the culprit, but may be something to check. Note that SUN has Solaris8 on the chopping block: http://www.sun.com/service/eosl/solaris/solaris_vintage_eol_5.2005.xml I mention this as leverage, should it be necessary, to move to something newer. Otherwise, there are many tunable parameters in Solaris8 that improve TCP/UDP/IP which appear to be built into Solaris9+ (for the most part). One�can do some googling on the many res...

Migration Errors (Bind 8 to Bind 9)
Hi! I am trying to migrate our bind service to the release 9. Everything is going great, except for this error on the /var/logmessages Apr 13 14:55:55 tierra named[2246]: zone 47.40.196.in-addr.arpa/IN: loaded serial 2003051901 Apr 13 14:55:55 tierra named[2246]: dns_rdata_fromtext: bnvsite.com.externo:15: near 'mail.bnvsite.com.': not a valid number Apr 13 14:55:55 tierra named[2246]: zone bnvsite.com/IN: loading master file bnvsite.com.externo: not a valid number The zone file is: $TTL 2D $ORIGIN bnvsite.com. @ IN SOA ns1.bnvsite.com. root.ns1.bnvsite.com. ( ...

CM:SF ... crash ... crash ... crash ... crash ...
Get to map, click on vehicle, watch the game hang for a weirdly long time while the unit data is populated. Then click on any second vehicle and - whack! - desktop city. Every time. That's two in a row for Battlefront. I'm starting to believe that their eLicensing is a moot point, since they don't seem to be able to release anything in a working state. And I'm just loving some of the tech support posts in their forums. Lots of problems with multicore systems and nVidia GPUs - but heck, it's not like 3D game fans gravitate towards dual-core CPUs and...

Re: Migration Errors (Bind 8 to Bind 9)
>>>>> "Gerardo" == Gerardo <gerardo@flecharoja.com> writes: Gerardo> Apr 13 14:55:55 tierra named[2246]: dns_rdata_fromtext: Gerardo> bnvsite.com.externo:15: near 'mail.bnvsite.com.': not a Gerardo> valid number Gerardo> The zone file is: GerardO> $TTL 2D Gerardo> $ORIGIN bnvsite.com. Gerardo> @ IN SOA ns1.bnvsite.com. root.ns1.bnvsite.com. ( Gerardo> 2003061202 ; Serial Number Gerardo> 7200 ; Refresh Gerardo> 7200 ...

2007 crash crash crash
I keep getting a CTD with a Microsoft Visual C++ Runtime Library runtime error dialog. I get two dialogs that say the same thing and then a CTD. RaceBikesOrWork wrote: > I keep getting a CTD with a Microsoft Visual C++ Runtime Library > runtime error dialog. > I get two dialogs that say the same thing and then a CTD. bob z. just installed swx2007 at home (to test before installing at work). the microsoft dot net framework failed to install and swx CTD's instantly - every time. bob z. knows this doesn't help you, but just thought he would share some of the calamity. a re...

error or not an error ...
I was just testing out the R4 REXX thingy, and it found an error in the following program. My question is this, is it an error or not? My PC/REXX and Regina don't barf on it, but I thought they should've. _____________________________________________ /**/ ?.='' ?.z='batman' trace i if ?.z\==''then do; say '?.z=' ?.z; end ______________________________________________ Note that there is space before the THEN. I'm not sure of the exact rules for parsing an IF statement, I know that THEN is a "reserved" keyword when an IF statement is...

When is an error not an error?
The Java language specification claims in: 8.8.7.1 Explicit Constructor Invocations .... "If an anonymous class instance creation expression appears within an explicit constructor invocation statement, then the anonymous class may not refer to any of the enclosing instances of the class whose constructor is being invoked." Helpfully it gives an example: "For example: class Top { int x; class Dummy { Dummy(Object o) {} } class Inside extends Dummy { Inside() { super(new Object() { int r = x; }); // err...

Crash Error
I am getting this error message every time I start Matlab 7.0. Then Matlab shuts down! Could you please help. ------------------------------------------------------------------------ Segmentation violation detected at Fri Dec 03 17:01:09 2004 ------------------------------------------------------------------------ Configuration: MATLAB Version: 7.0.1.24704 (R14) Service Pack 1 MATLAB License: 39074 Operating System: Microsoft Windows 2000 Window System: Version 5.0 (Build 2195: Service Pack 4) Processor ID: x86 Family 6 Model 7 Stepping 3, GenuineIntel Virtual M...

bind error!!!!!
hi.. my code was working pretty well until yesterday.suddenly it started giving me bind error: address already in use. but i have logged out and again logged in, but still the problem is not solved can somebody give me solution for this thankx perrin Perrin Aybara wrote: > hi.. > my code was working pretty well until yesterday.suddenly it started > giving me bind error: address already in use. > but i have logged out and again logged in, but still the problem is not solved > can somebody give me solution for this > > thankx > perrin Next time, please ask a slightly ...

crash no error
Hi out there, i have a pc running winXP pro. the thing freezes up randomly. when it crashes everything freezes. ctr-alt-del doesn't work. it must be restarted manually. this doesn't seem to have anything to do with any particular program. Any ideas? thanks a lot. -XP newbie I realize I had no answer for this one, or not even an inclanation of a question about it for any assistance! I found the fault. I downloaded the free RAM test software from MS, and ran it. The bad RAM was showing in about 20 minutes. Infact, sometimes the machine even froze during the test. I had a bad RAM. Th...

bind error
Some of my customers have the bind error 801 on some points of my application. Many other customers and I don't. Why ?? Any solutions and suggestions are welcome. Cheers, Nick Hello Nick, Are you using their data to test on your machine? -- or conversely is your test data complete? (ie - at least two records for every table, with an entry in every field). I sometimes found that I wouldn't pick up bind errors until the data was in place to require the application to access all the relationships. It was only then that it would pick up bind error a mis-spelled sort field in a child...

Binding or not binding
Hello, Could you please first excuse me if my past and maybe future posting in this group were (will be) sometimes awkward. But I will really like to be more active using and promoting Ada. I was really interested by the thread about "How come Ada isn't more popular?" I would like to have your opinion about the best way to go in the future, and in particular if binding a C library is really the way to go. When we talk about reuse does it mean reusing the libraries done in an other language ? Re-implementing zlib in Ada for example. Is it a waist of time ? How to choose...

Bind error
Hi, An user is connecting remotely from AS400 to AIX and trying to create a package. He already has bindadd, implicit_schema and createin privileges. But still getting the error message below. (I'm not allowed to grant him dbadm authority). If someone has any idea what I should do, please let me know. 117400 - STRQMQRY QMQRY(LGATOL_SIT/B_ADDR_ORG) OUTPUT (*OUTFILE) OUTFILE(LGATOD_SIT/B_ADDA) OUTMBR('*FIRST' '*REPLACE') RDB(STTOP) USER(msam) PASSWORD() NAMING(*SAA) SETVAR((SRCID 'SAAB') (LDATE '''0001-01-01-00.00.00.000000''...

Reset or not to reset
What is the consensus of opinion regarding the use of a explicity coded global reset line that is driven by a power on reset circuit? I'm targeting Xilinx Virtex II and QuickLogic Eclipse (both are available in radiation hardened versions). The QL part resets all flops at reset. The Xilinx can set/reset a flop. Therefore, theoretically I wouldn't need a POR circuit and waste the routing resources. However, eliminating the explicitly coded reset makes the Verilog synthesis optimizer do strange things since it doesn't know what the initial value of the flop will...

bind crash
Hi list, my bind crash after some hour, i found just this in my general.log: 09-Aug-2010 18:22:45.074 running 09-Aug-2010 20:32:16.891 name.c:2091: REQUIRE(suffixlabels > 0) failed, back trace 09-Aug-2010 20:32:16.891 #0 0x424bff in ?? 09-Aug-2010 20:32:16.891 #1 0x7f2eba6c0a0a in ?? 09-Aug-2010 20:32:16.891 #2 0x7f2ebb34c58d in ?? 09-Aug-2010 20:32:16.891 #3 0x42ac48 in ?? 09-Aug-2010 20:32:16.891 #4 0x42d872 in ?? 09-Aug-2010 20:32:16.891 #5 0x42f865 in ?? 09-Aug-2010 20:32:16.891 #6 0x41bbb7 in ?? 09-Aug-2010 20:32:16.891 #7 0x7f2eba6de508 in ?? 09-Aug-2010 20:32:16.891 ...

BIND Crashes
Hi, We have a Solaris 9 Sun-Fire-V240 system with 2GB of memory running BIND 9.2.3. Every so often named crashes with this error message: "dispatch.c:1903: REQUIRE(res->item_out == isc_boolean_true)... exiting (due to assertion failure)" Is there a solution to this? Thanks Ken ...