New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Thread not working for python 2.7.1 built with HP Compiler on HP-UX 11.31 ia64 #57266
Comments
Resending as my old alternative email ID wasn't registered under my account. I included --with-threads option into the configure script calling, which it failed to add the -D_REENTRANT into Makefile. So I manually added this into OPT of the Makefile. I ran make again and generated a new python binary. However, the new binary is still not able to start a new thread from the thread module. I reviewed the config.log file, I think this failure has caused the build with threads failed. Cthreads.h header file is missing. Should this be included in my HP UX Compiler or it comes from python source? In python source I only found pythread.h. Anyway, I am only guessing what is wrong. Hope to hear some feedback here, whether this is something missing or a bug. configure:8407: checking for --with-threads
configure:8427: result: yes
configure:8484: checking for _POSIX_THREADS in unistd.h
configure:8503: result: yes
configure:8508: checking cthreads.h usability
configure:8508: cc +DD64 -I/home/r32813/local/include -c -g conftest.c >&5
"conftest.c", line 128: error python/cpython#47946-D: cannot open source file "cthreads.h"
#include <cthreads.h>
^
1 error detected in the compilation of "conftest.c".
configure:8508: result: no
configure:8508: checking for cthreads.h
configure:8508: result: no
configure:8521: checking mach/cthreads.h usability
configure:8521: cc +DD64 -I/home/r32813/local/include -c -g conftest.c >&5
"conftest.c", line 128: error python/cpython#47946-D: cannot open source file "mach/cthreads.h"
#include <mach/cthreads.h>
^ 1 error detected in the compilation of "conftest.c". configure:8521: result: no Regards, |
Traceback? mach/cthreads.h is only relevant for Hurd, as far as I can see.
Result of this test? |
Traceback? $ python
Python 2.7.1 (r271:86832, Sep 28 2011, 17:31:02) [C] on hp-ux11
Type "help", "copyright", "credits" or "license" for more information.
>>> import thread
>>> def testing():
... print "Hello World"
...
>>> thread.start_new_thread(testing, ())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
thread.error: can't start new thread
>>> mach/cthreads.h is only relevant for Hurd, as far as I can see. I am not sure what Hurd is. So I should not be looking at this one I guess.
Result of this test? configure:8556: checking for pthread_create in -lpthread "conftest.c", line 102: error bpo-2020: identifier "NULL" is undefined 1 error detected in the compilation of "conftest.c". Python tracker <report@bugs.python.org> |
To me this looks like stdio.h should be included as well. Could |
Hello Stefan, Hmm..... how do I apply the patch? I download the issue-13057.diff file and then.....? Regards, |
"patch -p1 < issue-13057.diff" in the directory where configure is should do the trick. |
I tried.... here is the outcome. It says it can't find a patch?? $ cat issue-13057.diff
diff -r f612b783bc17 configure
--- a/configure Thu Sep 29 07:52:46 2011 +0800
+++ b/configure Thu Sep 29 21:39:32 2011 +0200
@@ -8619,6 +8619,7 @@
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <pthread.h>
+#include <stdio.h> void * start_routine (void *arg) { exit (0); } $ patch -p1 < issue-13057.diff
Hmm... I can't seem to find a patch in there anywhere.
$ pwd
/home/r32813/Build/2.7.1/Python-2.7.1
$ Regards, |
If that's a Mercurial clone of Python you can try "hg import --no-commit issue-13057.diff". Otherwise you could just edit configure manually -- the attached patch is trivial. You could also install "patch". |
Mercurial clone of python? Haha I am not sure what that is. My unix also won't recognize "hg", and will ignore "import --no-commit issue-13057.diff". I went ahead to edit configure file. Partially understanding the content of .diff file, I edited the configure and here is the difference... I will try to rebuild now... $ diff configure.original configure
8619a8620,8624
> #include <pthread.h>
> +#include <stdio.h>
>
> void * start_routine (void *arg) { exit (0); }
> int
$ Regards, |
Hello, I tried rebuild but it is still the same. :( Attached is the extract of the modified configure file, with line number at the side (from VI editor). Basically my changes are added as from line 8620 through 8624. I am not sure if this is meant to be, just my best guess from the patch file. Appreciate your advice. 8612 $as_echo_n "checking for pthread_create in -lpthreads... " >&6; } Regards, |
You just have to add:
#include <stdio.h>
just after:
#include <pthread.h> The + in the diff only means that the line was added and shouldn't be included in the file. |
Thank goodness. Let me try. Regards, |
Sorry, there a more than one entry of "#include <pthread.h>" in configure file. So do I inject everywhere? Regards, |
After the one at line 8620. |
Wow..... I added it everywhere in the file. I love you!! (Ermm... I mean, literally) It can work now. :). I will move on to migrate my application with this new python. Hopefully I don't see other modules breaking. Thanks for the GREAT helps!!! :) $ python
Python 2.7.1 (r271:86832, Sep 27 2011, 15:19:26) [C] on hp-ux11
Type "help", "copyright", "credits" or "license" for more information.
>>> import thread
>>> def test():
... print "Hello World"
...
>>> thread.start_new_thread(test,())
2
>>> Hello World Regards, |
Could you please stop putting these unrelated links into your posts? It is really annoying. Thanks. |
I put up an issue the python I build is not able to run thread.start_new_thread. Someone replied to me that there is a bug in configure file and I follow the patch and rebuild my python, my thread is working after the patch is applied. I ended that issue discussion with thanks to the person who answered me and helped me. Sorry which one is unrelated? Regards, |
Wah Meng: I think there are a couple of misconceptions that
|
1.) I see. Sorry ya, I didn't notice. They are automatically generated as my email footer. Regards, |
New changeset b4f6cd5f9ab7 by Stefan Krah in branch '2.7': |
New changeset f0baa6be2bf1 by Stefan Krah in branch '3.3': |
Fixed in 2.7, 3.3 and 3.4. |
found a redundant code (stdlib.h already defines the NULL macro) commit e33747a4b1a45acdd696a4e07bbd40ea7fb37366
diff --git a/configure b/configure ... @@ -14833,6 +14834,7 @@ else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+#include <stdio.h>
#include<stdlib.h>
int main() {
size_t len = -1; |
the hunk is from commit commit b2edc2629f5e0f11280ba9846d1a86346f4a7287
|
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: