[Python-bugs-list] [Bug #128973] OpenBSD Problems with _funlockfile in fileobject.c

noreply@sourceforge.net noreply@sourceforge.net
Thu, 15 Feb 2001 03:33:44 -0800


Bug #128973, was updated on 2001-Jan-15 21:12
Here is a current snapshot of the bug.

Project: Python
Category: Python Interpreter Core
Status: Open
Resolution: Works For Me
Bug Group: Platform-specific
Priority: 3
Submitted by: jpettit
Assigned to : twouters
Summary: OpenBSD Problems with _funlockfile in fileobject.c

Details: When I compile the current CVS version of Python on OpenBSD 2.8, I
get the following linker error:

    ld: _funlockfile: non-function jmpslot
    collect2: ld returned 1 exit status
    *** Error code 1

This function was first added to Python in version 2.97 of "fileobject.c".

Follow-Ups:

Date: 2001-Feb-15 03:33
By: twouters

Comment:
Lowered priority and set resolution to 'works for me' because it does work
for me. Leaving it open for a bit more, to give jpettit a chance to react
and possibly disagree.

-------------------------------------------------------

Date: 2001-Feb-02 07:54
By: twouters

Comment:
Testing the current CVS tree on ltratt's offered OpenBSD machine
(OpenBSD-stable 2.8 on i386) I can't reproduce the problem. I do see these
slightly suspicious messages though:

ld: libpython2.1.a(fileobject.o): RRS text relocation at 0x2d5ec for
"_flockfile"
ld: libpython2.1.a(fileobject.o): RRS text relocation at 0x2d633 for
"_funlockfile"

I suspect this is fixed by an update/patch/whatever OpenBSD uses to one of
the development tools (gcc, ld, libc, whatever OpenBSD uses :)
Unless there was some other difference between the machines of jpettit and
ltratt ?

-------------------------------------------------------

Date: 2001-Feb-02 07:34
By: twouters

Comment:
I've volunteered myself to debug this, on OpenBSD, using the provided
account.



-------------------------------------------------------

Date: 2001-Jan-25 10:38
By: ltratt

Comment:
I'd be happy to offer any of the Python developers an account on an OpenBSD
machine if they wish - mail tratt@dcs.kcl.ac.uk
-------------------------------------------------------

Date: 2001-Jan-18 19:32
By: gvanrossum

Comment:
Alas, it seems that this will remain open in 2.1a1.  Hopefully someone else
will be able to fix it once the alpha1 release is out.

-------------------------------------------------------

Date: 2001-Jan-16 11:58
By: jpettit

Comment:
The man page doesn't seem to specify a particular library to link against. 
It only says to include stdio.h.

I'm building Python without any special flags.  I thought threads were
enabled by default, but just for good measure, I ran configure with
--with-threads and got the same results.

I don't see any reference to flockfile/funlockfile in config.log.
-------------------------------------------------------

Date: 2001-Jan-16 11:00
By: twouters

Comment:
Unfortunately, I don't have access to OpenBSD, just FreeBSD and BSDI.
flockfile/funlockfile both work fine there. I suspect it's a header/library
problem: maybe we need to include a separate header/library, which we for
some reason do in the configure process, but not in the linking of Python
(or maybe it needs additional magic to link together with other libraries,
I don't know.)

jpettit, can you check the manpage for funlockfile to see what headerfiles
should be included, and perhaps what to link with ? Also, are you compiling
threaded or unthreaded ? There is a good chance the flockfile/funlockfile
functions are only available in threaded code, or maybe Python is being
compiled half-threaded for some reason. Checking to see the difference
between what config.log and 'make' say might give some hints, too.

Or it could just be an OS bug :P We should be able to figure it out though:
if Python can't *compile* with those functions, neither should configure.

-------------------------------------------------------

Date: 2001-Jan-16 09:56
By: jpettit

Comment:
I'd be happy to help however I can.  However, autoconf is black magic to
me.  

I think that funlockfile is supposed to be available...there is even a man
page dated 20 August 1998.  This may be another case of OpenBSD improperly
integrating components from the other BSDs.

Please let me know what I can do.
-------------------------------------------------------

Date: 2001-Jan-16 05:28
By: gvanrossum

Comment:
It's gotta be more complicated that that.  The configure script has a test
program that calls flockfile(), getc_unlocked(), and funlockfile().  Only
if this test program links successfully does it decide to use
getc_unlocked().  (Making the test depend on successfully *running* it
shouldn't make a difference -- the user here got a link-time error.)

jpettit, is there a way you could find out why the configure test succeeds
but then you get a link error linking Python?

I'll also ask Thomas Wouters to look into this.

-------------------------------------------------------

Date: 2001-Jan-15 22:19
By: tim_one

Comment:
Ho ho ho:  so this means some flavor of Unix has getc_unlocked() but not
the flockfile() and funlockfile() that are supposed to come with it?  Man,
Windows looks better every day <wink> -- and so does the
getline_via_fgets() hack ...

-------------------------------------------------------

For detailed info, follow this link:
http://sourceforge.net/bugs/?func=detailbug&bug_id=128973&group_id=5470