[issue22985] Segfault on time.sleep

2014-12-06 Thread Omer Katz

Omer Katz added the comment:

So why exactly the program terminates on a system call?

2014-12-05 23:44 GMT+02:00 STINNER Victor rep...@bugs.python.org:


 STINNER Victor added the comment:

  Program received signal SIGTERM, Terminated.

 SIGTERM is not a segmentation fault. SIGSEGV is for segmentation faults.

 --
 nosy: +haypo
 resolution:  - not a bug
 status: open - closed

 ___
 Python tracker rep...@bugs.python.org
 http://bugs.python.org/issue22985
 ___


--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22985
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22985] Segfault on time.sleep

2014-12-06 Thread Omer Katz

Omer Katz added the comment:

Capturing the signal provides the following traceback:
File mt_example.py, line 10, in module
p1 = ThreadPool()
  File 
/home/omer/.virtualenvs/billiard/lib/python2.7/site-packages/billiard/pool.py,
 line 1016, in __init__
self._result_handler.start()
  File 
/home/omer/.virtualenvs/billiard/lib/python2.7/site-packages/billiard/pool.py,
 line 504, in start
super(PoolThread, self).start(*args, **kwargs)
  File 
/home/omer/.virtualenvs/billiard/lib/python2.7/site-packages/billiard/py2/dummy/__init__.py,
 line 69, in start
threading.Thread.start(self)
  File /home/omer/.pyenv/versions/2.7.8/lib/python2.7/threading.py, line 750, 
in start
self.__started.wait()
  File /home/omer/.pyenv/versions/2.7.8/lib/python2.7/threading.py, line 620, 
in wait
self.__cond.wait(timeout)
  File /home/omer/.pyenv/versions/2.7.8/lib/python2.7/threading.py, line 339, 
in wait
waiter.acquire()
  File mt_example.py, line 6, in handler
print(''.join(traceback.format_stack(frame)))

  File mt_example.py, line 10, in module
p1 = ThreadPool()
  File 
/home/omer/.virtualenvs/billiard/lib/python2.7/site-packages/billiard/pool.py,
 line 1016, in __init__
self._result_handler.start()
  File 
/home/omer/.virtualenvs/billiard/lib/python2.7/site-packages/billiard/pool.py,
 line 504, in start
super(PoolThread, self).start(*args, **kwargs)
  File 
/home/omer/.virtualenvs/billiard/lib/python2.7/site-packages/billiard/py2/dummy/__init__.py,
 line 69, in start
threading.Thread.start(self)
  File /home/omer/.pyenv/versions/2.7.8/lib/python2.7/threading.py, line 750, 
in start
self.__started.wait()
  File /home/omer/.pyenv/versions/2.7.8/lib/python2.7/threading.py, line 620, 
in wait
self.__cond.wait(timeout)
  File /home/omer/.pyenv/versions/2.7.8/lib/python2.7/threading.py, line 339, 
in wait
waiter.acquire()

The following code reproduces that traceback every time:
from billiard.pool import ThreadPool
import signal

def handler(signum, frame):
import traceback
print(''.join(traceback.format_stack(frame)))

signal.signal(signal.SIGTERM, handler)

p1 = ThreadPool()

class Foo(object):
def a(self):
print(a)
return 1

def do(self):
return p1.apply_async(self.a)


foo = Foo()
r = foo.do()

print(r.get())
p1.close()
p1.join()

I'm convinced that there is a bug somewhere and it seems that Python is the 
source of the bug.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22985
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22985] Segfault on time.sleep

2014-12-05 Thread STINNER Victor

STINNER Victor added the comment:

 Program received signal SIGTERM, Terminated.

SIGTERM is not a segmentation fault. SIGSEGV is for segmentation faults.

--
nosy: +haypo
resolution:  - not a bug
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22985
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22985] Segfault on time.sleep

2014-12-02 Thread Omer Katz

New submission from Omer Katz:

I have found what appears to be a segfualt in time.sleep but I'm not sure.
I have verified that the segfualt occurs both on Python 2.7.8 and 3.4.2.

The following program that reproduces the segfault uses my fork of billiard, a 
replacement for the multiprocessing module that is used by celery.

In order to install: pip install 
git+https://github.com/thedrow/billiard@topic/dill-with-threads

The program:
from billiard.pool import ThreadPool

p1 = ThreadPool()

class Foo(object):
def a(self):
print(a)
return 1

def do(self):
return p1.apply_async(self.a)


foo = Foo()
r = foo.do()

print(r.get())
p1.close()
p1.join()

The output from gdb:
gdb -ex r -q --args python mt_example.py
Reading symbols from python...done.
Starting program: /home/omer/.virtualenvs/billiard/bin/python mt_example.py
[Thread debugging using libthread_db enabled]
Using host libthread_db library /lib/x86_64-linux-gnu/libthread_db.so.1.
[New Thread 0x731db700 (LWP 2897)]
[New Thread 0x729da700 (LWP 2898)]
[New Thread 0x721d9700 (LWP 2899)]
[New Thread 0x719d8700 (LWP 2900)]
[New Thread 0x711d7700 (LWP 2901)]
[New Thread 0x709d6700 (LWP 2902)]
[New Thread 0x7fffdbfff700 (LWP 2903)]

Program received signal SIGTERM, Terminated.
[Switching to Thread 0x721d9700 (LWP 2899)]
0x771dc1c3 in select () at ../sysdeps/unix/syscall-template.S:81
81  ../sysdeps/unix/syscall-template.S: No such file or directory.
(gdb) bt
#0  0x771dc1c3 in select () at ../sysdeps/unix/syscall-template.S:81
#1  0x75fd5d5d in floatsleep (secs=optimized out) at 
Modules/timemodule.c:948
#2  time_sleep (self=optimized out, args=optimized out) at 
Modules/timemodule.c:206
#3  0x004b658c in call_function (oparg=optimized out, 
pp_stack=0x721d8540) at Python/ceval.c:4033
#4  PyEval_EvalFrameEx (f=f@entry=0x7463eda8, throwflag=throwflag@entry=0) 
at Python/ceval.c:2679
#5  0x004b6f6b in PyEval_EvalCodeEx (co=optimized out, 
globals=optimized out, locals=locals@entry=0x0, args=optimized out, 
argcount=argcount@entry=4, kws=optimized out, kwcount=0, 
defs=0x740bab68, defcount=1, closure=0x0) at Python/ceval.c:3265
#6  0x004b5b28 in fast_function (nk=optimized out, na=4, n=optimized 
out, pp_stack=0x721d8730, func=0x731e2938)
at Python/ceval.c:4129
#7  call_function (oparg=optimized out, pp_stack=0x721d8730) at 
Python/ceval.c:4054
#8  PyEval_EvalFrameEx (f=f@entry=0x7fffe8000b50, throwflag=throwflag@entry=0) 
at Python/ceval.c:2679
#9  0x004b6f6b in PyEval_EvalCodeEx (co=optimized out, 
globals=optimized out, locals=locals@entry=0x0, args=optimized out, 
argcount=argcount@entry=1, kws=optimized out, kwcount=0, defs=0x0, 
defcount=0, closure=0x0) at Python/ceval.c:3265
#10 0x004b5b28 in fast_function (nk=optimized out, na=1, n=optimized 
out, pp_stack=0x721d8920, func=0x731e28c0)
at Python/ceval.c:4129
#11 call_function (oparg=optimized out, pp_stack=0x721d8920) at 
Python/ceval.c:4054
#12 PyEval_EvalFrameEx (f=f@entry=0x7fffe8000910, throwflag=throwflag@entry=0) 
at Python/ceval.c:2679
#13 0x004b5bc7 in fast_function (nk=optimized out, na=1, n=optimized 
out, pp_stack=0x721d8a70, func=0x77e55230)
---Type return to continue, or q return to quit---
at Python/ceval.c:4119
#14 call_function (oparg=optimized out, pp_stack=0x721d8a70) at 
Python/ceval.c:4054
#15 PyEval_EvalFrameEx (f=f@entry=0x731f1210, throwflag=throwflag@entry=0) 
at Python/ceval.c:2679
#16 0x004b6f6b in PyEval_EvalCodeEx (co=optimized out, 
globals=optimized out, locals=locals@entry=0x0, 
args=args@entry=0x731dca68, argcount=optimized out, 
kws=kws@entry=0x0, kwcount=kwcount@entry=0, defs=defs@entry=0x0, 
defcount=defcount@entry=0, closure=0x0) at Python/ceval.c:3265
#17 0x00529e70 in function_call (func=0x77e55140, 
arg=0x731dca50, kw=0x0) at Objects/funcobject.c:526
#18 0x00422f5a in PyObject_Call (func=func@entry=0x77e55140, 
arg=arg@entry=0x731dca50, kw=kw@entry=0x0)
at Objects/abstract.c:2529
#19 0x0042747d in instancemethod_call (func=0x77e55140, 
arg=0x731dca50, kw=0x0) at Objects/classobject.c:2602
#20 0x00422f5a in PyObject_Call (func=func@entry=0x74636d70, 
arg=arg@entry=0x77f93050, kw=optimized out)
at Objects/abstract.c:2529
#21 0x004b07f7 in PyEval_CallObjectWithKeywords (func=0x74636d70, 
arg=0x77f93050, kw=optimized out) at Python/ceval.c:3902
#22 0x004fae92 in t_bootstrap (boot_raw=0x8899c0) at 
./Modules/threadmodule.c:614
#23 0x77bc40a5 in start_thread (arg=0x721d9700) at 
pthread_create.c:309
#24 0x771e484d in clone () at 
../sysdeps/unix/sysv/linux/x86_64/clone.S:111

--
components: Interpreter Core
messages: 232059
nosy: Omer.Katz
priority: normal
severity: normal
status: open
title: Segfault on time.sleep
type: