Export to GitHub

v8cgi - issue #87

crash on win32


Posted on Feb 12, 2011 by Quick Bear

Hi!

I just run any of the script examples, even just response.write( 'test' ); Then I just hold F5 for a few seconds (sending many requests) and the "Apache HTTP Server has encountered a problem" error popups.

sometimes there is the error that I have attached in the text file from apache_error.log. this appeared once as well:

[Sat Feb 12 16:24:48 2011] [error] [client 127.0.0.1] require.paths is empty, have you forgotten to push some data there? [Sat Feb 12 16:24:48 2011] [error] [client 127.0.0.1] require.paths is empty, have you forgotten to push some data there? [Sat Feb 12 16:24:48 2011] [error] [client 127.0.0.1] ReferenceError: response is not defined (D:\www\v8-test\core.js:1)\nReferenceError: response is not defined\n at Object.<anonymous> (D:\www\v8-test\core.js:1:43)

It is a bit random..

The log says Allocation failed - process out of memoryV8 but when I looked in memory usage it is stable.

It seems V8 is working again after few seconds after it crashed. Apache is still running and my PHP cgi is still working properly.

I am using v8cgi-0.9.0-win32 Chrome Apache/2.2.11 (Win32) with PHP/5.3.0 Windows XP SP3

I just installed it and everything is set to default.

In httpd.conf I have:

LoadModule v8cgi_module "C:/v8/mod_v8cgi.dll" AddHandler v8cgi-script .js v8cgi_Config "C:/v8/v8cgi.conf"

<VirtualHost 127.0.0.1:8888> ServerName localhost
DocumentRoot "D:/www/v8-test" AliasMatch .* "D:/www/v8-test/test.js" </VirtualHost>

Attachments

Comment #1

Posted on Feb 13, 2011 by Happy Giraffe

Hi,

I would say that you have forgotten to set the "ThreadsPerChild 1" value in your Apache configuration file. v8cgi 0.9.0 is not threadsafe, so you need to reduce the number of apache threads to 1.

Alternative approaches:

1) try v8cgi on linux, using the mpm-prefork apache module. This one does not use threads (as opposed to your windows version), so there are no similar troubles regarding v8cgi.

2) checkout latest revision of v8cgi and compile it (or wait for the next release), because I have recently commited some fixes in order to make v8cgi more threadsafe.

3) use v8cgi in "cgi" mode, e.g. without the Apache module (approach #3 at http://code.google.com/p/v8cgi/wiki/ApacheConfiguration).

Please let me know is my guess about ThreadsPerChild was correct.

Comment #2

Posted on Feb 13, 2011 by Quick Bear

You guessed right :) I will be using the windows version to develop only, so for sure I will get it for linux later!

thank you for your great work!

Comment #3

Posted on Nov 29, 2011 by Happy Giraffe

(No comment was entered for this change.)

Status: Done

Labels:
Type-Defect Priority-Medium