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

noreply@sourceforge.net noreply@sourceforge.net
Thu, 18 Jan 2001 19:32:30 -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: None
Bug Group: Platform-specific
Priority: 5
Submitted by: jpettit
Assigned to : gvanrossum
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-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