Issue: Encode.so: undefined symbol: PL_utf8skip

[email protected] (Bright Dadson) Thu, 23 Jul 2015 18:13:30 +0100
Newsgroups perl.unicode
Message-ID <CAOOoGjzE3-pN-xJ=CW=LKOFpoKZUzoPhnU1e9VuT6mZHSZ0+Bg@mail.gmail.com>
--047d7ba9803ca0fea7051b8e011c
Content-Type: text/plain; charset=UTF-8

Hi Guys,

I am trying to create a perl embed application which expose WWW::Mechanize
into my Cython extension project.

I compile and link my extension using:


x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall
-Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 -Wformat
-Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -I/usr/lib/perl/5.18/CORE
-I/usr/include/python3.4m
-I/home/losintikfos/git/testproj/env/include/python3.4m -c src/perlxsi.c -o
build/temp.linux-x86_64-3.4/src/perlxsi.o -O0 -g3 -Wall -c
-fmessage-length=0 -Wl,-E -fstack-protector -L/usr/local/lib
-L/usr/lib/perl/5.18/CORE -lperl -ldl -lm -lpthread -lc -lcrypt
-D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe
-I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-I/usr/lib/perl/5.18/CORE

x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall
-Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 -Wformat
-Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -I/usr/lib/perl/5.18/CORE
-I/usr/include/python3.4m
-I/home/losintikfos/git/testproj/env/include/python3.4m -c
src/perlmechanize.c -o build/temp.linux-x86_64-3.4/src/perlmechanize.o -O0
-g3 -Wall -c -fmessage-length=0 -Wl,-E -fstack-protector -L/usr/local/lib
-L/usr/lib/perl/5.18/CORE -lperl -ldl -lm -lpthread -lc -lcrypt
-D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe
-I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-I/usr/lib/perl/5.18/CORE

x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions
-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro
-g -fstack-protector --param=ssp-buffer-size=4 -Wformat
-Werror=format-security -D_FORTIFY_SOURCE=2
build/temp.linux-x86_64-3.4/src/perlxsi.o
build/temp.linux-x86_64-3.4/src/perlmechanize.o
build/temp.linux-x86_64-3.4/src/pymechanize.o -lperl -o
build/lib.linux-x86_64-3.4/pymechanize.cpython-34m.so

Which works fine.

My problem is - when I import calls from my extension module
pymechanize.cpython-34m.so I get below error:


Can't load '/usr/local/lib/perl/5.18.2/auto/Encode/Encode.so' for module
Encode: /usr/local/lib/perl/5.18.2/auto/Encode/Encode.so: undefined symbol:
PL_utf8skip at /usr/share/perl/5.18/XSLoader.pm line 68.
 at /usr/local/lib/perl/5.18.2/Encode.pm line 10.
Compilation failed in require at /usr/local/share/perl/5.18.2/HTML/Form.pm
line 6.
BEGIN failed--compilation aborted at
/usr/local/share/perl/5.18.2/HTML/Form.pm line 6.
Compilation failed in require at
/usr/local/share/perl/5.18.2/WWW/Mechanize.pm line 133.
BEGIN failed--compilation aborted at
/usr/local/share/perl/5.18.2/WWW/Mechanize.pm line 133.
Compilation failed in require.
BEGIN failed--compilation aborted.
Attempt to reload WWW/Mechanize.pm aborted.
Compilation failed in require at (eval 9) line 1.
BEGIN failed--compilation aborted at (eval 9) line 1.


For almost two weeks now I have tried various options - including
reinstalling Encode.pm but to no luck. I can see the symbol is there when I
do:

nm /usr/local/lib/perl/5.18.2/auto/Encode/Encode.so | grep PL_utf8skip

Do anyone know what might be causing this?

-Bright

--047d7ba9803ca0fea7051b8e011c
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div><div><div><div><div><div><div>Hi Guys,<br><br></div>I=
 am trying to create a perl embed application which expose WWW::Mechanize i=
nto my Cython extension project.<br><br></div>I compile and link my extensi=
on using:<br><br><br>x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 =
-Wall -Wstrict-prototypes -g -fstack-protector --param=3Dssp-buffer-size=3D=
4 -Wformat -Werror=3Dformat-security -D_FORTIFY_SOURCE=3D2 -fPIC -I/usr/lib=
/perl/5.18/CORE -I/usr/include/python3.4m -I/home/losintikfos/git/testproj/=
env/include/python3.4m -c src/perlxsi.c -o build/temp.linux-x86_64-3.4/src/=
perlxsi.o -O0 -g3 -Wall -c -fmessage-length=3D0 -Wl,-E -fstack-protector -L=
/usr/local/lib -L/usr/lib/perl/5.18/CORE -lperl -ldl -lm -lpthread -lc -lcr=
ypt -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -I/usr/l=
ocal/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=3D64 -I/usr/lib/perl/5=
.18/CORE<br><br>x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall=
 -Wstrict-prototypes -g -fstack-protector --param=3Dssp-buffer-size=3D4 -Wf=
ormat -Werror=3Dformat-security -D_FORTIFY_SOURCE=3D2 -fPIC -I/usr/lib/perl=
/5.18/CORE -I/usr/include/python3.4m -I/home/losintikfos/git/testproj/env/i=
nclude/python3.4m -c src/perlmechanize.c -o build/temp.linux-x86_64-3.4/src=
/perlmechanize.o -O0 -g3 -Wall -c -fmessage-length=3D0 -Wl,-E -fstack-prote=
ctor -L/usr/local/lib -L/usr/lib/perl/5.18/CORE -lperl -ldl -lm -lpthread -=
lc -lcrypt -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -=
I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=3D64 -I/usr/lib=
/perl/5.18/CORE<br><br>x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-B=
symbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-fun=
ctions -Wl,-z,relro -g -fstack-protector --param=3Dssp-buffer-size=3D4 -Wfo=
rmat -Werror=3Dformat-security -D_FORTIFY_SOURCE=3D2 build/temp.linux-x86_6=
4-3.4/src/perlxsi.o build/temp.linux-x86_64-3.4/src/perlmechanize.o build/t=
emp.linux-x86_64-3.4/src/pymechanize.o -lperl -o build/lib.linux-x86_64-3.4=
/<a href=3D"http://pymechanize.cpython-34m.so">pymechanize.cpython-34m.so</=
a><br><br></div>Which works fine.<br><br></div>My problem is - when I impor=
t calls from my extension module <a href=3D"http://pymechanize.cpython-34m.=
so">pymechanize.cpython-34m.so</a> I get below error:<br><br><br>Can&#39;t =
load &#39;/usr/local/lib/perl/5.18.2/auto/Encode/Encode.so&#39; for module =
Encode: /usr/local/lib/perl/5.18.2/auto/Encode/Encode.so: undefined symbol:=
 PL_utf8skip at /usr/share/perl/5.18/XSLoader.pm line 68.<br>=C2=A0at /usr/=
local/lib/perl/5.18.2/Encode.pm line 10.<br>Compilation failed in require a=
t /usr/local/share/perl/5.18.2/HTML/Form.pm line 6.<br>BEGIN failed--compil=
ation aborted at /usr/local/share/perl/5.18.2/HTML/Form.pm line 6.<br>Compi=
lation failed in require at /usr/local/share/perl/5.18.2/WWW/Mechanize.pm l=
ine 133.<br>BEGIN failed--compilation aborted at /usr/local/share/perl/5.18=
.2/WWW/Mechanize.pm line 133.<br>Compilation failed in require.<br>BEGIN fa=
iled--compilation aborted.<br>Attempt to reload WWW/Mechanize.pm aborted.<b=
r>Compilation failed in require at (eval 9) line 1.<br>BEGIN failed--compil=
ation aborted at (eval 9) line 1.<br><br><br></div>For almost two weeks now=
 I have tried various options - including reinstalling Encode.pm but to no =
luck. I can see the symbol is there when I do:<br><br>nm /usr/local/lib/per=
l/5.18.2/auto/Encode/Encode.so | grep PL_utf8skip<br><br></div>Do anyone kn=
ow what might be causing this?<br><br></div>-Bright<br></div>

--047d7ba9803ca0fea7051b8e011c--