Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue reported via studio tender #2

Open
ashebanow opened this issue Oct 28, 2009 · 4 comments
Open

Issue reported via studio tender #2

ashebanow opened this issue Oct 28, 2009 · 4 comments

Comments

@ashebanow
Copy link

Hi,

I would like to start pointing out that I have successfully installed Jaxer and it's up and running on my Debian Etch machine.

I have a couple of pages that parse correctly.

But for some reason I have my new pages not doing what they are supposed to.

I keep getting errors.

Error in browser: "Error Processing Your Request
This server is configured to not display errors on the browser. Further information about this error may have been logged on the server. "

Error in console: "Read data from jaxer (pid=10605) failed (rc=0). Server will be killed
SocketEventCallback: Killing Jaxer due to failed event handling."

I've tried everything but nothing worked.
I've added the maxmemory 0 in /opt/AptanaJaxer/local_jaxer/conf/JaxerManager.cfg since I thought that it may due the fact that the new page has a rather large JavaScript code in it.

Any pointers would be welcome where to look.

These are the latest entries from the apache_error.log
[Sun Oct 25 14:39:01 2009] warnEnd of file found: mod_jaxer: receive data over socket error: total len=3 read=0

[Sun Oct 25 14:39:01 2009] warnUnknown error 18446744073709551615: mod_jaxer: read data from socket error
Regards,
Sam Van Hulle (svh@telenet.be)

@simonefonda
Copy link

Any news on this?

Im having the same problems on an ubuntu 10.4. Activated debug/trace/development modes all around and this is what i get trying to run jquery's own tests (/aptana/diagnostics/unit_tests_library/jQueryTestSuite/index.html).

jaxer.log:

10:25:16 02/02/2011 [ 26812] [INFO] [JS Framework] [framework.] jQuery unit Test failure - core module: noConflict>> (1, 5, 6)
10:25:16 02/02/2011 [ 26812] [INFO] [JS Framework] [framework.] jQuery unit Test failure - core module: attr(String)>> (4, 16, 20)
10:25:16 02/02/2011 [ 25435] [INFO] [JaxerManager] Read data from jaxer (pid=26812) failed (rc=0). Server will be killed
10:25:16 02/02/2011 [ 25435] [DEBUG] [JaxerManager] SocketEventCallback: OnRecv failed. s=14 e=2 vp=14346560
10:25:16 02/02/2011 [ 25435] [INFO] [JaxerManager] SocketEventCallback: Killing Jaxer due to failed event handling.
10:25:16 02/02/2011 [ 26841] [INFO] [Jaxer/1.0.3.xxxx -- starting] Community Edition, licensed by Aptana, Inc. under GPL/APL (see LICENSE.TXT)

apache's error.log:

[Wed Feb 02 10:25:16 2011] warnEnd of file found: mod_jaxer: receive data over socket error: total len=3 read=0
[Wed Feb 02 10:25:16 2011] warnUnknown error 18446744073709551615: mod_jaxer: read data from socket error
[Wed Feb 02 10:25:16 2011] warnUnknown error 500: mod_jaxer: check for request message failed

Wrote scripts to call just some Jaxer.* functions and it worked fine (Jaxer.web.get and some Jaxer.log), the problem seems to show up trying to include jquery, for example http://code.jquery.com/jquery-1.5.js (others versions behave the same afaik), using runat="both".

Thanks,
Simone

@msalgado
Copy link

i'm having the same problem, i identified that the problem appear when jaxer is called through script different than starJaxer.sh

@rsibley
Copy link

rsibley commented May 5, 2011

I have exactly the same report as Simone, except it's xubuntu (10.4).

Jaxer version 1.0.3.4547 was working more-or-less ok although once in a while it would go south just like this. I'd mess with all kinds of config and permissions stuff with no luck, then set it all back and it would work. Frustrating.

Now I've compiled the newest version from github and I get this again. I've checked and re-checked configuration and compilation, done multiple compiles, no joy.

I just did a wireshark trace on the jaxer ports (4327 and 4328), as follows:

Note: this was a request for a php file.
Note: I left out the http conversation and the src/dst (both 127.0.0.1), and the protocol (tcp).
Note: port 51172 is apache (mod_jaxer) and port 4327 (jaxer-web) is jaxer (not jaxermanager).

wireshark trace:
51172 > jaxer-web [PSH, ACK] Seq=1 Ack=1 Win=513 Len=6 TSV=15873842 TSER=4294900379
jaxer-web > 51172 [ACK] Seq=1 Ack=7 Win=512 Len=0 TSV=15873842 TSER=15873842
jaxer-web > 51172 [PSH, ACK] Seq=1 Ack=7 Win=512 Len=6 TSV=15873842 TSER=15873842
51172 > jaxer-web [ACK] Seq=7 Ack=7 Win=513 Len=0 TSV=15873842 TSER=15873842
51172 > jaxer-web [PSH, ACK] Seq=7 Ack=7 Win=513 Len=5959 TSV=15873842 TSER=15873842
(data are the http header including cookies, no body)
jaxer-web > 51172 [ACK] Seq=7 Ack=5966 Win=770 Len=0 TSV=15873852 TSER=15873842
51172 > jaxer-web [PSH, ACK] Seq=5966 Ack=7 Win=513 Len=10444 TSV=15873852 TSER=15873852
(data are the http header and complete web page as produced by php)
jaxer-web > 51172 [ACK] Seq=7 Ack=16410 Win=770 Len=0 TSV=15873852 TSER=15873852
end trace

Curious that no SYN or FIN is recorded on this run... I'll check my capture parms but I really think they're ok.

Also, I'm not seeing jaxer-command (port 4328), although I filtered for that... hmm.

In any case, the data flows just fine to jaxer from apache (via mod_jaxer), but I don't see the flow back to apache. That seems about right since apache is complaining about not getting what it expects.

At least that's what I think is going on. I'm sure I'm missing something, so I'll get the old version of jaxer back up (which worked before I recompiled) and trace that to see what's different.

I have to solve this, so I'll post back as I proceed.

Cheers,
Russell

@rsibley
Copy link

rsibley commented May 9, 2011

UPDATE: This has turned into a bit of a rats nest. The obsolete string functions used (referenced below) are buggy, and deep in the basic code. (Debug cycle is many minutes because a major chunk of the project has to recompile on every change.) More than a few times I've thought of dumping Jaxer for V8/node.js or similar. I'm sticking with it for the moment, however, as I have a bunch of stuff written to it, so I'll make any dramatic decisions later. Meanwhile, I'm on this full time to get it working.

The CSS parsing functions of nsCSSValue.h/cpp are the heart of the OP's issue... certain CSS values demand string operations that fail, and those string classes are largely obsolete. I do not yet have a solid grip on precisely how that goes down, I just know that even simple stuff like ToString and StorageSize fail in certain cases.

Much more of this and I may just bite the bullet and change nsCSSValue and friends to use the new string functions, or perhaps change all source that uses nsStringObsolete.cpp and friends... we'll see. I find myself wishing the Firefox team had just gotten rid of what they didn't want rather than kludge for backwards compatibility (if that's a fair characterization).

The changes below are good, but not sufficient... more needs to be done. Stay tuned...

UPDATE: ANOTHER BUG FIXED BELOW, TESTING...**

Turned out to be a bug in the Mozilla code. An obsolete string function being used to parse parameters from inline CSS would bomb on occasion. The jaxer process would go into la-la land and the socket reader would timeout, thus the error reported by the OP.

It was bombing on inline shortcut styles, such as style="margin:5px;". You can test this by removing such styles from a page that bombs and seeing if it then works. Put the styles into a css file (hint hint).

Once I replaced the offending function it all worked fine (update: not true, some cases still fail). Since my replacement is a kludge and not a proper fix, (I replaced the function but should be using newer functions for it, I suppose), I'll not post to the project but offer the change here for anyone who hits this issue.

File: jaxer/server/src/mozilla/xpcom/string/src/nsStringObsolete.cpp
Function: Modified_cnvtf(char _buf, int bufsz, int prcsn, double fval)
_Problem:* Sometimes bombs on CSS inline statements.
Replace entire body with this:


  //AR&E BEGIN ADD
  //Not really sure what all the fuss was here... the job seems pretty straight
  //forward for locale-insensitive work.  In any case, the function as it was
  //did not always work... I think it was overly complex so I did not debug.
  //Doing it simply for now...
  //
  char b[256];
  sprintf(b, "%.*f", prcsn, fval);
  int n = strlen(b);
  int d; //find the decimal point
  for (d=0; d < n && b[d] != '.' && b[d] != ','; ++d);
  if (d < n) b[d] = '.'; //convert euro ',' to '.', if present
  int z; //find the last non-zero past decimal point
  for (z=n-1; z > d && b[z] == '0'; --z);
  if (b[z] != '.') ++z;//null after the last non-zero digit
  b[z] = '\0';
  if (++z <= bufsz) {
    strcpy(buf, b);
  }else if (bufsz > 0) {//then return empty string... that was the previous behaviour on error
    buf[0] = '\0';
  }
  //AR&E END

File: jaxer/server/src/mozilla/layout/style/nsCSSValue.h
Function: GetStringValue(nsAString& aBuffer) const
Problem: Sometimes mValue.mString is null, was not tested.
Replace as shown:


  nsAString& GetStringValue(nsAString& aBuffer) const
  {
    NS_ASSERTION(eCSSUnit_String <= mUnit && mUnit <= eCSSUnit_Attr,
                 "not a string value");
    aBuffer.Truncate();
    if (mValue.mString) {//AR&E ADD check for null value (it *does* happen)
      PRUint32 len = NS_strlen(GetBufferValue(mValue.mString));
      mValue.mString->ToString(len, aBuffer);
    }
    return aBuffer;
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants