Thread: Pl/Tcl problem

Pl/Tcl problem

From
Alvaro Herrera
Date:
Hello:

I'm having trouble creating the Pl/Tcl language in RedHat Linux 7.1.
When I issue the createlang command I get this:

[replicator@att-stgo-1 replicator]$ createlang -L /usr/lib/pgsql pltcl
replicator
ERROR:  Load of file /usr/lib/pgsql/pltcl.so failed:
/usr/lib/pgsql/pltcl.so: undefined symbol: Tcl_CreateSlave
createlang: language installation failed

Of course /usr/lib/pgsql/pltcl.so exists, and /usr/lib/libtcl8.3.so does
exist also. They both were installed via the RedHat 7.1.3 RPMs (not
Lamar Owen ones). Strange thing is Tcl_CreateSlave is defined in
/usr/lib/libtcl8.3.so, which is not in the output of ldd here in RedHat.
BUT I've succesfully installed Pl/Tcl from source (7.2b4) at home in
Mandrake Linux and libtcl8.3.so appears in the ldd output for pltcl.so.
I don't know what to think, and have no idea whatsoever about Tcl for
debugging this kind of stuff.

Of course I don't think the RPMs are flawed, but I can't find what the
problem is. Any clue?

Thanks,

--
Alvaro Herrera (<alvherre@atentus.com>)


Re: Pl/Tcl problem

From
Tom Lane
Date:
First guess is that libtcl.so is not in the ldconfig database.

            regards, tom lane

Re: Pl/Tcl problem

From
teg@redhat.com (Trond Eivind Glomsrød)
Date:
Alvaro Herrera <alvherre@atentus.com> writes:

> Hello:
>
> I'm having trouble creating the Pl/Tcl language in RedHat Linux 7.1.
> When I issue the createlang command I get this:
>
> [replicator@att-stgo-1 replicator]$ createlang -L /usr/lib/pgsql pltcl
> replicator
> ERROR:  Load of file /usr/lib/pgsql/pltcl.so failed:
> /usr/lib/pgsql/pltcl.so: undefined symbol: Tcl_CreateSlave
> createlang: language installation failed
>
> Of course /usr/lib/pgsql/pltcl.so exists, and /usr/lib/libtcl8.3.so does
> exist also. They both were installed via the RedHat 7.1.3 RPMs (not
> Lamar Owen ones). Strange thing is Tcl_CreateSlave is defined in
> /usr/lib/libtcl8.3.so, which is not in the output of ldd here in RedHat.
> BUT I've succesfully installed Pl/Tcl from source (7.2b4) at home in
> Mandrake Linux and libtcl8.3.so appears in the ldd output for pltcl.so.
> I don't know what to think, and have no idea whatsoever about Tcl for
> debugging this kind of stuff.
>
> Of course I don't think the RPMs are flawed, but I can't find what the
> problem is. Any clue?

The language module for tcl is created with soname libtcl.so.0. This
is the same soname used by libtcl... creating confusion for the linker.

--
Trond Eivind Glomsrød
Red Hat, Inc.

Re: Pl/Tcl problem

From
teg@redhat.com (Trond Eivind Glomsrød)
Date:
Tom Lane <tgl@sss.pgh.pa.us> writes:

> First guess is that libtcl.so is not in the ldconfig database.


Nah, the problem is that the module is created like this:

gcc -pipe -shared -Wl,-soname,libtcl.so.0 -o pltcl.so pltcl.o -L/usr/lib -ltcl -ldl  -lieee -lm -lc

The pltcl.so module thus has soname libtcl.so.0. That leads to
problems, as the same soname is used by the tcl library.

--
Trond Eivind Glomsrød
Red Hat, Inc.

Re: Pl/Tcl problem

From
Tom Lane
Date:
teg@redhat.com (Trond Eivind =?iso-8859-1?q?Glomsr=F8d?=) writes:
> Nah, the problem is that the module is created like this:
> gcc -pipe -shared -Wl,-soname,libtcl.so.0 -o pltcl.so pltcl.o -L/usr/lib -ltcl -ldl  -lieee -lm -lc
> The pltcl.so module thus has soname libtcl.so.0. That leads to
> problems, as the same soname is used by the tcl library.

Ugh.  Is this our fault, or Tcl's?

            regards, tom lane

Re: Pl/Tcl problem

From
Trond Eivind Glomsrød
Date:
On Sat, 15 Dec 2001, Tom Lane wrote:

> teg@redhat.com (Trond Eivind =?iso-8859-1?q?Glomsr=F8d?=) writes:
> > Nah, the problem is that the module is created like this:
> > gcc -pipe -shared -Wl,-soname,libtcl.so.0 -o pltcl.so pltcl.o -L/usr/lib -ltcl -ldl  -lieee -lm -lc
> > The pltcl.so module thus has soname libtcl.so.0. That leads to
> > problems, as the same soname is used by the tcl library.
>
> Ugh.  Is this our fault, or Tcl's?

I'm not sure. One thing which probably affects it, is that we have a
proper soname for libtcl (in addition to the nonstandard library name),
which we're trying to upstream. What I'm not sure of is where soname for
the postgresql tcl module comes from - "libtcl.so.0" is not a sane one to
use.

--
Trond Eivind Glomsrød
Red Hat, Inc.


Re: Pl/Tcl problem

From
Alvaro Herrera
Date:
On Sat, 15 Dec 2001, Trond Eivind Glomsrød wrote:

> On Sat, 15 Dec 2001, Tom Lane wrote:
>
> > teg@redhat.com (Trond Eivind =?iso-8859-1?q?Glomsr=F8d?=) writes:
> > > Nah, the problem is that the module is created like this:
> > > gcc -pipe -shared -Wl,-soname,libtcl.so.0 -o pltcl.so pltcl.o -L/usr/lib -ltcl -ldl  -lieee -lm -lc
> > > The pltcl.so module thus has soname libtcl.so.0. That leads to
> > > problems, as the same soname is used by the tcl library.
> >
> > Ugh.  Is this our fault, or Tcl's?
>
> I'm not sure. One thing which probably affects it, is that we have a
> proper soname for libtcl (in addition to the nonstandard library name),
> which we're trying to upstream. What I'm not sure of is where soname for
> the postgresql tcl module comes from - "libtcl.so.0" is not a sane one to
> use.

I'd say it's the RPM packaging, for my problem was solved as soon as I
used the source version of pltcl.so without touching Tcl or anything
else. Can't prove that though.

--
Alvaro Herrera (<alvherre[@]atentus.com>)
"Los romanticos son seres que mueren de deseos de vida"


Re: Pl/Tcl problem

From
Tom Lane
Date:
=?ISO-8859-1?Q?Trond_Eivind_Glomsr=F8d?= <teg@redhat.com> writes:
> On Sat, 15 Dec 2001, Tom Lane wrote:
>> teg@redhat.com (Trond Eivind =?iso-8859-1?q?Glomsr=F8d?=) writes:
>>> Nah, the problem is that the module is created like this:
>>> gcc -pipe -shared -Wl,-soname,libtcl.so.0 -o pltcl.so pltcl.o -L/usr/lib -ltcl -ldl  -lieee -lm -lc
>>> The pltcl.so module thus has soname libtcl.so.0. That leads to
>>> problems, as the same soname is used by the tcl library.
>>
>> Ugh.  Is this our fault, or Tcl's?

> I'm not sure. One thing which probably affects it, is that we have a
> proper soname for libtcl (in addition to the nonstandard library name),
> which we're trying to upstream. What I'm not sure of is where soname for
> the postgresql tcl module comes from - "libtcl.so.0" is not a sane one to
> use.

It looks like src/pl/tcl/Makefile uses this to build pltcl.so:

%$(TCL_SHLIB_SUFFIX): %.o
    $(TCL_SHLIB_LD) -o $@ $< $(TCL_LIB_SPEC) $(SHLIB_EXTRA_LIBS)

where TCL_SHLIB_LD is taken verbatim from tclConfig.sh.  I infer that
on your platform, TCL_SHLIB_LD expands to
    gcc -pipe -shared -Wl,-soname,libtcl.so.0
which is a somewhat reasonable thing for it to expand to when building
libtcl.so, but not really what we want for pltcl :-(

Perhaps we should abandon the idea of relying on Tcl's definitions to
tell us how to build the shlib.  IIRC, that decision was made a long
time ago before we had the present Makefile.shlib support, when it made
sense to assume Tcl might know more than we do about how to build
shlibs.

But I'm not sure that this has anything to do with Alvaro's problem.
The bogus choice of soname has doubtless been that way for awhile,
and yet we've not had other complaints.

            regards, tom lane

Re: Pl/Tcl problem

From
teg@redhat.com (Trond Eivind Glomsrød)
Date:
Tom Lane <tgl@sss.pgh.pa.us> writes:

> But I'm not sure that this has anything to do with Alvaro's problem.
> The bogus choice of soname has doubtless been that way for awhile,
> and yet we've not had other complaints.

Biggest reason: Hardly anyone uses tcl.

We've shipped it that way, and there was one complaint month after we
shipped... Comparing that to feedback on other areas in the same
package, I just don't think the tcl functionality is used much. Tcl is
exactly all the rage anymore.

--
Trond Eivind Glomsrød
Red Hat, Inc.

Re: Pl/Tcl problem

From
"Ian Harding"
Date:
Oooooh.  Harsh.  I use tcl exclusively.  I have not had any problem and am keeping up with the latest versions of
PostgreSQL.

<comedy_not_invitation_to_flame>

Maybe hardly anyone who uses tcl runs RedHat?  ;^)

<\comedy_not_invitation_to_flame>


Ian A. Harding
Programmer/Analyst II
Tacoma-Pierce County Health Department
(253) 798-3549
mailto: iharding@tpchd.org

>>> Trond Eivind Glomsrød <teg@redhat.com> 12/15/01 09:17AM >>>
Tom Lane <tgl@sss.pgh.pa.us> writes:

> But I'm not sure that this has anything to do with Alvaro's problem.
> The bogus choice of soname has doubtless been that way for awhile,
> and yet we've not had other complaints.

Biggest reason: Hardly anyone uses tcl.

We've shipped it that way, and there was one complaint month after we
shipped... Comparing that to feedback on other areas in the same
package, I just don't think the tcl functionality is used much. Tcl is
exactly all the rage anymore.

--
Trond Eivind Glomsrød
Red Hat, Inc.

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster


Re: Pl/Tcl problem

From
teg@redhat.com (Trond Eivind Glomsrød)
Date:
Bruce Momjian <pgman@candle.pha.pa.us> writes:

> > Oooooh.  Harsh.  I use tcl exclusively.  I have not had any problem and am keeping up with the latest versions of
PostgreSQL.
> >
> > <comedy_not_invitation_to_flame>
> >
> > Maybe hardly anyone who uses tcl runs RedHat?  ;^)
> >
> > <\comedy_not_invitation_to_flame>
>
> If not Tcl/Tk, I was wondering what other scripting language people use
> to write X apps?  Python?  Perl/Tk?  Hard to argue these are
> particularly better than Tcl/Tk, especially for small apps.

X? Python + glade is used a lot, Perl-GTK is also popular. Or you
write it in C or C++ (kde). Perhaps even java. I haven't seen much
use of tcl/tk for this in years.

(FWIW, we had a few tcl/tk in Red Hat Linux a couple of years
ago. All the ones we made are gone, and the ones in most apps as well)
--
Trond Eivind Glomsrød
Red Hat, Inc.

Re: Pl/Tcl problem

From
Bruce Momjian
Date:
> Oooooh.  Harsh.  I use tcl exclusively.  I have not had any problem and am keeping up with the latest versions of
PostgreSQL.
>
> <comedy_not_invitation_to_flame>
>
> Maybe hardly anyone who uses tcl runs RedHat?  ;^)
>
> <\comedy_not_invitation_to_flame>

If not Tcl/Tk, I was wondering what other scripting language people use
to write X apps?  Python?  Perl/Tk?  Hard to argue these are
particularly better than Tcl/Tk, especially for small apps.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Re: Pl/Tcl problem

From
Darren Ferguson
Date:
It is everyone's choice and API.

I use the pltcl because i use tcl when using aolserver. It is very good
and i know a lot of other people who use the tcl api also.

However i am not taking anything away from perl,python and the other
languages because they are all good in their own way

My 2 cents

Darren


Darren Ferguson
Software Engineer
Openband

On Mon, 17 Dec 2001, Bruce Momjian wrote:

> > Oooooh.  Harsh.  I use tcl exclusively.  I have not had any problem and am keeping up with the latest versions of
PostgreSQL.
> >
> > <comedy_not_invitation_to_flame>
> >
> > Maybe hardly anyone who uses tcl runs RedHat?  ;^)
> >
> > <\comedy_not_invitation_to_flame>
>
> If not Tcl/Tk, I was wondering what other scripting language people use
> to write X apps?  Python?  Perl/Tk?  Hard to argue these are
> particularly better than Tcl/Tk, especially for small apps.
>
> --
>   Bruce Momjian                        |  http://candle.pha.pa.us
>   pgman@candle.pha.pa.us               |  (610) 853-3000
>   +  If your life is a hard drive,     |  830 Blythe Avenue
>   +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
>


Re: Pl/Tcl problem

From
Lamar Owen
Date:
On Monday 17 December 2001 12:24 pm, Trond Eivind Glomsrød wrote:
> (FWIW, we had a few tcl/tk in Red Hat Linux a couple of years
> ago. All the ones we made are gone, and the ones in most apps as well)

The tcl/tk configuration apps.... Ugh.

Well, in any case, there is a problem with the pl/tcl build.  The
/usr/lib/tclConfig.sh on RH 7.2 defines:
# Base command to use for combining object files into a shared library:
TCL_SHLIB_LD='gcc -pipe -shared -Wl,-soname,libtcl.so.0'

So this is where it comes from.  Now, why does it work with a non-RPM
installation?

A patch is in order --but to what?  Hmmm.....
--
Lamar Owen
WGCR Internet Radio
1 Peter 4:11

Re: Pl/Tcl problem

From
Trond Eivind Glomsrød
Date:
On Mon, 17 Dec 2001, Lamar Owen wrote:

> On Monday 17 December 2001 12:24 pm, Trond Eivind Glomsrød wrote:
> > (FWIW, we had a few tcl/tk in Red Hat Linux a couple of years
> > ago. All the ones we made are gone, and the ones in most apps as well)
>
> The tcl/tk configuration apps.... Ugh.
>
> Well, in any case, there is a problem with the pl/tcl build.  The
> /usr/lib/tclConfig.sh on RH 7.2 defines:
> # Base command to use for combining object files into a shared library:
> TCL_SHLIB_LD='gcc -pipe -shared -Wl,-soname,libtcl.so.0'

That's for building libtcl. Not for building other libraries - they should
obviously have a different soname.

--
Trond Eivind Glomsrød
Red Hat, Inc.


Re: Pl/Tcl problem

From
Alvaro Herrera
Date:
On Mon, 17 Dec 2001, Lamar Owen wrote:

> On Monday 17 December 2001 12:24 pm, Trond Eivind Glomsrød wrote:
> > (FWIW, we had a few tcl/tk in Red Hat Linux a couple of years
> > ago. All the ones we made are gone, and the ones in most apps as well)
>
> The tcl/tk configuration apps.... Ugh.
>
> Well, in any case, there is a problem with the pl/tcl build.  The
> /usr/lib/tclConfig.sh on RH 7.2 defines:
> # Base command to use for combining object files into a shared library:
> TCL_SHLIB_LD='gcc -pipe -shared -Wl,-soname,libtcl.so.0'
>
> So this is where it comes from.  Now, why does it work with a non-RPM
> installation?

I compiled it on a non-RedHat installation and then copied the file.
There was too much trouble involved in compiling directly in the RH
server, so I used my own workstation instead. I don't know if it works
compiling on RedHat.


--
Alvaro Herrera (<alvherre[@]atentus.com>)
"God is real, unless declared as int"