[issue21131] test_faulthandler.test_register_chain fails on 64bit ppc/arm with kernel >= 3.10

2019-08-19 Thread STINNER Victor
STINNER Victor added the comment: > Its interesting to read the comment on the IA64 definition for SIGSTKSZ: Python doesn't support IA64 architecture. Note: I'm not sure that this architecture is going to survive in the long term... More and more systems stopped to support it. > Well, one

[issue21131] test_faulthandler.test_register_chain fails on 64bit ppc/arm with kernel >= 3.10

2019-08-15 Thread Peter Edwards
Peter Edwards added the comment: On Wed, 14 Aug 2019 at 23:13, STINNER Victor wrote: > > STINNER Victor added the comment: > > About PR 13649, I'm not sure that _PyThread_preferred_stacksize() is still > relevant, since my change fixed test_faulthandler test_register_chain(). I > chose my

[issue21131] test_faulthandler.test_register_chain fails on 64bit ppc/arm with kernel >= 3.10

2019-08-15 Thread Peter Edwards
Peter Edwards added the comment: On Wed, 14 Aug 2019 at 22:32, STINNER Victor wrote: > > We are talking abou the faulthandler_user() function of > Modules/faulthandler.c. It is implemented in pure C, it doesn't allocate > memory on the heap, it uses a very small set of functions (write(), >

[issue21131] test_faulthandler.test_register_chain fails on 64bit ppc/arm with kernel >= 3.10

2019-08-15 Thread Peter Edwards
Peter Edwards added the comment: On Wed, 14 Aug 2019 at 22:34, STINNER Victor wrote: > > ...I'm not sure that we can fix bpo-37851 in Python 3.7. That's totally reasonable, sure. -- ___ Python tracker

[issue21131] test_faulthandler.test_register_chain fails on 64bit ppc/arm with kernel >= 3.10

2019-08-14 Thread STINNER Victor
STINNER Victor added the comment: The bug has been fixed in 3.7, 3.8 and master (future 3.9) branches. I close the issue. Thanks to everyone who was involved to report the bug and help to find the root issue! The relationship between faulthandler, the Linux kernel version, CPU model, and

[issue21131] test_faulthandler.test_register_chain fails on 64bit ppc/arm with kernel >= 3.10

2019-08-14 Thread STINNER Victor
STINNER Victor added the comment: "I can confirm that on the specific hardware I could reproduce this, that PR14276 and setting the stacksize to SIGSTKSZ*2 passes the test_faulthandler test." Thanks for testing. I merged my PR. About PR 13649, I'm not sure that

[issue21131] test_faulthandler.test_register_chain fails on 64bit ppc/arm with kernel >= 3.10

2019-08-14 Thread miss-islington
miss-islington added the comment: New changeset 1581d9c405f140491791a07dca3f6166bc499ec1 by Miss Islington (bot) in branch '3.7': bpo-21131: Fix faulthandler.register(chain=True) stack (GH-15276) https://github.com/python/cpython/commit/1581d9c405f140491791a07dca3f6166bc499ec1 --

[issue21131] test_faulthandler.test_register_chain fails on 64bit ppc/arm with kernel >= 3.10

2019-08-14 Thread miss-islington
miss-islington added the comment: New changeset b8e682427a80798fec90dce31392beaf616c3e37 by Miss Islington (bot) in branch '3.8': bpo-21131: Fix faulthandler.register(chain=True) stack (GH-15276) https://github.com/python/cpython/commit/b8e682427a80798fec90dce31392beaf616c3e37 --

[issue21131] test_faulthandler.test_register_chain fails on 64bit ppc/arm with kernel >= 3.10

2019-08-14 Thread miss-islington
Change by miss-islington : -- pull_requests: +15016 pull_request: https://github.com/python/cpython/pull/15292 ___ Python tracker ___

[issue21131] test_faulthandler.test_register_chain fails on 64bit ppc/arm with kernel >= 3.10

2019-08-14 Thread miss-islington
Change by miss-islington : -- pull_requests: +15015 pull_request: https://github.com/python/cpython/pull/15291 ___ Python tracker ___

[issue21131] test_faulthandler.test_register_chain fails on 64bit ppc/arm with kernel >= 3.10

2019-08-14 Thread STINNER Victor
STINNER Victor added the comment: New changeset ac827edc493d3ac3f5b9b0cc353df1d4b418a9aa by Victor Stinner in branch 'master': bpo-21131: Fix faulthandler.register(chain=True) stack (GH-15276) https://github.com/python/cpython/commit/ac827edc493d3ac3f5b9b0cc353df1d4b418a9aa --

[issue21131] test_faulthandler.test_register_chain fails on 64bit ppc/arm with kernel >= 3.10

2019-08-14 Thread STINNER Victor
STINNER Victor added the comment: "I can understand the aversion to the waste when its never used - I can address 37851 if you like - it seems pretty simple to fix. The pedant in me must point out that it's 8M of address space, not memory. The cost on 64-bit (well, with a 47-bit user

[issue21131] test_faulthandler.test_register_chain fails on 64bit ppc/arm with kernel >= 3.10

2019-08-14 Thread STINNER Victor
STINNER Victor added the comment: "I do think SIGSTKSZ*2=16k is far too small considering the fault handler could be running arbitrary python code," We are talking abou the faulthandler_user() function of Modules/faulthandler.c. It is implemented in pure C, it doesn't allocate memory on the

[issue21131] test_faulthandler.test_register_chain fails on 64bit ppc/arm with kernel >= 3.10

2019-08-14 Thread Bennet Fauber
Bennet Fauber added the comment: I updated the versions affected to include 3.6 and 3.7, both of which are affected. I am a bit concerned that the conversation might get fragmented, so I will put in the full URL to the newly created PR at GitHub here.

[issue21131] test_faulthandler.test_register_chain fails on 64bit ppc/arm with kernel >= 3.10

2019-08-14 Thread Peter Edwards
Peter Edwards added the comment: On Wed, 14 Aug 2019 at 14:46, STINNER Victor wrote: > > STINNER Victor added the comment: > > "On a 64-bit system, consuming 8M of address space is a drop in the ocean." > > Let me disagree here. Python always allocates faulthandler stack, even if >

[issue21131] test_faulthandler.test_register_chain fails on 64bit ppc/arm with kernel >= 3.10

2019-08-14 Thread STINNER Victor
STINNER Victor added the comment: "On a 64-bit system, consuming 8M of address space is a drop in the ocean." Let me disagree here. Python always allocates faulthandler stack, even if faulthandler is not used. Even when faulthandler is used, I would prefer to not waste memory if 8 KiB is

[issue21131] test_faulthandler.test_register_chain fails on 64bit ppc/arm with kernel >= 3.10

2019-08-14 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +14999 pull_request: https://github.com/python/cpython/pull/15276 ___ Python tracker ___

[issue21131] test_faulthandler.test_register_chain fails on 64bit ppc/arm with kernel >= 3.10

2019-08-14 Thread Peter Edwards
Peter Edwards added the comment: The patch I originally proposed here ( https://bugs.python.org/file48353/sigaltstack-stacksize.patch ) is a pretty minimal fix that uses the pthread stack size where available, with a hard-coded lower bound of 1M. @Victor : if you want a minimal diff, I can

[issue21131] test_faulthandler.test_register_chain fails on 64bit ppc/arm with kernel >= 3.10

2019-08-14 Thread Bennet Fauber
Bennet Fauber added the comment: I just tested the proposed change in Aha, that's interesting: SIGSTKSZ should be enough for 1 signal handler, but test_register_chain calls 2 signal handlers using the same stack. Can you please try the following patch? ``` diff --git

[issue21131] test_faulthandler.test_register_chain fails on 64bit ppc/arm with kernel >= 3.10

2019-08-14 Thread Peter Edwards
Peter Edwards added the comment: Hi Victor, thanks for the comments. Responses inline below. On Wed, 14 Aug 2019 at 12:25, STINNER Victor wrote: > > STINNER Victor added the comment: > > I dislike PR 13649 because it touch the thread module, only to fix a > faulthandler unit test. My

[issue21131] test_faulthandler.test_register_chain fails on 64bit ppc/arm with kernel >= 3.10

2019-08-14 Thread STINNER Victor
STINNER Victor added the comment: Ah, I found the recent change about XSAVE: it is a fix for CVE-2018-3665 vulnerability. "The software mitigation for this is to switch to an "eager" / immediate FPU state save and restore, in both kernels and hypervisors." "On Intel and AMD x86 processors,

[issue21131] test_faulthandler.test_register_chain fails on 64bit ppc/arm with kernel >= 3.10

2019-08-14 Thread STINNER Victor
STINNER Victor added the comment: Ah, the cpuid command tells me "bytes required by XSAVE/XRSTOR area = 1088": CPU 0: vendor_id = "GenuineIntel" version information (1/eax): processor type = primary processor (0) family = Intel Pentium Pro/II/III/Celeron/Core/Core

[issue21131] test_faulthandler.test_register_chain fails on 64bit ppc/arm with kernel >= 3.10

2019-08-14 Thread STINNER Victor
STINNER Victor added the comment: Attached altstack.c mimicks faulthandler unit test test_register_chain(), except that faulthandler_user() uses almost no stack memory. This test should check if SIGSTKSZ is big enough to call a second signal handler from a first signal handler. Example of

[issue21131] test_faulthandler.test_register_chain fails on 64bit ppc/arm with kernel >= 3.10

2019-08-14 Thread STINNER Victor
STINNER Victor added the comment: I dislike PR 13649 because it touch the thread module, only to fix a faulthandler unit test. The relationship between thread stack size and faulthandler is not obvious to me. Currently, faulthandler uses SIGSTKSZ, not the thread stack size. faulthandler

[issue21131] test_faulthandler.test_register_chain fails on 64bit ppc/arm with kernel >= 3.10

2019-08-13 Thread Bennet Fauber
Bennet Fauber added the comment: Perhaps I should add, that we are able to reproduce this behavior on this hardware Dell R640 Intel(R) Xeon(R) Gold 6140 CPU @ 2.30GHz Dell R740 Intel(R) Xeon(R) Gold 6130 CPU @ 2.10GHz Dell R440 Intel(R) Xeon(R) Silver 4116 CPU @ 2.10GHz Dell C6420 Intel(R)

[issue21131] test_faulthandler.test_register_chain fails on 64bit ppc/arm with kernel >= 3.10

2019-08-13 Thread Bennet Fauber
Bennet Fauber added the comment: One additional note on this. Thanks to a colleague at USC who pointed out that this bug does not seem to get exercised if one does not include `--enable-shared` at configuration. I confirmed this using the distributed Python-3.7.4.tgz file and `configure

[issue21131] test_faulthandler.test_register_chain fails on 64bit ppc/arm with kernel >= 3.10

2019-05-29 Thread Peter Edwards
Change by Peter Edwards : -- pull_requests: +13543 stage: -> patch review pull_request: https://github.com/python/cpython/pull/13649 ___ Python tracker ___

[issue21131] test_faulthandler.test_register_chain fails on 64bit ppc/arm with kernel >= 3.10

2019-05-28 Thread Peter Edwards
Peter Edwards added the comment: Ok - let me submit a pull request with your suggestions On Tue, 28 May 2019 at 13:08, STINNER Victor wrote: > > STINNER Victor added the comment: > > +pthread_attr_t attrs; > +pthread_attr_init(); > +(void)pthread_attr_getstacksize(, _size); > >

[issue21131] test_faulthandler.test_register_chain fails on 64bit ppc/arm with kernel >= 3.10

2019-05-28 Thread STINNER Victor
STINNER Victor added the comment: +pthread_attr_t attrs; +pthread_attr_init(); +(void)pthread_attr_getstacksize(, _size); PyThread_start_new_thread() of thread_pthread.h already contains logic to get a "good" stack size. I would prefer to reuse this code. See also

[issue21131] test_faulthandler.test_register_chain fails on 64bit ppc/arm with kernel >= 3.10

2019-05-24 Thread Peter Edwards
Peter Edwards added the comment: Hi - we ran into what looks like exactly this issue on an x86_64 sporadically, and tracked down the root cause. When faulthandler.c uses sigaltstack(2), the stack size is set up with a buffer of size SIGSTKSZ. That is, sadly, only 8k. When a signal is

[issue21131] test_faulthandler.test_register_chain fails on 64bit ppc/arm with kernel >= 3.10

2019-05-24 Thread markmcclain
Change by markmcclain : -- nosy: +markmcclain ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue21131] test_faulthandler.test_register_chain fails on 64bit ppc/arm with kernel >= 3.10

2016-10-05 Thread STINNER Victor
STINNER Victor added the comment: > We're running into this building python 3.4.3 on EL6 ppc64. The os kernel is > 4.7.2-201.fc24.ppc64, but the EL6 chroot kernel-headers are > 2.6.32-642.4.2.el6. Any progress here? Sorry, but if I'm unable to reproduce the issue, I cannot make progress on

[issue21131] test_faulthandler.test_register_chain fails on 64bit ppc/arm with kernel >= 3.10

2016-10-04 Thread Orion Poplawski
Orion Poplawski added the comment: We're running into this building python 3.4.3 on EL6 ppc64. The os kernel is 4.7.2-201.fc24.ppc64, but the EL6 chroot kernel-headers are 2.6.32-642.4.2.el6. Any progress here? -- nosy: +opoplawski ___ Python

[issue21131] test_faulthandler.test_register_chain fails on 64bit ppc/arm with kernel = 3.10

2014-04-02 Thread Bohuslav Slavek Kabrda
New submission from Bohuslav Slavek Kabrda: test_faulthandler.test_register_chain fails on some 64bit architectures (arm8, ppc64) with kernel = 3.10: == FAIL: test_register_chain (__main__.FaultHandlerTests)

[issue21131] test_faulthandler.test_register_chain fails on 64bit ppc/arm with kernel = 3.10

2014-04-02 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21131 ___ ___ Python-bugs-list

[issue21131] test_faulthandler.test_register_chain fails on 64bit ppc/arm with kernel = 3.10

2014-04-02 Thread STINNER Victor
STINNER Victor added the comment: test_faulthandler.test_register_chain fails on some 64bit architectures (arm8, ppc64) with kernel = 3.10 I am a little bit surprised that the bug depends on the kernel version. Does test_register_chain_segfault_reproducer.py also crash with chain=False? Can

[issue21131] test_faulthandler.test_register_chain fails on 64bit ppc/arm with kernel = 3.10

2014-04-02 Thread STINNER Victor
STINNER Victor added the comment: Would it be possible to list the kernel version (full version including the minor version) on which the test works or crash? You are talking about 3.10 without the minor version. It may be a regression in the kernel. Example of change in Linux kernel 3.10.17:

[issue21131] test_faulthandler.test_register_chain fails on 64bit ppc/arm with kernel = 3.10

2014-04-02 Thread Bohuslav Slavek Kabrda
Bohuslav Slavek Kabrda added the comment: I'm also surprised that this depends on kernel version, however that's what I found out (and the opensuse guys seem to only have reproduced this on kernel = 3.10, too). - Full kernel version (uname -r output): 3.13.0-0.rc7.28.sa2.aarch64 - The

[issue21131] test_faulthandler.test_register_chain fails on 64bit ppc/arm with kernel = 3.10

2014-04-02 Thread Bohuslav Slavek Kabrda
Bohuslav Slavek Kabrda added the comment: Ok, so with #undef HAVE_SIGACTION both the reproducer and the original test (as well as all tests in test_faulthandler) pass fine. -- ___ Python tracker rep...@bugs.python.org