This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Compilation --without-threads fails
Type: compile error Stage:
Components: Versions: Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: amaury.forgeotdarc, gpolo, jnoller, pitrou, vstinner
Priority: normal Keywords: patch

Created on 2009-01-22 21:24 by pitrou, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
object_dump_nothread.patch vstinner, 2009-01-23 08:13
gil_nothread.patch vstinner, 2009-01-23 08:14
_sqlite_nothread-2.patch vstinner, 2009-03-27 01:01
_tkinter_nothread.patch vstinner, 2009-03-27 01:02
Messages (17)
msg80379 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2009-01-22 21:24
libpython2.7.a(object.o): In function `_PyObject_Dump':
/home/antoine/cpython/__svn__/Objects/object.c:341: undefined reference
to `PyGILState_Ensure'
/home/antoine/cpython/__svn__/Objects/object.c:343: undefined reference
to `PyGILState_Release'
msg80380 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2009-01-22 21:27
The problem seems to have appeared with:

[svn r67802] #3632: the "pyo" macro from gdbinit can now run when the
GIL is released.

Patch by haypo.


diff -r 68d511e1c4bc -r 584e97b40be9 Objects/object.c
--- a/Objects/object.c  Mon Dec 15 22:47:57 2008 +0100
+++ b/Objects/object.c  Mon Dec 15 23:29:14 2008 +0100
@@ -331,8 +331,11 @@
        if (op == NULL)
                fprintf(stderr, "NULL\n");
        else {
+               PyGILState_STATE gil;
                fprintf(stderr, "object  : ");
+               gil = PyGILState_Ensure();
                (void)PyObject_Print(op, stderr, 0);
+               PyGILState_Release(gil);
                /* XXX(twouters) cast refcount to long until %zd is
                   universally available */
                fprintf(stderr, "\n"
msg80400 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2009-01-23 08:13
Oops, here is a fix for my regression.
msg80401 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2009-01-23 08:14
Why is PyGILState_Ensure() defined in Include/pystate.h in there is not
thread? PyGILState_Ensure() implementation is conditional (in
Python/pystate.c). Here is a patch to make the definition optional.
msg80402 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2009-01-23 08:16
Another patch to fix _sqlite without thread support.
msg80403 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2009-01-23 08:19
_multiprocessing modules doesn't compile but I don't know how to fix it:
 - conn_poll() has a _save argument, but the argument is not used in
both conn_poll() implementations (pipe_connection.c and socket_connection.c)
 - Modules/_multiprocessing/semaphore.c contains a lot of functions and
macros for semaphore managment but it looks like thread support is
required. Eg. compilation fails on a missing symbol: sem_unlink(). The
function sem_unlink() is defined in system <semaphore.h> and requires
-lrt or -lpthread compiler flag.
msg80404 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2009-01-23 08:25
Here is a patch to remove the unused _save argument of conn_poll()
function from the _multiprocessing mode. It fixes one of the compilation
problem without thread support.
msg80405 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2009-01-23 10:28
There is already a separate issue for multiprocessing compilation: #3807
msg80406 - (view) Author: Jesse Noller (jnoller) * (Python committer) Date: 2009-01-23 11:37
Victor - there is already another bug and a pending patchbto fix  
multiprocessing when thread support is enabled. Please do not focus on  
that.
msg80407 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2009-01-23 12:07
@pitou and @jnoller: Ok ok, fine, I will check #3807.
msg80413 - (view) Author: Jesse Noller (jnoller) * (Python committer) Date: 2009-01-23 14:16
I've committed the fix for issue 3807 to resolve the mp issues.
msg84242 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2009-03-27 01:00
Python trunk is still broken --without-threads. The multiprocessing 
issue (#3807) is now closed, so can someone review (or apply?) my 
patches?
msg84244 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2009-03-27 01:01
Updated and completed patch for _sqlite module (python trunk).
msg84245 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2009-03-27 01:02
New patch _tkinter_nothread.patch: fix gcc warnings in _tkinter.
msg84282 - (view) Author: Guilherme Polo (gpolo) * (Python committer) Date: 2009-03-27 21:44
Victor, I have changed your tkinter patch a bit and applied on r70641.

The issue is marking only python 2.7 right now, aren't these changes
supposed to be applied 26-maint, py3k and 30-maint too ?
msg84292 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2009-03-27 23:42
gpolo> Victor, I have changed your tkinter patch a bit and applied on r70641.

Ok, thanks.

gpolo> The issue is marking only python 2.7 right now, aren't these changes
gpolo> supposed to be applied 26-maint, py3k and 30-maint too ?

Since it only fixes warnings, we don't have to "fix" *-maint versions. But I 
would like to see your fix in py3k (I think that trunk and py3k should be as 
close as possible).
msg101496 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2010-03-22 12:08
_tkinter patch (r70641) was backported to py3k as r70707. py3k compiles fine without threads.
History
Date User Action Args
2022-04-11 14:56:44adminsetgithub: 49285
2010-03-22 12:08:22vstinnersetstatus: open -> closed
resolution: fixed
messages: + msg101496
2009-03-27 23:42:36vstinnersetmessages: + msg84292
2009-03-27 21:44:39gpolosetmessages: + msg84282
2009-03-27 20:40:00gpolosetnosy: + gpolo
2009-03-27 01:02:21vstinnersetfiles: + _tkinter_nothread.patch

messages: + msg84245
2009-03-27 01:01:34vstinnersetfiles: + _sqlite_nothread-2.patch

messages: + msg84244
2009-03-27 01:01:09vstinnersetfiles: - _sqlite_nothread.patch
2009-03-27 01:00:06vstinnersetmessages: + msg84242
2009-01-23 14:16:17jnollersetmessages: + msg80413
2009-01-23 12:07:04vstinnersetmessages: + msg80407
2009-01-23 12:06:20vstinnersetfiles: - _multiprocessing_remove_save.patch
2009-01-23 11:37:15jnollersetmessages: + msg80406
2009-01-23 10:28:27pitrousetmessages: + msg80405
2009-01-23 08:25:26vstinnersetfiles: + _multiprocessing_remove_save.patch
messages: + msg80404
2009-01-23 08:19:44vstinnersetmessages: + msg80403
2009-01-23 08:16:11vstinnersetfiles: + _sqlite_nothread.patch
messages: + msg80402
2009-01-23 08:14:51vstinnersetfiles: + gil_nothread.patch
messages: + msg80401
2009-01-23 08:13:04vstinnersetfiles: + object_dump_nothread.patch
keywords: + patch
messages: + msg80400
2009-01-22 21:27:42pitrousetnosy: + amaury.forgeotdarc, vstinner
messages: + msg80380
2009-01-22 21:24:21pitroucreate