[issue12936] armv5tejl segfaults: sched_setaffinity() vs. pthread_setaffinity_np()

2011-09-16 Thread Stefan Krah
Stefan Krah added the comment: I cannot reproduce the crash on: Linux debian-armel 2.6.32-5-versatile #1 Wed Jan 12 23:05:11 UTC 2011 armv5tejl GNU/Linux Since the old (arm) port is deprecated, I'm closing this. -- resolution: -> wont fix stage: test needed -> committed/rejected st

[issue12936] armv5tejl segfaults: sched_setaffinity() vs. pthread_setaffinity_np()

2011-09-14 Thread Charles-François Natali
Charles-François Natali added the comment: > I'd prefer to disable the misbehaving functions entirely on arm. -10 If we start disabling features on platforms with partly bogus implementations, we might as well drop threading on OpenBSD, sendmsg() on OS-X, etc. Furthermore, it's really just a

[issue12936] armv5tejl segfaults: sched_setaffinity() vs. pthread_setaffinity_np()

2011-09-14 Thread Stefan Krah
Stefan Krah added the comment: I'd prefer to disable the misbehaving functions entirely on arm. With the patch this combination of tests now works: ./python -m test -uall test_posix test_nntplib If you think the patch is good, I can run the whole test suite, too. [I'd rather wait for review

[issue12936] armv5tejl segfaults: sched_setaffinity() vs. pthread_setaffinity_np()

2011-09-13 Thread Charles-François Natali
Charles-François Natali added the comment: > Do you mean that signal.pthread_kill() should be removed? This function is > very useful and solve some issues that cannot be solved differently. At the > same time, I don't think that it's possible to workaround the crashes. At > least, I don't se

[issue12936] armv5tejl segfaults: sched_setaffinity() vs. pthread_setaffinity_np()

2011-09-13 Thread STINNER Victor
STINNER Victor added the comment: > as noted by Victor, it's really easy to crash the interpreter > by passing an invalid thread ID, which IMHO, should be avoided > at all cost Do you mean that signal.pthread_kill() should be removed? This function is very useful and solve some issues that can

[issue12936] armv5tejl segfaults: sched_setaffinity() vs. pthread_setaffinity_np()

2011-09-13 Thread Charles-François Natali
Charles-François Natali added the comment: > If we have access (and as I understood from Victor's post we do): > pthread_getaffinity_np() also exists on FreeBSD, which would be > an advantage. Yes, but I see several drawbacks: - as noted by Victor, it's really easy to crash the interpreter by p

[issue12936] armv5tejl segfaults: sched_setaffinity() vs. pthread_setaffinity_np()

2011-09-13 Thread Stefan Krah
Stefan Krah added the comment: Charles-François Natali wrote: > Out of curiosity, I just looked at the source code, and it just does > sched_setaffinity(thread->tid), so you can do the same with > sched_setaffinity(syscall(SYS_gettid)) for the current thread. sched_setaffinity(syscall(SYS_gett

[issue12936] armv5tejl segfaults: sched_setaffinity() vs. pthread_setaffinity_np()

2011-09-13 Thread STINNER Victor
STINNER Victor added the comment: > However, I don't think we should/could add this to the posix module: > it expects a pthread_t instead of a PID, to which we don't have access. We already have such function: http://docs.python.org/dev/library/signal.html#signal.pthread_kill I added threadin

[issue12936] armv5tejl segfaults: sched_setaffinity() vs. pthread_setaffinity_np()

2011-09-13 Thread Charles-François Natali
Charles-François Natali added the comment: > I think I got it: pthread_setaffinity_np() does not crash. Nice. Out of curiosity, I just looked at the source code, and it just does sched_setaffinity(thread->tid), so you can do the same with sched_setaffinity(syscall(SYS_gettid)) for the current

[issue12936] armv5tejl segfaults: sched_setaffinity() vs. pthread_setaffinity_np()

2011-09-13 Thread Stefan Krah
Stefan Krah added the comment: I think I got it: pthread_setaffinity_np() does not crash. `man sched_setaffinity` is slightly ambiguous, but there is this remark: (If you are using the POSIX threads API, then use pthread_setaffinity_np(3) instead of sched_setaffinity().) I'm attachin