Skip to content

Conversation

yihong0618
Copy link
Contributor

@yihong0618 yihong0618 commented Oct 16, 2025

as discuss in #140103 (comment)

chore the test from branch 3.13 and need backport to 3.14

since main and 3.14 do not have the issue only test(so change the comments)

cc @ZeroIntensity

@bedevere-app bedevere-app bot added tests Tests in the Lib/test dir awaiting review labels Oct 16, 2025
@picnixz
Copy link
Member

picnixz commented Oct 16, 2025

Can you make an issue for that change please?

@yihong0618
Copy link
Contributor Author

yihong0618 commented Oct 16, 2025

Can you make an issue for that change please?

of course


Done

@yihong0618 yihong0618 changed the title chore: test_exec_set_nomemory_hang from 3.13 gh-140193: chore test_exec_set_nomemory_hang from 3.13 Oct 16, 2025
@StanFromIreland StanFromIreland changed the title gh-140193: chore test_exec_set_nomemory_hang from 3.13 gh-140193: Forward port test_exec_set_nomemory_hang from 3.13 Oct 16, 2025
Signed-off-by: yihong0618 <[email protected]>
@ZeroIntensity ZeroIntensity added the needs backport to 3.14 bugs and security fixes label Oct 16, 2025
Copy link
Member

@ZeroIntensity ZeroIntensity left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but let's run buildbots before merging this.

@ZeroIntensity ZeroIntensity added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Oct 16, 2025
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @ZeroIntensity for commit 3f31156 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F140187%2Fmerge

If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Oct 16, 2025
@yihong0618
Copy link
Contributor Author

LGTM, but let's run buildbots before merging this.

2000 is too long for windows...

@ZeroIntensity
Copy link
Member

Can you figure out which number will get the f_lasti above 1024?

@yihong0618
Copy link
Contributor Author

Can you figure out which number will get the f_lasti above 1024?

will do it tomorrow~ good night.

@yihong0618
Copy link
Contributor Author

Can you figure out which number will get the f_lasti above 1024?

will be 60 times

for 59 times

[hyi@rocky cpython]$ gdb ./python
GNU gdb (Rocky Linux) 14.2-3.el9
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "aarch64-redhat-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./python...
warning: File "/home/hyi/cpython/python-gdb.py" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
To enable execution of this file add
	add-auto-load-safe-path /home/hyi/cpython/python-gdb.py
line to your configuration file "/home/hyi/.gdbinit".
To completely disable this security protection add
	set auto-load safe-path /
line to your configuration file "/home/hyi/.gdbinit".
For more information about this security protection see the
"Auto-loading safe path" section in the GDB manual.  E.g., run from the shell:
	info "(gdb)Auto-loading safe path"
(gdb) b ceval.c:913 if $has_import_traceback()
Breakpoint 1 at 0x6ae4dc: file Python/ceval.c, line 913.
(gdb) set args ttt.py 
(gdb) run
Starting program: /home/hyi/cpython/python ttt.py 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

Breakpoint 1, _PyEval_EvalFrameDefault (tstate=0xaf5020 <_PyRuntime+299056>, frame=0xfffff7cf5020, throwflag=0) at Python/ceval.c:913
913	               PyObject *lasti = PyLong_FromLong(frame_lasti);
(gdb) p frame_lasti
$1 = 933

for 60 times

[hyi@rocky cpython]$ gdb ./python
GNU gdb (Rocky Linux) 14.2-3.el9
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "aarch64-redhat-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./python...
warning: File "/home/hyi/cpython/python-gdb.py" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
To enable execution of this file add
	add-auto-load-safe-path /home/hyi/cpython/python-gdb.py
line to your configuration file "/home/hyi/.gdbinit".
To completely disable this security protection add
	set auto-load safe-path /
line to your configuration file "/home/hyi/.gdbinit".
For more information about this security protection see the
"Auto-loading safe path" section in the GDB manual.  E.g., run from the shell:
	info "(gdb)Auto-loading safe path"
(gdb) b ceval.c:913 if $has_import_traceback()
Breakpoint 1 at 0x6ae4dc: file Python/ceval.c, line 913.
(gdb) set args ttt.py 
(gdb) run
Starting program: /home/hyi/cpython/python ttt.py 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
object address  : 0xfffff799fa80
object refcount : 3
object type     : 0xa7c730
object type name: MemoryError
object repr     : 
lost sys.stderr
object address  : 0xfffff799f9a0
object refcount : 3
object type     : 0xa7c730
object type name: MemoryError
object repr     : 
lost sys.stderr
object address  : 0xfffff799fa80
object refcount : 3
object type     : 0xa7c730
object type name: MemoryError
object repr     : 
lost sys.stderr
[Inferior 1 (process 109463) exited with code 01]
(gdb) 

for gdb script

python
import gdb

class has_import_traceback(gdb.Function):
    """Return 1 if 'import traceback' appears in py-bt output, else 0."""
    def __init__(self):
        super().__init__("has_import_traceback")

    def invoke(self):
        try:
            out = gdb.execute("py-bt", to_string=True)
        except gdb.error:
            return gdb.Value(0)
        return gdb.Value(1 if "import traceback" in out else 0)

has_import_traceback()
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting merge needs backport to 3.14 bugs and security fixes skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants