------
plparrot crashes on CREATE FUNCTION handler.
Occurs in plparrot github HEAD with parrot-2.3.0 and parrot-2.4.0 and
pgsql CVS HEAD in ./configure CFLAGS= --enable-debug --enable-cassert
Linux CentOS 5.4 2.6.18-164.el5 #1 SMP Thu Sep 3 03:33:56 EDT 2009
i686 i686 i386 GNU/Linux
$ gcc -v
Using built-in specs.
Target: i386-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --enable-shared --enable-threads=posix
--enable-checking=release --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-libgcj-multifile
--enable-languages=c,c++,objc,obj-c++,java,fortran,ada
--enable-java-awt=gtk --disable-dssi --enable-plugin
--with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre
--with-cpu=generic --host=i386-redhat-linux
Thread model: posix
gcc version 4.1.2 20080704 (Red Hat 4.1.2-46)
regression=# CREATE FUNCTION plparrotu_call_handler ()
RETURNS language_handler AS '$libdir/plparrot' LANGUAGE C;
=== parrot-2.4.0
(gdb) c
Continuing.
warning: .dynamic section for "/lib/librt.so.1" is not at the expected address
warning: difference appears to be caused by prelink, adjusting expectations
[Thread debugging using libthread_db enabled]
[New Thread 0xb7f578d0 (LWP 24524)]
Program received signal SIGABRT, Aborted.
0x0027f402 in __kernel_vsyscall ()
(gdb) bt
#0 0x0027f402 in __kernel_vsyscall ()
#1 0x0095cdf0 in raise () from /lib/libc.so.6
#2 0x0095e701 in abort () from /lib/libc.so.6
#3 0x00c6048f in Parrot_confess (cond=0xdc4db3 "sub_pmc",
file=0xdc4d6c "src/extend.c", line=1049) at src/exceptions.c:558
#4 0x00c6318e in Parrot_ext_call (interp=0x91e1248, sub_pmc=0x0,
signature=0x1228b7 "->") at src/extend.c:1049
#5 0x0011cd89 in plparrot_secure (interp=0x91e1248) at plparrot.c:357
#6 0x0011c3a4 in _PG_init () at plparrot.c:129
#7 0x083d5b7f in internal_load_library (
libname=0x90e2f80 "/home/forcia/build/pgsql/lib/plparrot.so")
at dfmgr.c:284
#8 0x083d55da in load_external_function (
filename=0x90e32c8 "$libdir/plparrot",
funcname=0x90e3ac8 "plparrotu_call_handler", signalNotFound=1 '\001',
filehandle=0xbffc764c) at dfmgr.c:113
#9 0x08135786 in fmgr_c_validator (fcinfo=0xbffc7694) at pg_proc.c:738
#10 0x083d91b3 in OidFunctionCall1 (functionId=2247, arg1=98349) at fmgr.c:1557
#11 0x081353f9 in ProcedureCreate (
procedureName=0x913e3a4 "plparrotu_call_handler", procNamespace=2200,
replace=0 '\0', returnsSet=0 '\0', returnType=2280, languageObjectId=13,
languageValidator=2247, prosrc=0x913e3a4 "plparrotu_call_handler",
probin=0x913e4b0 "$libdir/plparrot", isAgg=0 '\0', isWindowFunc=0 '\0',
=== parrot-2.3.0
Program received signal SIGABRT, Aborted.
0x0027f402 in __kernel_vsyscall ()
(gdb) bt
#0 0x0027f402 in __kernel_vsyscall ()
#1 0x0095cdf0 in raise () from /lib/libc.so.6
#2 0x0095e701 in abort () from /lib/libc.so.6
#3 0x00479e1f in Parrot_confess (cond=0x69da28 "dir",
file=0x69d9e4 "src/packfile.c", line=1201) at src/exceptions.c:558
#4 0x004cbcfe in PackFile_add_segment (interp=0x91e0fd8, dir=0x0,
seg=0x925a9f0) at src/packfile.c:1201
#5 0x004d1d55 in PackFile_append_pbc (interp=0x91e0fd8,
filename=0x925a948
"/home/forcia/build//parrot/lib/2.3.0/library/P6object.pbc") at
src/packfile.c:4832
#6 0x004d1ea2 in compile_or_load_file (interp=0x91e0fd8, path=0x921a1f0,
file_type=PARROT_RUNTIME_FT_PBC) at src/packfile.c:4704
#7 0x004d21c6 in Parrot_load_bytecode (interp=0x91e0fd8, file_str=0x9246b08)
at src/packfile.c:4901
#8 0x00367d3a in plparrot_secure (interp=0x91e0fd8) at plparrot.c:354
#9 0x003673a4 in _PG_init () at plparrot.c:129
#10 0x083d5b7f in internal_load_library (
libname=0x90e2f80 "/home/forcia/build/pgsql/lib/plparrot.so")
at dfmgr.c:284
#11 0x083d55da in load_external_function (
filename=0x90e32c8 "$libdir/plparrot",
funcname=0x90e3ac8 "plparrotu_call_handler", signalNotFound=1 '\001',
filehandle=0xbffc764c) at dfmgr.c:113
Regards,
--
Hitoshi Harada
--
Hitoshi Harada
Thank you very much for your bug report!
PL/Parrot definitely needs at least Parrot svn rev 45961, but running
on the latest trunk is best, for now, until the embedding API is
stable.
If you look in your Postgres logs, you will probably see something like:
error:imcc:syntax error, unexpected LOADLIB ('.loadlib')
in file 'EVAL_1' line 1
src/extend.c:307: failed assertion 'sub_pmc'
I fixed this error in the latest master branch of PL/Parrot.
If you update, you may get a different error like:
ERROR: Error compiling PIR function: arg count mismatch: op #1119
'open' needs 420 given 3
STATEMENT: select isnt(test_open_plparrotu(), 42, 'open opcode is not
mocked in plperlu');
This is the bug I am trying to get around in Parrot, or figure out how
to not get bit by it.
If you have other problems or failures, feel free to sent the full output of
make clean install test
to the list, and I will do my best to help :)
Duke
--
Jonathan "Duke" Leto
jona...@leto.net
http://leto.net
I installed the latest parrot from svn and git-pull'ed plparrot as you
noted and got the same error as
> ERROR: Error compiling PIR function: arg count mismatch: op #1119
> 'open' needs 420 given 3
> STATEMENT: select isnt(test_open_plparrotu(), 42, 'open opcode is not
> mocked in plperlu');
So it looks I can play with plparrot now.
Thanks,
--
Hitoshi Harada
> I installed the latest parrot from svn and git-pull'ed plparrot as you
> noted and got the same error as
>
>> ERROR: Error compiling PIR function: arg count mismatch: op #1119
>> 'open' needs 420 given 3
>> STATEMENT: select isnt(test_open_plparrotu(), 42, 'open opcode is not
>> mocked in plperlu');
>
> So it looks I can play with plparrot now.
>
> Thanks,
Yes, this error is actually caused by a change in Parrot internals
very recently, and currently means that PL/PIRU (with is the same
thing as PL/ParrotU) does not work currently. I am working with Parrot
devs to short the issue out soon.
The gory details: We rely on fiddling with the open opcode, which was
just recently became a dynop (dynamicly loadable opcode.) A
long-standing bug with dynops and bytecode was then tickled by this,
which is where things went BORK.
Thanks again for your interest in PL/Parrot and let us know if you run
into any other issues or have ideas for more features.
Duke
> Yes, this error is actually caused by a change in Parrot internals
> very recently, and currently means that PL/PIRU (with is the same
> thing as PL/ParrotU) does not work currently. I am working with Parrot
> devs to short the issue out soon.
>
Just to clarify, PL/PIRU *does* work currently, but you cannot use the
"open" opcode in it, you have to use the "open" method on the
FileHandle object. So it is not a huge blocker, but the test suite
does currently fail because of this.
Yeah, I see fundamentals working correctly in tests, though I've not
looked deeply yet. I'll play with plparrot and later with perl6 on
plparrot in a few days.
Keep it!
--
Hitoshi Harada
> Yeah, I see fundamentals working correctly in tests, though I've not
> looked deeply yet. I'll play with plparrot and later with perl6 on
> plparrot in a few days.
>
There is a plperl6 branch on github:
http://github.com/leto/plparrot/tree/plperl6
It is still very rough, but it attempts to load perl6.pbc and gets
this error message:
Null PMC access in find_method('new_class')
current instr.: '' pc -1 ((unknown file):-1)
called from Sub 'perl6;Perl6;Compiler;main' pc 284183 ((unknown file):-1)
... call repeated 1 times
Feel free to fork on github and send pull requests!