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 14317 articles. 0 followers. Post

9 Replies
454 Views

Similar Articles

[PageSpeed] 17


  • Permalink
  • submit to reddit
  • Email
  • Follow


Reply:

Similar Artilces:

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. ( ...

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 ...

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...

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''...

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 ...

BIND Errors
Hello All, I use BIND on my machine and have been using it for a while now without any problems. It is a very good software and I would like to commend you on this good product. Recently, I was doing a cleanup and audit of my system and found several error entries in my event viewer logs. The error logged for each instance is as follows: Event Type: Error Event Source: named Event Category: None Event ID: 1 Date: 04/08/2007 Time: 20:09:37 User: N/A Computer: SERVER1 Description: The description for Event ID ( 1 ) in Source ( named ) cannot be found. The local computer may ...

Bind Error
Dear All I have facing with following problem in Fedora core 5 how can i solve that? Pls help me `named' is using obsolete setsockopt SO_BSDCOMPAT Thanks TRYm This is what I do: Unpack the tarball, and open up (sourcetree)/lib/isc/unix/socket.c in your favorite text editor. Around line 1297 (may vary with different versions of bind): #if defined(USE_CMSG) || defined(SO_BSDCOMPAT) int on = 1; and change it to: #if defined(USE_CMSG) int on = 1; essentially remove so_bsdcompat. Next, around line 1384, find: #ifdef SO_BSDCO...

Crashed Bind
--_6332f531-d069-4ce8-81b6-7f9bc60e6b83_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello. In my company we've got a bind v9.6.0-P1 running on a RHEL 5.4 server.=20 Today the named process stopped. I revised the logs and I could see: 19-Nov-2010 13:21:32.572 query.c:1769: INSIST(!dns_rdataset_isassociated(si= grdataset)) failed 19-Nov-2010 13:21:32.572 exiting (due to assertion failure) It's the first time I've seen this error. I started the named process witho= ut problems but=2C must I be worried about that...

error in bind ?
Hello, I have a problem. When I make flush my servername shut down and in my log file I have: named[868]: [ID 866145 daemon.crit] rdataset.c:115: REQUIRE((((rdataset) != 0) && (((const isc__magic_t *)(rdataset))->magic == ((('D') << 24 | ('N') << 16 | ('S') << 8 | ('R')))))) failed what is it? Early I have in my logfile: named[526]: [ID 866145 daemon.crit] rbt.c:1271: INSIST(order < 0) failed and my serwername too shut down SO:Solaris 8 Bind: 9.2.2 -m ...

winsock error.
Running Orbitron, it was O.K. for a while, now in a terminal, I get: fixme:winsock:convert_sockopt Unknown SOL_SOCKET optname 0xff7f err:winsock:WS_setsockopt Invalid level (1) or optname (65407) AFAIK, the only difference in my setup between last time and now is to install ddclient. Any suggestions please? Doug. -- I'm only a beer teetotaller, not a champagne teetotaller. - G.B. Shaw. Doug Laidlaw wrote: > Running Orbitron, it was O.K. for a while, now in a terminal, I get: > > fixme:winsock:convert_sockopt Unknown SOL_SOCKET optname 0xff7f > er...

Bind error
Hi guys, I've a little problem with some lines of code; the following: [code] int listenfd; struct sockaddr_in cliaddr, servaddr; if ((listenfd = socket(AF_INET, SOCK_STREAM, 0)) < 0) { err_sys("socket error"); return listenfd; } memset(&servaddr, 0, sizeof(servaddr)); servaddr.sin_family = AF_INET; servaddr.sin_addr.s_addr = htonl(INADDR_ANY); servaddr.sin_port = htons(SERV_PORT); if (bind(listenfd, (SA *)&servaddr, sizeof(servaddr)) < 0) { err_sys("Bind error\n");...

error :"gnome-terminal" (process 1694) has crashed due to a fatal error.
i am getting the error when i run the terminal in redhat 9.0 . Application "gnome-terminal" (process 1694) has crashed due to a fatal error. (Aborted) can any one tell me whats the problem and how to clear this problem . > > can any one tell me whats the problem and how to clear this problem . This is not a group for technical help. You should try alt.os.linux or one of the redhat groups. Also, redhat 9.0 is pretty old by now. If it's a bug, it's probably been fixed by now, and most people who might help won't be running such old software anyway. I'd u...

Reset Canon i320, i255 Waste Ink Counter [+] ERROR CODE & How to Reset
Canon i320, i255 Waste Ink Counter Reset. Software Download For Clear Counter Step 1 : Manual Temporary 1. Unplug power and USB Resetter Canon and Epson IP: Logged Message: Please send me resetter software for Canon IP1200,1600, MP110 etc and for Epson C67, R230 etc Free Software Downloads pack.google.com Browser & desktop add-ons, virus protection & more. Get Google Pack. Chip Resetter $9.80 store.einktech.com/epson.htm Universal Chip Resetters Save Money Chip Resetter for All New Ink Chips Printer Resetter Service Manual Download Driver for Canon Epson Hp Reset P...