主题中讨论的其他器件:UNIFLASH
您好!
根据安装 uniflash 的路径长度、SLImageCreator 无法启动时出现错误:
$./SLImageCreator
无法打开自/tmp/123456789/uniflash_5.3.0/simplelink/imagecreator/bin/SLImageCreatorw 或存档/tmp/123456789/uniflash_5.3.0/simplelink/imagecreator/bin/SLImageCreatorw.pkg
但是、例如从/tmp/uniflash_5.3.0/simplelink/imagecreator/bin/SLImageCreator 运行可以正常工作。 这是由于 Uniflash 启动序列的 C 代码中存在未初始化的存储器错误。 如果字符串的长度更有可能 /simplelink/imagecreator/bin/SLImageCreator 为6或7模8、因为在这些地址找到零字节的可能性更高。
Uniflash 似乎正在使用系统调用`reADLINK`来确定其安装位置。 但是、readlink 的文档显示:
readlink()不会将空字节附加到 buf。
这与 Uniflash 尝试打开的文件名末尾出现的垃圾字节一致。 Valgrind 还清楚地表明该程序中存在严重的缓冲区管理问题:
$ Valgrind ./SLImageCreator 项目列表
=52442=Memcheck,内存错误检测器
=52442==版权(C) 2002-2017和 GNU GPL,作者 Julian Seward 等
=52442==使用 Valgrind-3.15.0和 LibVEX;使用-h 重新运行以获得版权信息
=52442==命令:./SLImageCreator 项目列表
=52442=
=52442==条件跳转或移动取决于未初始化的值
=52442== AT 0x483D1A0:stpcpy (vg_replace_strmem.c:1157)
=52442== x×4030C8:??? (在/tmp/123456789/uniflash_5.3.0/simplelink/imagecreator/bin/SLImageCreator 中)
=52442== x 0x402BD3:??? (在/tmp/123456789/uniflash_5.3.0/simplelink/imagecreator/bin/SLImageCreator 中)
=52442== by 0x48A8BBA:(在 main 下面)(libc-start.c:308)
=52442=
=52442==条件跳转或移动取决于未初始化的值
=52442==位于0x4839DD0:strcpy (vg_replace_strmem.c:513)
=52442== 0x402DF2:??? (在/tmp/123456789/uniflash_5.3.0/simplelink/imagecreator/bin/SLImageCreator 中)
=52442== 0x402DEB:??? (在/tmp/123456789/uniflash_5.3.0/simplelink/imagecreator/bin/SLImageCreator 中)
=52442== by 0x48A8BBA:(在 main 下面)(libc-start.c:308)
=52442=
=52442==条件跳转或移动取决于未初始化的值
=52442==位于0x4839DD0:strcpy (vg_replace_strmem.c:513)
=52442== x×4020A0:??? (在/tmp/123456789/uniflash_5.3.0/simplelink/imagecreator/bin/SLImageCreator 中)
=52442== By 0x4020E8:??? (在/tmp/123456789/uniflash_5.3.0/simplelink/imagecreator/bin/SLImageCreator 中)
=52442== 0x402C3B:??? (在/tmp/123456789/uniflash_5.3.0/simplelink/imagecreator/bin/SLImageCreator 中)
=52442== by 0x48A8BBA:(在 main 下面)(libc-start.c:308)
=52442=
快乐的修复!
谢谢、
Balazs