php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59238 Segfault when storing JSContext as a static property
Submitted: 2010-05-27 17:04 UTC Modified: 2017-01-10 08:01 UTC
From: lucas at lucaswoj dot com Assigned:
Status: Suspended Package: spidermonkey (PECL)
PHP Version: 5.3.2 OS: Linux
Private report: No CVE-ID: None
 [2010-05-27 17:04 UTC] lucas at lucaswoj dot com
Description:
------------
If I try to store a JSContext object in a static class, I hit 
a segfault.

Reproduce code:
---------------
<?php

class StaticClass {

	public static $context;

}

StaticClass::$context = new jsContext();

echo StaticClass::$context->evaluateScript("Hello, world.");

?>


Expected result:
----------------
Print "Hello, world."

Actual result:
--------------
Segfault (page remains blank)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-09-18 10:17 UTC] tianbin at cernet dot edu dot cn
this bus is caused by JS_DestroyRuntime (in function PHP_RSHUTDOWN_FUNCTION(spidermonkey)) called before JS_DestroyContext (in function php_jscontext_object_free_storage).

You can unset all the variables which references the JSContext object before php script quit to avoid this bug.
 [2017-01-10 08:01 UTC] kalle@php.net
-Status: Open +Status: Suspended
 [2017-01-10 08:01 UTC] kalle@php.net
Suspending this report as the extension have not had a release for almost 5 years.  Please revive this if the extension once again shows life
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Nov 11 04:01:27 2024 UTC