403Webshell
Server IP : 121.121.20.254  /  Your IP : 216.73.216.202
Web Server : Microsoft-IIS/10.0
System : Windows NT WEB-SERVER 10.0 build 20348 (Windows Server 2022) AMD64
User : IUSR ( 0)
PHP Version : 8.3.28
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /Python315/Lib/test/test_capi/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /Python315/Lib/test/test_capi/__pycache__/test_mem.cpython-315.pyc
R
>lqjHc�Z�]PHs]PHs]PHs]QHGs]QHGsGs]QH G	s	G
s
\OQ2s\OQ2s
\2QQ\O22s\O 2QQ	\22s\O$\O&2Q
2QQ\22s\O$\O*2Q
2QQ\22s\O$\O.Q2QQ\22s\Q6Xc\O42P!P!)�)�support)�
import_helper�requires_subprocess)�assert_python_failure�assert_python_ok�	_testcapi�_testinternalcapic�`�\sQs]snQsQsQsQsQsQs	Qs
QsQ	sQ
s
QsQsQ
s\O$Q2sQsUsP!)�PyMemDebugTests�debugz(?:0x)?[0-9a-fA-F]+c
���[O29^tt^2[QUUOQQQ5oPPP2WOoUOQQ2!)%fhK.9h)�-c�
junk:false�j��PYTHONMALLOC�MALLOC_CONF�MALLOC_OPTIONS�ascii�replace)r�SuppressCrashReportrr�err�decode)�self�code�out�stderrs&&  �,C:\Python315\\Lib\test\test_capi\test_mem.py�check�PyMemDebugTests.checks[��
�
(�
(�
*�
*�'��d�!�.�.�)�"�	�C�+������}�}�W�i�0�0�+�
*�s�A � A0	�)A0	c���UOQ2oQoUOUOQ5o[OU[O
Q5oUO
V2P!)z3import _testcapi; _testcapi.pymem_buffer_overflow()a6Debug memory block at address p={ptr}: API 'm'\n    16 bytes originally requested\n    The [0-9] pad bytes at p-[0-9] are FORBIDDENBYTE, as expected.\n    The [0-9] pad bytes at tail={ptr} are not all FORBIDDENBYTE \(0x[0-9a-f]{{2}}\):\n        at tail\+0: 0x78 \*\*\* OUCH\n        at tail\+1: 0xfd\n        at tail\+2: 0xfd\n        .*\n(    The block was made by call #[0-9]+ to debug malloc/realloc.\n)?    Data at p: cd cd cd .*\n\nEnable tracemalloc to get the memory block allocation traceback\n\nFatal Python error: _PyMem_DebugRawFree: bad trailing pad byte��ptr)�flags)r�format�	PTR_REGEX�re�compile�DOTALL�assertRegex�rr�regexs&  r�test_buffer_overflow�$PyMemDebugTests.test_buffer_overflow%sQ���j�j�N�O��
S���������0���
�
�5��	�	�2������$�c��UOQ2oQoUOUOQ5oUOV2P!)z.import _testcapi; _testcapi.pymem_api_misuse()a�Debug memory block at address p={ptr}: API 'm'\n    16 bytes originally requested\n    The [0-9] pad bytes at p-[0-9] are FORBIDDENBYTE, as expected.\n    The [0-9] pad bytes at tail={ptr} are FORBIDDENBYTE, as expected.\n(    The block was made by call #[0-9]+ to debug malloc/realloc.\n)?    Data at p: cd cd cd .*\n\nEnable tracemalloc to get the memory block allocation traceback\n\nFatal Python error: _PyMem_DebugRawFree: bad ID: Allocated using API 'm', verified using API 'r'\nr!)rr$r%r)r*s&  r�test_api_misuse�PyMemDebugTests.test_api_misuse9s=���j�j�I�J��	w���������0������$r.c��UOU2o[O%fQoLQoUOV22P!)z^Fatal Python error: _PyMem_DebugMalloc: Python memory allocator called without holding the GILz�Fatal Python error: _PyMem_DebugMalloc: Python memory allocator called without an active thread state. Are you trying to call it inside of a Py_BEGIN_ALLOW_THREADS block?)rr�Py_GIL_DISABLED�assertIn)rrr�expecteds&&  r�check_malloc_without_gil�(PyMemDebugTests.check_malloc_without_gilHs:���j�j�����&�&�&�Q�H�^�H�	
�
�
�h�$r.c�.�QoUOU2P!)z6import _testcapi; _testcapi.pymem_malloc_without_gil()�r6�rrs& r�test_pymem_malloc_without_gil�-PyMemDebugTests.test_pymem_malloc_without_gilSs��H���%�%�d�+r.c�.�QoUOU2P!)z9import _testcapi; _testcapi.pyobject_malloc_without_gil()r9r:s& r� test_pyobject_malloc_without_gil�0PyMemDebugTests.test_pyobject_malloc_without_gilYs��K���%�%�d�+r.c�p�[OQUQ02o[QUUOQQQ5P!)z�
            import gc, os, sys, _testinternalcapi
            # Disable the GC to avoid crash on GC collection
            gc.disable()
            _testinternalcapi.z�()
            # Exit immediately to avoid a crash while deallocating
            # the invalid object
            os._exit(0)
        r
rrr)�textwrap�dedentrr)r�	func_namers&& r�check_pyobject_is_freed�'PyMemDebugTests.check_pyobject_is_freed_sD�����$� )�k�*	�	 �
��	��$��*�*�$��	
r.c�*�UOQ2P!)�check_pyobject_null_is_freed�rD�rs&r�test_pyobject_null_is_freed�+PyMemDebugTests.test_pyobject_null_is_freedqs���$�$�%C�Dr.c�*�UOQ2P!)�%check_pyobject_uninitialized_is_freedrHrIs&r�$test_pyobject_uninitialized_is_freed�4PyMemDebugTests.test_pyobject_uninitialized_is_freedts���$�$�%L�Mr.c�*�UOQ2P!)�'check_pyobject_forbidden_bytes_is_freedrHrIs&r�&test_pyobject_forbidden_bytes_is_freed�6PyMemDebugTests.test_pyobject_forbidden_bytes_is_freedws���$�$�%N�Or.c�*�UOQ2P!)�check_pyobject_freed_is_freedrHrIs&r�test_pyobject_freed_is_freed�,PyMemDebugTests.test_pyobject_freed_is_freedzs���$�$�%D�Er.c�D�Qo[QU2vq#oUO2o[U]2FDlvqgUOQU2UO	Q2Cuq�[U	2o	UO
V�]
*2UOV�]
*]*
2Jn	P!)a*if 1:
            import _testcapi

            class C(): pass

            # The first loop tests both functions and that remove_mem_hooks()
            # can be called twice in a row. The second loop checks a call to
            # set_nomemory() after a call to remove_mem_hooks(). The third
            # loop checks the start and stop arguments of set_nomemory().
            for outer_cnt in range(1, 4):
                start = 10 * outer_cnt
                for j in range(100):
                    if j == 0:
                        if outer_cnt != 3:
                            _testcapi.set_nomemory(start)
                        else:
                            _testcapi.set_nomemory(start, start + 1)
                    try:
                        C()
                    except MemoryError as e:
                        if outer_cnt != 3:
                            _testcapi.remove_mem_hooks()
                        print('MemoryError', outer_cnt, j)
                        _testcapi.remove_mem_hooks()
                        break
        r
sMemoryError� )r�
splitlines�	enumerater4�split�int�assertLessEqual�assertGreaterEqual)
rr�rcrr�lines�i�line�_�counts
&         r�test_set_nomemory�!PyMemDebugTests.test_set_nomemory}s�����4(��d�3������� �� ���*�G�A��M�M�.�#�.��
�
�4�(�I�Q���J�E�� � ��"��-��#�#�E�R�4��6�2�+r.�)�__name__�
__module__�__qualname__�__firstlineno__rr%rr,r0r6r;r>rDrJrNrRrVr�	nomemtestrf�__static_attributes__�__classdictcell__)�
__classdict__s@rr
r
sd�����L�&�I�
1�%�(
%�	%�,�,�
�$E�N�P�F�
���"3��"3r.r
c��\sQs]�sQsQsP!)�PyMemMallocDebugTests�malloc_debugrh�rirjrkrlrrnrhr.rrrrr�s��!�Lr.rrz
need pymallocc��\sQs]�sQsQsP!)�PyMemPymallocDebugTests�pymalloc_debugrhrtrhr.rrvrv����#�Lr.rvzneed mimalocc��\sQs]�sQsQsP!)�PyMemMimallocDebugTests�mimalloc_debugrhrtrhr.rrzrz�rxr.rzz
need Py_DEBUGc��\sQs]�sPsQsP!)�PyMemDefaultTestsrhrtrhr.rr}r}�s	���Lr.r}�__main__)r&rA�unittest�testr�test.supportrr�test.support.script_helperrr�
import_modulerr�TestCaser
�requires_gil_enabledrr�
skipUnless�
with_pymallocrv�
with_mimallocrz�Py_DEBUGr}ri�mainrhr.r�<module>r�s/��	����;�N�

�'�'��4�	�!�/�/�0C�D����O3�h�'�'�O3��O3�f	����"�O�"� �"�
���W�*�*�,�o�>�$�o�$�?�$�
���W�*�*�,�n�=�$�o�$�>�$�
���W�%�%��7����8��
�z���M�M�O�r.

Youez - 2016 - github.com/yon3zu
LinuXploit