php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #68324 weird library dependency error
Submitted: 2014-10-29 16:54 UTC Modified: 2015-03-13 15:01 UTC
From: jagged_4pn at jagged dot tk Assigned: stesie (profile)
Status: Closed Package: v8js (PECL)
PHP Version: 5.4.34 OS: linux
Private report: No CVE-ID: None
 [2014-10-29 16:54 UTC] jagged_4pn at jagged dot tk
Description:
------------
Minimal not-working example:

<?php
  $v8=new V8Js();
?>

I'm getting following error when running this:

php: symbol lookup error: /usr/lib64/php5/extensions/v8js.so: undefined symbol: _ZN2v811HandleScopeC1Ev

$ ldd /usr/lib64/php5/extensions/v8js.so
        linux-vdso.so.1 (0x00007fff8f370000)
        libv8.so.3 => /usr/lib64/libv8.so.3 (0x00007fde5ca5e000)
[...]

I was sure that it is about libv8.so, so I did an objdump -t on it, which
yielded nothing. Installing the corresponding debuginfo package, I have a
file /usr/lib/debug/usr/lib64/libv8.so.3.debug.

$ objdump -t /usr/lib/debug/usr/lib64/libv8.so.3.debug | grep _ZN2v811HandleScopeC1Ev
000000000022afc0 g     F .text  000000000000001e _ZN2v811HandleScopeC1Ev

As a side note, unmangling the symbol yields "v8::HandleScope::HandleScope()".

Running this script under ltrace, grep'ping dlopen() calls, it shows that
all files in /usr/lib64/php5/extensions/ are opened, but not /usr/lib64/libv8.so.3, but this is probably normal, because the latter is subject to
be loaded on behalf of a library routine already (doesn't show how libxml2
is loaded for dom.so, too). (And same with dlsym(), of course.)

Passing "-l v8js.so" to ltrace as well gives the following two lines only:

v8js.so->_ZN18_zend_v8js_globalsC1Ev(0x7feee1d13720, 0xffff, 0x7fff729ed830, 0x7feef374d2f0) = 0x7feee1d13730
v8js.so->_ZN2v822ExtensionConfigurationC1EiPPKc(0x7fff729e9c30, 0, 0, 0) = 0x7fff729e9c30



Test script:
---------------
See above; the error first appeared in a bigger script, but even stripping it
down to nothing except creation of a V8Js instance triggers this buggy
behaviour.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-11-20 21:37 UTC] stesie at brokenpipe dot de
You're likely using a rather new version of v8 library with a rather old version of v8js extension.

You V8Js links against _ZN2v811HandleScopeC1Ev, which is v8::HandleScope::HandleScope() ctor as you state correctly.

Older v8 versions (3.18.5 here) declare two overloaded ctor functions:

000000000020a2a0 T _ZN2v811HandleScopeC1EPNS_7IsolateE
000000000020a2b0 T _ZN2v811HandleScopeC1Ev

unmangled to:

v8::HandleScope::HandleScope(v8::Isolate*)
v8::HandleScope::HandleScope()

... where the latter is the older/deprecated version and the former is the newer isolate-version.  Somewhen later the deprecated version has been removed from v8.

I don't know why the libv8.so.3.debug file you have around has the symbol and the "normal" library doesn't.  I would suspect that they belong to different v8 versions.

TL;DR use a recent v8js version (not a release, pick master branch from https://github.com/preillyme/v8js), which already uses the isolate version, with your v8.  Recent v8js master requires v8 3.24.10 or higher (you should use 3.28 or newer however, since older version have no maintenance by google)

cheers
  ~stesie
 [2015-03-13 15:01 UTC] stesie@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: stesie
 [2015-03-13 15:01 UTC] stesie@php.net
no feedback, closing now.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 11:01:30 2024 UTC