To resume - read again until it returns 0. How can I compute the size of my Linux install + all my applications? I believe something inside tomcat is recycling this socket under our feet but even so I don't believe the writer.close call should fail in this way. I get the error 88 only by the first connection, then it works fine.

JNI code investigation Given the generic message, I assumed that an EINVAL error must be returned from one of the system calls in the socketAccept JNI code, so I traced the Home | New | Browse | Search | [?] | Reports | Help | NewAccount | Log In Remember [x] | Forgot Password Login: [x] false Stack Trace Search | The point is that socket != 0 should be checked before calling native method. Do you see the zero-byte response issues? –Danny Thomas May 1 '13 at 12:38 add a comment| up vote 1 down vote Get OpenJDK with the fix: http://www.java.net/download/jdk7u60/archive/b15/binaries/jdk-7u60-ea-bin-b15-macosx-x86_64-16_apr_2014.dmg Worked for me!

I'd suggest running it through something like valgrind, and see if it turns up any sort of problems where you're trashing memory somewhere... Ie: memset (&srvr_sockaddr_in, '\0', sizeof (srvr_sockaddr_in)); srvr_sockaddr_in.sin_family = AF_INET; srvr_sockaddr_in.sin_addr.s_addr = htonl (INADDR_ANY); srvr_sockaddr_in.sin_port = htons (PORT_NUM); (And, on a side note: "srvr_sockaddr_in" is an obnoxiously long variable name to have I'll take a closer look at those test cases next week. –Danny Thomas May 3 '13 at 14:14 1 Digging in a bit further, select() will return EINVAL if "ndfs Check out our FAQ X

I can reproduce this on a Fusion VM w/ a clean install of 10.8: ## # Host Database # # localhost is used to configure the loopback interface # when the Not the answer you're looking for? Reduce function is not showing all the roots of a transcendental equation How do I say "back in the day"? Join us to help others who have the same bug.

Throws:java.io.IOException207208publicintwrite(byte[]data,intoff,intlen,longto)throwsIOException{209longmax=System.currentTimeMillis()+to;210211while(true){212intrc=writeInternal(data,off,len);213if(rc<0){214thrownewIOException("Writeerror"+rc);215}elseif(rc==0){216//needpollout-doweneedtoupdatepolling?217context.findPollerAndAdd(this);218}else{219returnrc;220}221222try{223longwaitTime=max-System.currentTimeMillis();224if(waitTime<=0){225return0;226}227wait(waitTime);228}catch(InterruptedExceptione){229return0;230}231}232}233234publicintwrite(byte[]data,intoff,intlen)throwsIOException{235//InSSLmode,read/writecan'tbecalledatthesametime.236intrc=writeInternal(data,off,len);237if(rc<0){238thrownewIOException("Writeerror"+rc);239}elseif(rc==0){240//needpollout-doweneedtoupdatepolling?241synchronized(this){242context.findPollerAndAdd(this);243}244}245returnrc;246}247248privateintwriteInternal(byte[]data,intoff,intlen)throwsIOException{249intrt=0;250intsent=0;251synchronized(this){252if((status&CLOSED)!=0253||socket==0254||!context.running){255thrownewIOException("Closed");256}257if((status&WRITING)!=0){258thrownewIOException("Writefrom2threadsnotallowed");259}260status|=WRITING;261262while(len>0){263sent=Socket.send(socket,data,off,len);264if(sent<=0){265break;266}267off+=sent;268len-=sent;269}270271status&=~WRITING;272}273274if(context.rawDataHandler!=null){275context.rawData(this,false,data,off,sent,len,false);276}277278if(sent<=0){279if(sent==-Status.TIMEUP||sent==-Status.EAGAIN||sent==0){280setStatus(POLLOUT);281updatePolling();282returnrt;283}284log.warning("apr.send():Failedtosend,closing"+sent);285reset();286thrownewIOException("Errorsending"+sent+""+Error.strerror(-sent));287}else{288off+=sent;289len-=sent;290rt+=sent;291returnsent;292}293}294295publicintread(byte[]data,intoff,intlen,longto)throwsIOException{296intrd=readNB(data,off,len);297if(rd==0){298synchronized(this){299try{300wait(to);301}catch(InterruptedExceptione){302return0;303}304}305rd=readNB(data,off,len);306}307returnprocessReadResult(data,off,len,rd);308}309310publicintread(byte[]data,intoff,intlen)throwsIOException{311returnreadNB(data,off,len);312}313314privateintprocessReadResult(byte[]data,intoff,intlen,intread)315throwsIOException{316if(context.rawDataHandler!=null){317context.rawData(this,true,data,off,read,len,false);318}319320if(read>0){321returnread;322}323324if(read==0||read==-Status.TIMEUP||read==-Status.ETIMEDOUT325||read==-Status.EAGAIN){326read=0;327setStatus(POLLIN);328updatePolling();329return0;330}331332if(read==-Status.APR_EOF||read==-1){333close();334return-1;335}336//abruptclose337reset();338thrownewIOException("apr.read():"+read+""+Error.strerror(-read));339}340341publicintreadNB(byte[]data,intoff,intlen)throwsIOException{342intread;343synchronized(this){344if((status&CLOSED)!=0345||socket==0346||!context.running){347return-1;348}349if((status&READING)!=0){350thrownewIOException("Readfrom2threadsnotallowed");351}352status|=READING;353354read=Socket.recv(socket,data,off,len);355status&=~READING;356}357returnprocessReadResult(data,off,len,read);358}359360/*361NosupportforshutdownOutput:SSLisquitetricky.362Useclose()instead-noread/writewillbeallowedafter.363364*/365366publicvoidclose(){367synchronized(this){368if((status&CLOSED)!=0||socket==0){369return;370}371status|=CLOSED;372status&=~POLLIN;373status&=~POLLOUT;374}375if(context.rawDataHandler!=null){376context.rawDataHandler.rawData(this,false,null,0,0,0,true);377}378Socket.close(socket);379if(poller==null){380maybeDestroy();381}else{382try{383poller.requestUpdate(this);384}catch(IOExceptione){385e.printStackTrace();386}387}388}389390voidmaybeDestroy(){391synchronized(this){392if(socket==0||393(status&CONNECTING)!=0||!context.running){394//closedoroperationinprogress395//ifcontextstopped,poolwillbedestroyedandclose396//allsocketsautomatically.397return;398}399if((status&CLOSED)==0){400return;//notclosed401}402if((status&(WRITING|READING))!=0){403return;//notclosed404}405406if(context.rawDataHandler!=null){407context.rawDataHandler.rawData(this,false,null,-1,-1,-1,true);408}409if(log.isLoggable(Level.FINE)){410log.info("closing:context.open="+context.open.get()+""+this);411}412413context.open.decrementAndGet();414415if(socket!=0&&(status&CLOSED)==0){416Socket.close(socket);417status|=CLOSED;418}419420if(handler!=null){421if(isBlocking()){422context.getExecutor().execute(this);423}else{424handler.closed(this);425}426}427428context.destroySocket(this);429}430} Close input and output, potentially sending RST, than close the socket. Please Note: this e-mail address is only for reporting problems with ASF Bugzilla. share|improve this answer answered May 15 '14 at 22:14 user3642751 111 This update won't run on OSX Yosemite. We Acted.

I was going to try a JDK release that still used poll() to see if this maybe related to that change, but 7u5 was the first official Oracle JDK release for We think this has been with us for the duration on Mac OS w/ Java 1.7, in the last several months a lot of us have switched to Macbook Pros. If you have any questions, please contact customer service. It makes startup take much much longer so the problem doesn't occur; I guess the causal and victim calls happen too far apart with this enabled.

Show Mladen Turk added a comment - 02/Nov/08 11:26 AM Exception thrown is caused by: >>> network.c : timeoutSet if (!sock) { tcn_ThrowAPRException(e, APR_ENOTSOCK); return APR_ENOTSOCK; } <<< However, crash and Ignore the errors at the start caused by glibc, and see if it gives any warnings or errors about your code. We Acted. Use 7u71 or 7u72 instead. –Dilum Ranatunga Jan 8 '15 at 18:42 add a comment| up vote 0 down vote I've been battling with this problem in another context.

Moving the writer.close() call above the writer.write() call results in the same exception, indicating that the client is not responsible for closing this under the feet of tomcat. If you're going to write C code, you really are going to have to learn to choose shorter and more cryptic variable names... ;-)) Offline Quote #13 2007-01-04 03:53 PM i3839 This sounds more akin to our workaround, than a cause. There is no explicit method to register/unregister poll interest - it is done automatically, when read/write methods return 0.

Parameters:dataofflen Returns:For both blocking and non-blocking, returns the number of bytes written. Try JIRA - bug tracking software for your team. See java.com/en/download/help/mac_10_10.xml . Thanks to Old Pro's answer, I confirmed that the select() FD_SETSIZE limitation is the cause.

Show Remy Maucherat added a comment - 03/Nov/08 12:03 PM Ok, I can't reproduce it again, let's forget about it for now. Code blocks~~~ Code surrounded in tildes is easier to read ~~~ Links/URLs[Red Hat Customer Portal](https://access.redhat.com) Learn more Close Sign In Create Account Search among 980,000 solutions Search Your bugs help others It's ugly and lame... if you find some memory corruption bug then do tell me also ...

Comment 1 Chris Elving 2007-08-16 19:31:20 UTC Created attachment 20672 [details] Fix optGet(..., APR_SO_SNDBUF) by correcting a typo in network.c Comment 2 Mark Thomas 2008-04-30 08:31:21 UTC This was fixed in If you're going to explicitly cast void*, then we might as well all go back to pre-ANSI K&R days, where all the functions were "char*" instead of "void*"... ;-/ Anyway, nevermind Mail about any other subject will be silently ignored. Are illegal immigrants more likely to commit crimes?

Tube and SS amplifier Power Should I record a bug that I discovered and patched? That's one of my all-time big pet peeves: people who cast to/from void*... I've tested JDK 1.7.0_09, 11, 15, 17 and 21 (the JDKs I've had installed on my machine for the duration) Mac OS update. The point is that socket != 0 should be checked before calling native method.

Have you tried that already? You must have some bug in your code, but it's impossible to guess what it might be without seeing the code in question... At least no problem was found with the individual JNI calls. Please Note: this e-mail address is only for reporting problems with ASF Bugzilla.

Any help is appreciated! 2012-12-18 09:13:22,566 WARN [cdot.ctms.layer.web.fire.EventsLogger] (Atmosphere-AsyncWrite-510) onThrowable(): AtmosphereResourceEventImpl{isCancelled=false, isResumedOnTimeout=false, throwable=org.apache.tomcat.jni.Error: Socket operation on non-socket, message=2023|{JUST A BUNCH OF JSON HERE}]}, resource=AtmosphereResourceImpl{ hasCode1611058968, action=Action{timeout=-1, type=SUSPEND}, broadcaster=org.atmosphere.cpr.DefaultBroadcaster, [email protected]e30, serializer=null, isInScope=true, Can be called manually to upgrade the channel Throws:java.io.IOException781782publicvoidblockingStartTLS()throwsIOException{783synchronized(this){784if(socket==0||!context.running){785return;786}787if((status&SSL_ATTACHED)!=0){788return;789}790status|=SSL_ATTACHED;791}792793try{794if(log.isLoggable(Level.FINE)){795log.info(this+"StartSSL");796}797798AprSocketContextaprCon=context;799SSLSocket.attach(aprCon.getSslCtx(),socket);800801if(context.debugSSL){802SSLExt.debug(socket);803}804if(!getContext().isServer()){805if(context.USE_TICKETS&&hostInfo.ticketLen>0){806SSLExt.setTicket(socket,hostInfo.ticket,807hostInfo.ticketLen);808}elseif(hostInfo.sessDer!=null){809SSLExt.setSessionData(socket,hostInfo.sessDer,810hostInfo.sessDer.length);811}812}813SSLExt.sslSetMode(socket,SSLExt.SSL_MODE_ENABLE_PARTIAL_WRITE|814SSLExt.SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER);815816intrc=SSLSocket.handshake(socket);817818//AtthispointwehavethesessionID,remotecerts,etc819//wecanlookuphostinfo820if(hostInfo==null){821hostInfo=newHostInfo();822}823824if(rc!=Status.APR_SUCCESS){825thrownewIOException(this+"Handshakefailed"+rc+""826+Error.strerror(rc)+"SSLL"827+SSL.getLastError());828}else{//SUCCESS829handshakeDone();830}831}catch(IOExceptione){832throwe;833}catch(Exceptione){834thrownewIOException(e);835}836}837838privatevoidhandshakeDone()throwsIOException{839getHost();840if(socket==0||!context.running){841thrownewIOException("Socketclosed");842}843if(context.USE_TICKETS&&!context.isServer()){844if(hostInfo.ticket==null){845hostInfo.ticket=newbyte[2048];846}847intticketLen=SSLExt.getTicket(socket,hostInfo.ticket);848if(ticketLen>0){849hostInfo.ticketLen=ticketLen;850if(log.isLoggable(Level.FINE)){851log.info("Receivedticket:"+ticketLen);852}853}854}855856//TODO:iftheticket,sessionidorsessionchanged-callbackto857//savethesessionagain858try{859hostInfo.sessDer=SSLExt.getSessionData(socket);860getPeerCert(true);861hostInfo.sessionId=SSLSocket.getInfoS(socket,862SSL.SSL_INFO_SESSION_ID);863}catch(Exceptione){864thrownewIOException(e);865}866867hostInfo.npn=newbyte[32];868hostInfo.npnLen=SSLExt.getNPN(socket,hostInfo.npn);869870//Ifcustomverificationisused-shouldcheckthecertificates871if(context.tlsCertVerifier!=null){872context.tlsCertVerifier.handshakeDone(this);873}874}875876intrequestedPolling(){877synchronized(this){878if(socket==0||((status&CLOSED)!=0)){879return0;880}881//Implicit:882//Poll.APR_POLLNVAL|Poll.APR_POLLHUP|Poll.APR_POLLERR|883intres=0;884if((status&POLLIN)!=0){885res=Poll.APR_POLLIN;886}887if((status&POLLOUT)!=0){888res|=Poll.APR_POLLOUT;889}890returnres;891}892}893894booleancheckBitAndSocket(intbit){895synchronized(this){896return((status&bit)!=0&&socket!=0&&897(status&CLOSED)==0&&context.running);898}899}900901booleancheckPreConnect(intbit){902synchronized(this){903return((status&bit)!=0);904}905}906907voidclearStatus(intbit){908synchronized(this){909status&=~bit;910}911}912913booleansetStatus(intbit){914synchronized(this){915intold=status&bit;916status|=bit;917returnold!=0;918}919}920921922} Profile: Standard JRE Google AppEngine org.apache.tomcat.jni.socket AprSocket AprSocket(AprSocketContext) : void afterConnect() : void blockingStartTLS() : void checkBitAndSocket(int) : boolean checkPreConnect(int) I know some other perverse languages have multi-byte "char"s...) But, then, I rely on GCC-only tricks quite often myself, so I can't fault you for it too much... ;-) I really I can see that: the JVM dump is also about a timeoutSet, like the exception; the stack trace looks legitimate (the connection is done, switch back to normal mode), but may

Which throws the following exception: org.apache.tomcat.jni.Error: 88: Socket operation on non-socket at org.apache.tomcat.jni.Socket.sendbb(Native Method) at org.apache.coyote.http11.InternalAprOutputBuffer.writeToSocket(InternalAprOutputBuffer.java:287) at org.apache.coyote.http11.InternalAprOutputBuffer.writeToSocket(InternalAprOutputBuffer.java:265) at org.apache.coyote.http11.InternalAprOutputBuffer.flushBuffer(InternalAprOutputBuffer.java:213) at org.apache.coyote.http11.AbstractOutputB...

Reply tamir says: January 21, 2014 at 12:03 pm But what happend if the process is down but its port still being occupied for a long time? Intermittently, (under load) you might get "Only one usage of each socket address (protocol/network address/port) is normally permitted (typically under load)."You might be wondering why are you getting a *SOCKET* Exception… Really a nice post. Now you can start apache normaly. I look forward to interacting more with this group. When you instal...

You also acknowledge that MuleSoft is the sole owner of MuleSoft trademarks, promise not to interfere with MuleSoft?s rights in them, and acknowledge that goodwill derived from their use accrues only For example: JAVA_OPTS='-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/path/to/dir' Your JAVA_OPTS could most likely contain other options. RE: Tomcat Startup Error - Out of Memory : Java Heap Space December 2, 2013 2:28 AM Answer Jignesh Vachhani Rank: Liferay Master Posts: 787 Join Date: M...

Flag Please sign in to flag this as inappropriate. Why is AT&T's stock price declining, during the days that they announced the acquisition of Time Warner inc.? We'll use this track on the homepage to show you relevant content and help you find resources quickly. That's running as a separate process though so it shouldn'tchange the output of "lsof".How many clients were connected at the same time?In the sample, just one. Like Show 0 Likes(0) Actions 2. using Tomcat's WebSocket engine o...