[issue23395] _thread.interrupt_main() errors if SIGINT handler in SIG_DFL, SIG_IGN

2019-09-26 Thread Marcin Gozdalik


Marcin Gozdalik  added the comment:

A program which failed under Python 3.6 with

TypeError: 'int' object is not callable

still fails under Python 3.7.4 with same exception:

import signal
import os
import sys
import time

import multiprocessing

def fail():
def handler(*args):
pass

while True:
signal.signal(signal.SIGUSR1, signal.SIG_IGN)
signal.signal(signal.SIGUSR1, handler)

proc = multiprocessing.Process(target=fail)
proc.start()
time.sleep(1)
pid = proc.pid

i = 0
try:
while proc.is_alive():
print("\r", end='')
print(i, end='')
i += 1
os.kill(pid, signal.SIGUSR1)
time.sleep(0.001)
finally:
proc.join()

--
nosy: +gozdal

___
Python tracker 
<https://bugs.python.org/issue23395>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35534] SIGSEGV in stackdepth_walk

2018-12-19 Thread Marcin Gozdalik


Marcin Gozdalik  added the comment:

#0  0x004f4af3 in stackdepth_walk (maxdepth=5, depth=3, b=, c=) at ../Python/compile.c:3436
#1  stackdepth_walk (maxdepth=, depth=0, b=, 
c=0x7fff4f5b84f0) at ../Python/compile.c:3456
#2  stackdepth (c=0x7fff4f5b84f0) at ../Python/compile.c:3486
#3  makecode.isra.19 (c=0x7fff4f5b84f0) at ../Python/compile.c:3854
#4  assemble.lto_priv () at ../Python/compile.c:3960
#5  0x004e31ad in compiler_mod (mod=0x10456d8, c=0x7fff4f5b84f0) at 
../Python/compile.c:1212
#6  PyAST_Compile () at ../Python/compile.c:292
#7  0x0051e6b0 in Py_CompileStringFlags (
str=0x11c9e54 "try:\nfrom urllib.parse import urljoin\nexcept 
ImportError:\nfrom urlparse import urljoin\n\n\ntry:\nimport cPickle as 
pickle\nexcept ImportError:\nimport pickle\n\n\n# Handle the case where the 
r"..., 
filename=filename@entry=0x7f42be6fb054 
"/usr/share/python-wheels/CacheControl-0.11.5-py2.py3-none-any.whl/cachecontrol/compat.py",
 start=start@entry=257, 
flags=flags@entry=0x0) at ../Python/pythonrun.c:1433
#8  0x0051c924 in compile_source (
source='try:\nfrom urllib.parse import urljoin\nexcept ImportError:\n   
 from urlparse import urljoin\n\n\ntry:\nimport cPickle as pickle\nexcept 
ImportError:\nimport pickle\n\n\n# Handle the case where the requests 
module has been patched to not have\n# urllib3 bundled as part of its 
source.\ntry:\nfrom requests.packages.urllib3.response import 
HTTPResponse\nexcept ImportError:\nfrom urllib3.response import 
HTTPResponse\n\ntry:\nfrom requests.packages.urllib3.util import 
is_fp_closed\nexcept ImportError:\nfrom urllib3.util import 
is_fp_closed\n', pathname=0x7f42be6fb054 
"/usr/share/python-wheels/CacheControl-0.11.5-py2.py3-none-any.whl/cachecontrol/compat.py")
at ../Modules/zipimport.c:1148
#9  get_code_from_data.isra.2 (

toc_entry=('/usr/share/python-wheels/CacheControl-0.11.5-py2.py3-none-any.whl/cachecontrol/compat.py',
 8, 216, 548, 7375, 42352, 18741, 1691478637), mtime=, 
isbytecode=0) at ../Modules/zipimport.c:1222
#10 get_module_code.lto_priv () at ../Modules/zipimport.c:1263
#11 0x00532b72 in zipimporter_load_module.lto_priv () at 
../Modules/zipimport.c:320
#12 0x004a587e in PyObject_Call () at ../Objects/abstract.c:2546
#13 0x004cdd9d in call_function_tail 
(args=('pip._vendor.cachecontrol.compat',), 
callable=) at ../Objects/abstract.c:2578
#14 PyObject_CallMethod () at ../Objects/abstract.c:2653
#15 0x004a4be1 in import_submodule.lto_priv () at 
../Python/import.c:2722
#16 0x004a42d9 in load_next (p_buflen=, 
buf=0x1042cf0 "pip._vendor.cachecontrol.compat", p_name=, 
altmod=, 
mod=) at ../Python/import.c:2537
#17 import_module_level.isra.3 (level=0, fromlist=('HTTPResponse', 'pickle'), 
globals=, name=) at ../Python/import.c:2246
#18 PyImport_ImportModuleLevel () at ../Python/import.c:2310
#19 0x004a5ae4 in builtin___import__ () at ../Python/bltinmodule.c:49
#20 0x004a587e in PyObject_Call () at ../Objects/abstract.c:2546
#21 0x004c5ef0 in PyEval_CallObjectWithKeywords () at 
../Python/ceval.c:4219
#22 0x004bec4b in PyEval_EvalFrameEx () at ../Python/ceval.c:2622
#23 0x004b9b66 in PyEval_EvalCodeEx () at ../Python/ceval.c:3582
#24 0x004b9856 in PyEval_EvalCode (co=, 
globals=, locals=) at ../Python/ceval.c:669
#25 0x004b978f in PyImport_ExecCodeModuleEx () at ../Python/import.c:731
#26 0x00532bd0 in zipimporter_load_module.lto_priv () at 
../Modules/zipimport.c:360
#27 0x004a587e in PyObject_Call () at ../Objects/abstract.c:2546
#28 0x004cdd9d in call_function_tail 
(args=('pip._vendor.cachecontrol.serialize',), 
callable=) at ../Objects/abstract.c:2578
#29 PyObject_CallMethod () at ../Objects/abstract.c:2653
#30 0x004a4be1 in import_submodule.lto_priv () at 
../Python/import.c:2722
#31 0x004a42d9 in load_next (p_buflen=, 
buf=0x1040cd0 "pip._vendor.cachecontrol.serialize", p_name=, 
altmod=, 
mod=) at ../Python/import.c:2537
#32 import_module_level.isra.3 (level=0, fromlist=('Serializer',), 
globals=, name=) at ../Python/import.c:2246
#33 PyImport_ImportModuleLevel () at ../Python/import.c:2310
#34 0x004a5ae4 in builtin___import__ () at ../Python/bltinmodule.c:49
#35 0x004a587e in PyObject_Call () at ../Objects/abstract.c:2546
#36 0x004c5ef0 in PyEval_CallObjectWithKeywords () at 
../Python/ceval.c:4219
#37 0x004bec4b in PyEval_EvalFrameEx () at ../Python/ceval.c:2622
#38 0x004b9b66 in PyEval_EvalCodeEx () at ../Python/ceval.c:3582
#39 0x004b9856 in PyEval_EvalCode (co=, 
globals=, locals=) at ../Python/ceval.c:669
#40 0x004b978f in PyImport_ExecCodeModuleEx () at ../Python/import.c:731
#41 0x00532bd0 in zipimporter_load_module.lto_priv () at 
../Modules/zipimport.c:360
#42 0x

[issue35534] SIGSEGV in stackdepth_walk

2018-12-19 Thread Marcin Gozdalik


New submission from Marcin Gozdalik :

When running

/usr/bin/python /usr/bin/pip install --upgrade "pip < 10"

the interpreter crashed in stackdepth_walk. I've seen this crash multiple 
times, especially in our custom-compiled CPythons. Here it's 
reproduced with stock Ubuntu Xenial Python. It looks like it happens much more 
often on AMD Ryzens although it happens also on Intel CPUs.
The Ryzen is otherwise stable.

Sys details:

Python 2.7.12 (default, Nov 12 2018, 14:36:49) 
[GCC 5.4.0 20160609] on linux2

Package python-minimal 2.7.12-1~16.04 from Ubuntu Xenial

--
components: Interpreter Core
files: core.pip.8270.1545144472.xz
messages: 332129
nosy: gozdal
priority: normal
severity: normal
status: open
title: SIGSEGV in stackdepth_walk
type: crash
versions: Python 2.7, Python 3.6
Added file: https://bugs.python.org/file48006/core.pip.8270.1545144472.xz

___
Python tracker 
<https://bugs.python.org/issue35534>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com