7 Star 2 Fork 59

src-openEuler / python3

 / 详情

python3-3.9.9 版本运行iotop检测到内存异常

已完成
缺陷
创建于  
2022-02-24 20:39

【标题描述】python3-3.9.9 版本运行iotop检测到内存异常
【环境信息】
使用软件包python3-3.9.9,iotop-0.6-23
【问题复现步骤】
具体操作步骤
安装python3-3.9.9,iotop-0.6-23,glic-debuginfo
执行iotop -b -n 10 &
另起会话执行valgrind /usr/sbin/iotop -b -n 5 > iotop_test
经验证最新版本python3-3.9.10也存在此问题
【预期结果】
无异常
【实际结果】
工具检测出可能有内存异常
【附件信息】
比如系统message日志/组件日志、dump信息、图片等
[root@openEuler ~]# valgrind /usr/sbin/iotop -b -n 5 > iotop_test
==13750== Memcheck, a memory error detector
==13750== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==13750== Using Valgrind-3.16.0 and LibVEX; rerun with -h for copyright info
==13750== Command: /usr/sbin/iotop -b -n 5
==13750==
==13750== Conditional jump or move depends on uninitialised value(s)
==13750== at 0x49B2C40: PyUnicode_Decode (unicodeobject.c:3488)
==13750== by 0x49B335B: unicode_new (unicodeobject.c:15465)
==13750== by 0x4982C07: type_call (typeobject.c:1014)
==13750== by 0x492CA17: _PyObject_MakeTpCall (call.c:191)
==13750== by 0x48F1863: _PyObject_VectorcallTstate (abstract.h:116)
==13750== by 0x48F1863: _PyObject_VectorcallTstate (abstract.h:103)
==13750== by 0x48F1863: PyObject_Vectorcall (abstract.h:127)
==13750== by 0x48F1863: call_function (ceval.c:5075)
==13750== by 0x48F1863: _PyEval_EvalFrameDefault (ceval.c:3518)
==13750== by 0x48EAEE7: _PyEval_EvalFrame (pycore_ceval.h:40)
==13750== by 0x48EAEE7: function_code_fastcall (call.c:330)
==13750== by 0x492CBE7: _PyObject_FastCallDictTstate (call.c:118)
==13750== by 0x492CEEB: _PyObject_Call_Prepend (call.c:489)
==13750== by 0x498A007: slot_tp_init (typeobject.c:6964)
==13750== by 0x4982C4F: type_call (typeobject.c:1026)
==13750== by 0x492CA17: _PyObject_MakeTpCall (call.c:191)
==13750== by 0x48F1863: _PyObject_VectorcallTstate (abstract.h:116)
==13750== by 0x48F1863: _PyObject_VectorcallTstate (abstract.h:103)
==13750== by 0x48F1863: PyObject_Vectorcall (abstract.h:127)
==13750== by 0x48F1863: call_function (ceval.c:5075)
==13750== by 0x48F1863: _PyEval_EvalFrameDefault (ceval.c:3518)
==13750==
==13751== Warning: invalid file descriptor 1024 in syscall close()
==13751== Warning: invalid file descriptor 1025 in syscall close()
==13751== Warning: invalid file descriptor 1026 in syscall close()
==13751== Warning: invalid file descriptor 1027 in syscall close()
==13751== Use --log-fd= to select an alternative log fd.
==13751== Warning: invalid file descriptor 1028 in syscall close()
==13751== Warning: invalid file descriptor 1029 in syscall close()
==13752== Warning: invalid file descriptor 1024 in syscall close()
==13752== Warning: invalid file descriptor 1025 in syscall close()
==13752== Warning: invalid file descriptor 1026 in syscall close()
==13752== Warning: invalid file descriptor 1027 in syscall close()
==13752== Use --log-fd= to select an alternative log fd.
==13752== Warning: invalid file descriptor 1028 in syscall close()
==13752== Warning: invalid file descriptor 1029 in syscall close()
==13750==
==13750== HEAP SUMMARY:
==13750== in use at exit: 1,069,715 bytes in 10,017 blocks
==13750== total heap usage: 589,638 allocs, 579,621 frees, 128,672,782 bytes allocated
==13750==
==13750== LEAK SUMMARY:
==13750== definitely lost: 0 bytes in 0 blocks
==13750== indirectly lost: 0 bytes in 0 blocks
==13750== possibly lost: 1,042,483 bytes in 9,894 blocks
==13750== still reachable: 27,232 bytes in 123 blocks
==13750== suppressed: 0 bytes in 0 blocks
==13750== Rerun with --leak-check=full to see details of leaked memory
==13750==
==13750== Use --track-origins=yes to see where uninitialised values come from
==13750== For lists of detected and suppressed errors, rerun with: -s
==13750== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)

评论 (5)

markeryang 创建了缺陷

Hi markeryang, welcome to the openEuler Community.
I'm the Bot here serving you. You can find the instructions on how to interact with me at Here.
If you have any questions, please contact the SIG: Base-service, and any of the maintainers: @hexiaowen , @Monday , @zhujianwei001 , @hanxinke , @朱春意 , @BigSkySea , @chenjialong , @yanan-rock , @谢志鹏 , @syyhao

openeuler-ci-bot 添加了
 
sig/Base-service
标签

经验证:
下面版本也存在问题:
python3.9.9、python3.10.0、python3.10.2、python3.11.0a5

下面版本不存在问题:
python3.7.9、python3.8.5

桐小哥 负责人设置为桐小哥
markeryang 修改了描述
markeryang 修改了标题

报错信息提示“Conditional jump or move depends on uninitialised value(s)”,可能是某些变量未初始化造成的。

ltx 里程碑设置为openEuler-22.03-LTS-round-2
桐小哥 上传了附件stack-information_python3.9.9.txt
桐小哥 上传了附件stack-information_python3.11.0a5.txt

根据社区答复,Valgrind不理解Python obmalloc分配器,需要加上--suppressions选项进行测试:
输入图片说明
在openEuler,valgrind-python.supp文件在python3-devel二进制中打包,需要安装python3-devel.
https://github.com/python/cpython/blob/3.9/Misc/valgrind-python.supp

经验证,加上--suppressions选项之后,原先检测到的内存问题消失。

桐小哥 任务状态待办的 修改为已完成

登录 后才可以发表评论

状态
负责人
项目
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
预计工期 (小时)
参与者(3)
5329419 openeuler ci bot 1632792936
1
https://gitee.com/src-openeuler/python3.git
git@gitee.com:src-openeuler/python3.git
src-openeuler
python3
python3

搜索帮助