From 84efe071abb9996c0ef7288700a841e4ff86b5c6 Mon Sep 17 00:00:00 2001 From: shen-chenbang <1944340417@qq.com> Date: Sat, 28 Sep 2024 21:13:01 +0800 Subject: [PATCH 1/6] 1 --- .../openssh.1.md" | 45 +++++++++++++ .../openssh.2.md" | 49 ++++++++++++++ .../perl-XML-LibXML.md" | 26 ++++++++ .../pkcs11-helper.md" | 28 ++++++++ .../python-dmidecode.1.md" | 26 ++++++++ .../python-dmidecode.2.md" | 24 +++++++ .../python-sybil.md" | 14 ++++ .../rarian.md" | 19 ++++++ .../satyr.md" | 18 +++++ .../sysstat.md" | 17 +++++ .../tpm2-tss.md" | 66 +++++++++++++++++++ .../trace-cmd.md" | 27 ++++++++ .../vdo.md" | 28 ++++++++ 13 files changed, 387 insertions(+) create mode 100644 "\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/openssh.1.md" create mode 100644 "\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/openssh.2.md" create mode 100644 "\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/perl-XML-LibXML.md" create mode 100644 "\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/pkcs11-helper.md" create mode 100644 "\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/python-dmidecode.1.md" create mode 100644 "\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/python-dmidecode.2.md" create mode 100644 "\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/python-sybil.md" create mode 100644 "\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/rarian.md" create mode 100644 "\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/satyr.md" create mode 100644 "\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/sysstat.md" create mode 100644 "\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/tpm2-tss.md" create mode 100644 "\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/trace-cmd.md" create mode 100644 "\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/vdo.md" diff --git "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/openssh.1.md" "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/openssh.1.md" new file mode 100644 index 0000000..43f5f85 --- /dev/null +++ "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/openssh.1.md" @@ -0,0 +1,45 @@ +openssh +1、问题现象 +出自:https://gitee.com/src-openeuler/openssh(openEuler-24.03-LTS) +[ 188s] ssh-ecdsa.c:267:6: error: call to undeclared function 'is_ecdsa_pkcs11'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] +[ 188s] 267 | if (is_ecdsa_pkcs11(key->ecdsa)) { +[ 188s] | ^ + +2、问题定位 +源代码中没有出现问题代码 +问题出在openssh-9.3p1-merged-openssl-evp.patch中 +is_ecdsa_pkcs11函数调用了一个未声明的函数,而这个函数在ssh-pkcs11.h中定义了,这就是导致这个问题的原因 + +3、修改建议 +在ssh-rsa.c和ssh-ecdsa.c中加入头文件 +即#include "ssh-pkcs11.h" +就能消除这个错误 + + + +%patch后面不能直接跟数字,要空一格 + +%check +if [ -e /sys/fs/selinux/enforce ]; then + # Store the SElinux state only if the file exists + if [ -w /sys/fs/selinux/enforce ] && [ -w. ]; then + cat /sys/fs/selinux/enforce > selinux.tmp + setenforce 0 + else + echo "Insufficient permissions to handle SELinux state. Skipping modification." + fi +else + echo "SELinux is not enabled or enforce file not found. Skipping modification." +fi + +make tests + +if [ -e /sys/fs/selinux/enforce ]; then + # Restore the SElinux state only if the file exists + if [ -w /sys/fs/selinux/enforce ] && [ -f selinux.tmp ]; then + cat selinux.tmp > /sys/fs/selinux/enforce + rm -rf selinux.tmp + else + echo "Insufficient permissions or temp file not found. Skipping restoration of SELinux state." + fi +fi \ No newline at end of file diff --git "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/openssh.2.md" "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/openssh.2.md" new file mode 100644 index 0000000..2535052 --- /dev/null +++ "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/openssh.2.md" @@ -0,0 +1,49 @@ +openssh +1、问题现象 +出自:https://gitee.com/src-openeuler/openssh(openEuler-24.03-LTS) +在修复了openssh.1的问题之后,又出现了第二个问题: +[234s] + setenforce 0 +[234s] setenforce:security setenforce() failed:Permission denied +这意味着在尝试将 SELinux 的强制模式设置为宽容模式时,由于没有足够的权限,操作未能成功 + +2、问题定位 +源代码中没有出现问题代码 +spec文件中: +%check +if [ -e /sys/fs/selinux/enforce ]; then + # Store the SElinux state + cat /sys/fs/selinux/enforce > selinux.tmp + setenforce 0 +fi +make tests +if [ -e /sys/fs/selinux/enforce ]; then + # Restore the SElinux state + cat selinux.tmp > /sys/fs/selinux/enforce + rm -rf selinux.tmp +fi + +3、修改建议 +将%check处改为: +%check +if [ -e /sys/fs/selinux/enforce ]; then + # Store the SElinux state only if the file exists + if [ -w /sys/fs/selinux/enforce ] && [ -w. ]; then + cat /sys/fs/selinux/enforce > selinux.tmp + setenforce 0 + else + echo "Insufficient permissions to handle SELinux state. Skipping modification." + fi +else + echo "SELinux is not enabled or enforce file not found. Skipping modification." +fi +make tests +if [ -e /sys/fs/selinux/enforce ]; then + # Restore the SElinux state only if the file exists + if [ -w /sys/fs/selinux/enforce ] && [ -f selinux.tmp ]; then + cat selinux.tmp > /sys/fs/selinux/enforce + rm -rf selinux.tmp + else + echo "Insufficient permissions or temp file not found. Skipping restoration of SELinux state." + fi +fi +目的是在尝试修改 SELinux 强制文件之前检查其是否可写。这可以防止由于权限不足而导致脚本失败 \ No newline at end of file diff --git "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/perl-XML-LibXML.md" "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/perl-XML-LibXML.md" new file mode 100644 index 0000000..4f0b4fc --- /dev/null +++ "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/perl-XML-LibXML.md" @@ -0,0 +1,26 @@ +perl-XML-LibXML + +1、问题现象 + +出自:https://gitee.com/src-openeuler/perl-XML-LibXML(openEuler-24.03-LTS) + +68s] perl-libxml-mm.c:142:18: +incompatible fuction pointer types passing 'void (void*, void*, mmlchar *)’(aka'void (wvoid*, void*, unsigned char t)’) to parameter of type'mmashscamner'(aka +void (*)(void *, void *, const unsigned char *)’)[-Wincompatible-function pointer types] +68s] +142 +xmlHashScan(r, PmmRegistryDumpllashScanner, NuLL); + +2、问题定位 + +函数指针类型不兼容 +问题出在源码中perl-libxml-mm.c文件中PmmRegistryDumpHashScanner函数定义(也就是 void (void *, void *, unsigned char *) )与xmlHashScan 函数期望的函数指针类型 xmlHashScanner(也就是 void (*)(void *, void *, const unsigned char *) )不匹配需要修改函数定义 + +3、修改建议 + +在perl-libxml-mm.c文件中PmmRegistryDumpHashScanner函数定义部分的第三个参数前加上const + +即将 +void PmmRegistryDumpHashScanner(void * payload, void * data, xmlChar * name) +改为 +void PmmRegistryDumpHashScanner(void * payload, void * data,const xmlChar * name) \ No newline at end of file diff --git "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/pkcs11-helper.md" "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/pkcs11-helper.md" new file mode 100644 index 0000000..f196afc --- /dev/null +++ "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/pkcs11-helper.md" @@ -0,0 +1,28 @@ +pkcs11-helper + +1、问题现象 + +出自:https://gitee.com/src-openeuler/pkcs11-helper(openEuler-24.03-LTS) + +[ 101s] pkcs11h-openssl.c:1108:3: error: incompatible function pointer types passing 'int (CRYPTO_EX_DATA *, const CRYPTO_EX_DATA *, void *, int, long, void *)' (aka 'int (struct crypto_ex_data_st *, const struct crypto_ex_data_st *, void *, int, long, void *)') to parameter of type 'CRYPTO_EX_dup *' (aka 'int (*)(struct crypto_ex_data_st *, const struct crypto_ex_data_st *, void **, int, long, void *)') [-Wincompatible-function-pointer-types] +[ 101s] 1108 | __pkcs11h_openssl_ex_data_dup, +[ 101s] | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +[ 101s] /usr/include/openssl/rsa.h:444:62: note: expanded from macro 'RSA_get_ex_new_index' +[ 101s] 444 | CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_RSA, l, p, newf, dupf, freef) +[ 101s] | ^~~~ + +2、问题定位 + +这个错误表明在 pkcs11h-openssl.c 文件的第 1108 行,传递的函数指针类型与期望的类型不兼容。 + +具体来说,正在尝试将函数 __pkcs11h_openssl_ex_data_dup 的指针传递给一个期望类型为 CRYPTO_EX_dup *(即 int (*)(struct crypto_ex_data_st *, const struct crypto_ex_data_st *, void **, int, long, void *))的参数,但 __pkcs11h_openssl_ex_data_dup 的类型是 int (CRYPTO_EX_DATA *, const CRYPTO_EX_DATA *, void *, int, long, void *)(等同于 int (struct crypto_ex_data_st *, const struct crypto_ex_data_st *, void *, int, long, void *))。 + +即__pkcs11h_openssl_ex_data_dup函数定义的第三个参数有问题: +需要的是void ** +结果传递的是void * + +3、修改建议 + +在lib/pkcs11h-openssl.c文件中将__pkcs11h_openssl_ex_data_dup函数定义中的void *from_d, +改为void **from_d, +因为有两个该函数,是在判断条件下执行不同的函数,所以要改两次 diff --git "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/python-dmidecode.1.md" "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/python-dmidecode.1.md" new file mode 100644 index 0000000..152f080 --- /dev/null +++ "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/python-dmidecode.1.md" @@ -0,0 +1,26 @@ +python-dmidecode.1 + +1、问题现象 + +出自:https://gitee.com/src-openeuler/python-dmidecode(openEuler-24.03-LTS) + +[ 75s] src/dmidecodemodule.c:916:28: error: incompatible function pointer types initializing 'PyCFunction' (aka 'struct _object *(*)(struct _object *, struct _object *)') with an expression of type 'PyObject *(PyObject *, PyObject *, PyObject *)' (aka 'struct _object *(struct _object *, struct _object *, struct _object *)') [-Wincompatible-function-pointer-types] +[ 75s] 916 | {(char *)"xmlapi", dmidecode_xmlapi, METH_VARARGS | METH_KEYWORDS, +[ 75s] | ^~~~~~~~~~~~~~~~ + +2、问题定位 + +即不兼容的函数指针类型错误: +在第src/dmidecodemodule.c的 916 行,尝试将一个函数指针类型为PyObject *(PyObject *, PyObject *, PyObject *)的表达式初始化为PyCFunction类型(即struct _object *(*)(struct _object *, struct _object *))。这意味着函数的参数个数不匹配,一个接受三个参数,一个只接受两个参数。 + +3、修改建议 + +首先我尝试进行封装,但是依旧报错,于是我再次尝试进行手动数据类型转换 + +即将 +{(char *)"xmlapi", dmidecode_xmlapi, METH_VARARGS | METH_KEYWORDS, +(char *) "Internal API for retrieving data as raw XML data"}, + +改为 +{"xmlapi", (PyCFunction)dmidecode_xmlapi, METH_VARARGS | METH_KEYWORDS, "Internal API for retrieving data as raw XML data"}, +即可修复这个问题 \ No newline at end of file diff --git "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/python-dmidecode.2.md" "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/python-dmidecode.2.md" new file mode 100644 index 0000000..e69f27a --- /dev/null +++ "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/python-dmidecode.2.md" @@ -0,0 +1,24 @@ +python-dmidecode.2 + +1、问题现象 + +出自:https://gitee.com/src-openeuler/python-dmidecode(openEuler-24.03-LTS) + +[ 75s] src/dmidecodemodule.c:1027:72: error: incompatible function pointer types passing 'void (void *)' to parameter of type 'PyCapsule_Destructor' (aka 'void (*)(struct _object *)') [-Wincompatible-function-pointer-types] +[ 75s] 1027 | PyModule_AddObject(module, "options", PyCapsule_New(opt, NULL, destruct_options)); +[ 75s] | ^~~~~~~~~~~~~~~~ + +2、问题定位 + +即这个错误表明在将一个函数指针作为PyCapsule的析构函数传递时,函数指针类型不兼容。 +具体来说,错误发生在src/dmidecodemodule.c文件的第 1027 行,尝试将一个类型为void (void *)的函数指针传递给期望类型为PyCapsule_Destructor(即void (*)(struct _object *))的参数。 + +3、修改建议 + +将函数定义由void destruct_options(void *ptr)换为void destruct_options(PyObject *capsule) { +再通过 +void *ptr = PyCapsule_GetPointer(capsule, NULL); +options *opt = (options *) ptr; +使该代码与原来的部分保持一致 + +即可解决问题 \ No newline at end of file diff --git "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/python-sybil.md" "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/python-sybil.md" new file mode 100644 index 0000000..6f13b2a --- /dev/null +++ "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/python-sybil.md" @@ -0,0 +1,14 @@ +python-sybil + +1、问题现象 + +出自:https://gitee.com/src-openeuler/python-sybil +(openEuler-24.03-LTS)、 + +[ 75s] FAILED tests/test_functional.py::test_pytest - AssertionError: +[ 75s] ========================= 1 failed, 80 passed in 2.82s ========================= +[ 75s] error: Bad exit status from /var/tmp/rpm-tmp.vV5eGG (%check) + +2、问题定位 + +问题为偶发性问题,十次构建未必失败一次,本地构建也成功,怀疑为obs的问题 \ No newline at end of file diff --git "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/rarian.md" "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/rarian.md" new file mode 100644 index 0000000..6052e43 --- /dev/null +++ "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/rarian.md" @@ -0,0 +1,19 @@ +rarian + +1、问题现象 + +出自:https://gitee.com/src-openeuler/rarian(openEuler-24.03-LTS) + +[ 79s] rarian-example.c:80:1: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int] +[ 79s] 80 | info_for_each (RrnInfoEntry *entry, void *data) +[ 79s] | ^ +[ 79s] | int + +2、问题定位 + +即rarian-example.c 文件的第 80 行,定义函数时没有明确指定函数的返回类型,编译器默认认为是 int,但在 ISO C99 及更高版本中不支持这种隐式的 int 类型声明。 +要解决这个问题,可以在函数定义处明确指定函数的返回类型。 + +3、修改建议 + +只要在函数前加一个int即可 \ No newline at end of file diff --git "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/satyr.md" "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/satyr.md" new file mode 100644 index 0000000..231ae20 --- /dev/null +++ "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/satyr.md" @@ -0,0 +1,18 @@ +satyr + +1、问题现象 + +出自:https://gitee.com/src-openeuler/satyr(openEuler-24.03-LTS) + +FAIL: core_stacktrace +...... +FAIL: 1 + +2、问题定位 + +该问题上游已经解决,obs平台上aarch是succeed +x86是fail +报错为上述问题现象 + +在本地的x86中的clang运行该程序显示构建成功 +推测为obs平台的测试代码有误 \ No newline at end of file diff --git "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/sysstat.md" "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/sysstat.md" new file mode 100644 index 0000000..25428e6 --- /dev/null +++ "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/sysstat.md" @@ -0,0 +1,17 @@ +sysstat + +1、问题现象 + +出自:https://gitee.com/src-openeuler/sysstat(openEuler-24.03-LTS) + +[ 72s] rd_stats.c:995:4: error: non-void function 'read_tty_driver_serial' should return a value [-Wreturn-type] +[ 72s] 995 | return; +[ 72s] | ^ + +2、问题定位 + +上一个人提交的patch里,return后面没有返回值 + +3.解决方案 + +在return后面加上返回值0即可解决问题 \ No newline at end of file diff --git "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/tpm2-tss.md" "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/tpm2-tss.md" new file mode 100644 index 0000000..cc4227f --- /dev/null +++ "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/tpm2-tss.md" @@ -0,0 +1,66 @@ +tpm2-tss + +1、问题现象 + +出自:https://gitee.com/src-openeuler/tpm2-tss(openEuler-24.03-LTS) + +aarch成功,x86失败 + +[ 1109s] ERROR: test/integration/sys-asymmetric-encrypt-decrypt.int +[ 1249s] ERROR: test/integration/sys-nv-policy-locality.int +[ 1388s] ERROR: test/integration/sys-nv-readwrite.int +[ 1528s] ERROR: test/integration/sys-hmac-auth.int +[ 1668s] ERROR: test/integration/sys-primary-rsa-2K-aes128cfb.int +[ 1808s] ERROR: test/integration/sys-create-keyedhash-sha1-hmac.int +[ 1948s] ERROR: test/integration/sys-encrypt-decrypt.int +[ 2087s] ERROR: test/integration/sys-encrypt-decrypt-2.int +[ 2228s] ERROR: test/integration/sys-evict-ctrl.int +[ 2367s] ERROR: test/integration/sys-get-random.int +[ 2507s] ERROR: test/integration/sys-stir-random.int +[ 2647s] ERROR: test/integration/sys-hierarchy-change-auth.int +........ +[29647s] # TOTAL: 260 +[29647s] # PASS: 55 +[29647s] # SKIP: 0 +[29647s] # XFAIL: 0 +[29647s] # FAIL: 0 +[29647s] # XPASS: 0 +[29647s] # ERROR: 205 +总结为: +test/integration目录下全部error + +2、问题定位 + +第一次我对比aarch和x86的日志,发现aarch与x86大部分相同,区别在于aarch的日志中会出现大量的clang: warning: argument unused during compilation: '-fstack-clash-protection' [-Wunused-command-line-argument]警告 +而x86的日志中从未出现过类似的警告 + +这种情况在之前的satyr包中也出现过,当时的解决方案是加入%if "%toolchain" == "clang" + export CFLAGS="$CFLAGS -Wno-error=unused-command-line-argument" +%endif(简称为可用降级操作) +即可通过,unused-command-line-argument后续会加入,所以当做社区已修复 + +而在tpm2-tss这个包里加入类似的代码却没有反应,这条修复路径就此阻塞 + +第二次我在网上搜索相关错误,找到一个很类似的情况,同样是tpm2-tss中test/integration目录下全部error,网址为:https://blog.csdn.net/jianming21/article/details/107969368 +它的解释是“其根源是相关依赖包的缺失”,于是我找到tpm2-tss的上游社区的master分支中所需的依赖,加入到spec文件中,却都失败了,这条路就此阻塞 + +第三次我怀疑之所以aarch成功而x86失败是因为aarch架构和x86架构下的clang的指令集不同,又出错的单元为unit和integration,于是我将%build下做了一个判断将integration删除,结果成功 + +3.解决方案 + +即将 +%configure --disable-static --disable-silent-rules --with-udevrulesdir=%{_udevrulesdir} --with-udevrulesprefix=80- \ + --with-runstatedir=%{_rundir} --with-tmpfilesdir=%{_tmpfilesdir} --with-sysusersdir=%{_sysusersdir} \ + --enable-unit --enable-integration + +改为 +%if "%toolchain" == "clang" +%configure --disable-static --disable-silent-rules --with-udevrulesdir=%{_udevrulesdir} --with-udevrulesprefix=80- \ + --with-runstatedir=%{_rundir} --with-tmpfilesdir=%{_tmpfilesdir} --with-sysusersdir=%{_sysusersdir} +%else +%configure --disable-static --disable-silent-rules --with-udevrulesdir=%{_udevrulesdir} --with-udevrulesprefix=80- \ + --with-runstatedir=%{_rundir} --with-tmpfilesdir=%{_tmpfilesdir} --with-sysusersdir=%{_sysusersdir} \ + --enable-unit --enable-integration + +%endif +不影响ci和gcc \ No newline at end of file diff --git "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/trace-cmd.md" "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/trace-cmd.md" new file mode 100644 index 0000000..79fb81e --- /dev/null +++ "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/trace-cmd.md" @@ -0,0 +1,27 @@ +trace-cmd + +1、问题现象 + +出自:https://gitee.com/src-openeuler/trace-cmd(openEuler-24.03-LTS) + +[ 111s] trace-hooks.c:135:5: error: call to undeclared function 'warning'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] +[ 111s] 135 | warning("unknown flag %c\n", flags[i]); +[ 111s] | ^ +[ 111s] trace-hooks.c:152:2: error: call to undeclared function 'warning'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] +[ 111s] 152 | warning("Invalid hook format '%s'", arg); +[ 111s] | ^ +[ 111s] 2 errors generated. + +即调用了未声明的函数warning + +2、问题定位 + +即在trace-hooks.c文件中调用了未声明的函数warning + +尝试在这个文件里加入相关定义后,别的文件又出现了同样的问题 +依次加上之后就解决了问题 + +3.解决方案 + +在相关c文件里补上warning函数定义即可 +void warning(const char *fmt, ...); \ No newline at end of file diff --git "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/vdo.md" "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/vdo.md" new file mode 100644 index 0000000..87594e5 --- /dev/null +++ "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/vdo.md" @@ -0,0 +1,28 @@ +vdo + +1、问题现象 + +出自:https://gitee.com/src-openeuler/vdo +(openEuler-24.03-LTS) + +[ 77s] error: unknown warning option '-Wlogical-op'; did you mean '-Wlong-long'? [-Werror,-Wunknown-warning-option] +[ 77s] make[2]: *** [Makefile:137: murmurhash3.o] Error 1 +[ 77s] make[2]: Leaving directory '/home/abuild/rpmbuild/BUILD/vdo-8.2.2.2/utils/uds' +[ 77s] make[2]: Entering directory '/home/abuild/rpmbuild/BUILD/vdo-8.2.2.2/utils/uds' +[ 77s] clang -O2 -g -grecord-gcc-switches -pipe -fstack-protector-strong -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS --config /usr/lib/rpm/generic-hardened-clang.cfg -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -D_GNU_SOURCE -g -O3 -fno-omit-frame-pointer -Wall -Wcast-align -Werror -Wextra -Winit-self -Wlogical-op -Wmissing-include-dirs -Wpointer-arith -Wredundant-decls -Wunused -Wwrite-strings -DCURRENT_VERSION='"8.2.2.2"' -I. -std=gnu99 -pedantic -Wbad-function-cast -Wcast-qual -Wfloat-equal -Wformat=2 -Wmissing-declarations -Wmissing-format-attribute -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wswitch-default -c -MD -MF .deps/buffer.d.new -MP -MT buffer.o buffer.c -o buffer.o + +2、问题定位 + +即utils/uds/Makefile文件和utils/vdo/Makefile文件中的-WARNS和-C_WARNS部分是clang不接受的形式, + +3.解决方案 + +于是做了一个判断,如果编译器为gcc则执行-WARNS和-C_WARNS,如果是clang则不执行,成功修复 + +即 ++# Define WARNS and C_WARNS only if using gcc ++CLANG_VERSION := $(shell $(CC) --version | grep -i clang) ++ifeq ($(findstring clang, $(CLANG_VERSION)),clang) ++WARNS = ++C_WARNS = ++else \ No newline at end of file -- Gitee From 2c5ab96a5bdd812aeebd5e727143499e5c516fb8 Mon Sep 17 00:00:00 2001 From: shen-chenbang <1944340417@qq.com> Date: Sat, 28 Sep 2024 21:15:20 +0800 Subject: [PATCH 2/6] 1 --- .../openssh.1.md" | 31 +------------------ 1 file changed, 1 insertion(+), 30 deletions(-) diff --git "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/openssh.1.md" "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/openssh.1.md" index 43f5f85..32abf22 100644 --- "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/openssh.1.md" +++ "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/openssh.1.md" @@ -13,33 +13,4 @@ is_ecdsa_pkcs11函数调用了一个未声明的函数,而这个函数在ssh-p 3、修改建议 在ssh-rsa.c和ssh-ecdsa.c中加入头文件 即#include "ssh-pkcs11.h" -就能消除这个错误 - - - -%patch后面不能直接跟数字,要空一格 - -%check -if [ -e /sys/fs/selinux/enforce ]; then - # Store the SElinux state only if the file exists - if [ -w /sys/fs/selinux/enforce ] && [ -w. ]; then - cat /sys/fs/selinux/enforce > selinux.tmp - setenforce 0 - else - echo "Insufficient permissions to handle SELinux state. Skipping modification." - fi -else - echo "SELinux is not enabled or enforce file not found. Skipping modification." -fi - -make tests - -if [ -e /sys/fs/selinux/enforce ]; then - # Restore the SElinux state only if the file exists - if [ -w /sys/fs/selinux/enforce ] && [ -f selinux.tmp ]; then - cat selinux.tmp > /sys/fs/selinux/enforce - rm -rf selinux.tmp - else - echo "Insufficient permissions or temp file not found. Skipping restoration of SELinux state." - fi -fi \ No newline at end of file +就能消除这个错误 \ No newline at end of file -- Gitee From 800f7e8dad641370b1b09069684bce12aaeae840 Mon Sep 17 00:00:00 2001 From: shen-chenbang <1944340417@qq.com> Date: Sun, 29 Sep 2024 09:09:20 +0800 Subject: [PATCH 3/6] support clang --- .../openssh.1.md" | 21 ++++++++++++------- .../openssh.2.md" | 19 ++++++++++++----- 2 files changed, 27 insertions(+), 13 deletions(-) diff --git "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/openssh.1.md" "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/openssh.1.md" index 32abf22..b5559e4 100644 --- "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/openssh.1.md" +++ "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/openssh.1.md" @@ -1,16 +1,21 @@ -openssh -1、问题现象 +# openssh # + +## 1、问题现象 ## 出自:https://gitee.com/src-openeuler/openssh(openEuler-24.03-LTS) + +``` [ 188s] ssh-ecdsa.c:267:6: error: call to undeclared function 'is_ecdsa_pkcs11'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] -[ 188s] 267 | if (is_ecdsa_pkcs11(key->ecdsa)) { -[ 188s] | ^ -2、问题定位 +[ 188s] 267 | if (is_ecdsa_pkcs11(key->ecdsa)) { ^ +``` +## 2、问题定位 ## + 源代码中没有出现问题代码 问题出在openssh-9.3p1-merged-openssl-evp.patch中 is_ecdsa_pkcs11函数调用了一个未声明的函数,而这个函数在ssh-pkcs11.h中定义了,这就是导致这个问题的原因 -3、修改建议 +## 3、修改建议 ## + 在ssh-rsa.c和ssh-ecdsa.c中加入头文件 -即#include "ssh-pkcs11.h" -就能消除这个错误 \ No newline at end of file +即`#include "ssh-pkcs11.h"` +就能消除这个错误 diff --git "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/openssh.2.md" "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/openssh.2.md" index 2535052..3ce182e 100644 --- "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/openssh.2.md" +++ "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/openssh.2.md" @@ -1,14 +1,21 @@ -openssh -1、问题现象 +# openssh # + +## 1、问题现象 ## 出自:https://gitee.com/src-openeuler/openssh(openEuler-24.03-LTS) + 在修复了openssh.1的问题之后,又出现了第二个问题: +``` [234s] + setenforce 0 + [234s] setenforce:security setenforce() failed:Permission denied +``` 这意味着在尝试将 SELinux 的强制模式设置为宽容模式时,由于没有足够的权限,操作未能成功 -2、问题定位 +## 2、问题定位 ## + 源代码中没有出现问题代码 spec文件中: +``` %check if [ -e /sys/fs/selinux/enforce ]; then # Store the SElinux state @@ -21,9 +28,10 @@ if [ -e /sys/fs/selinux/enforce ]; then cat selinux.tmp > /sys/fs/selinux/enforce rm -rf selinux.tmp fi - -3、修改建议 +``` +## 3、修改建议 ## 将%check处改为: +``` %check if [ -e /sys/fs/selinux/enforce ]; then # Store the SElinux state only if the file exists @@ -46,4 +54,5 @@ if [ -e /sys/fs/selinux/enforce ]; then echo "Insufficient permissions or temp file not found. Skipping restoration of SELinux state." fi fi +``` 目的是在尝试修改 SELinux 强制文件之前检查其是否可写。这可以防止由于权限不足而导致脚本失败 \ No newline at end of file -- Gitee From 2c63fa169969d5832871c9165850a72d272d36b7 Mon Sep 17 00:00:00 2001 From: shen-chenbang <1944340417@qq.com> Date: Sun, 29 Sep 2024 09:19:24 +0800 Subject: [PATCH 4/6] support clang --- .../openssh.1.md" | 1 - .../openssh.2.md" | 1 - .../perl-XML-LibXML.md" | 18 +++++++++------ .../pkcs11-helper.md" | 14 +++++------ .../python-dmidecode.1.md" | 19 ++++++++------- .../python-dmidecode.2.md" | 14 ++++++----- .../python-sybil.md" | 10 ++++---- .../rarian.md" | 12 +++++----- .../satyr.md" | 10 ++++---- .../sysstat.md" | 12 +++++----- .../tpm2-tss.md" | 23 ++++++++++++------- .../trace-cmd.md" | 14 +++++------ .../vdo.md" | 16 +++++++------ 13 files changed, 90 insertions(+), 74 deletions(-) diff --git "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/openssh.1.md" "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/openssh.1.md" index b5559e4..c05506e 100644 --- "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/openssh.1.md" +++ "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/openssh.1.md" @@ -5,7 +5,6 @@ ``` [ 188s] ssh-ecdsa.c:267:6: error: call to undeclared function 'is_ecdsa_pkcs11'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] - [ 188s] 267 | if (is_ecdsa_pkcs11(key->ecdsa)) { ^ ``` ## 2、问题定位 ## diff --git "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/openssh.2.md" "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/openssh.2.md" index 3ce182e..dc17638 100644 --- "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/openssh.2.md" +++ "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/openssh.2.md" @@ -6,7 +6,6 @@ 在修复了openssh.1的问题之后,又出现了第二个问题: ``` [234s] + setenforce 0 - [234s] setenforce:security setenforce() failed:Permission denied ``` 这意味着在尝试将 SELinux 的强制模式设置为宽容模式时,由于没有足够的权限,操作未能成功 diff --git "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/perl-XML-LibXML.md" "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/perl-XML-LibXML.md" index 4f0b4fc..b6714cc 100644 --- "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/perl-XML-LibXML.md" +++ "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/perl-XML-LibXML.md" @@ -1,26 +1,30 @@ -perl-XML-LibXML +# perl-XML-LibXML # -1、问题现象 +## 1、问题现象 ## 出自:https://gitee.com/src-openeuler/perl-XML-LibXML(openEuler-24.03-LTS) - +``` 68s] perl-libxml-mm.c:142:18: incompatible fuction pointer types passing 'void (void*, void*, mmlchar *)’(aka'void (wvoid*, void*, unsigned char t)’) to parameter of type'mmashscamner'(aka void (*)(void *, void *, const unsigned char *)’)[-Wincompatible-function pointer types] 68s] 142 xmlHashScan(r, PmmRegistryDumpllashScanner, NuLL); - -2、问题定位 +``` +## 2、问题定位 ## 函数指针类型不兼容 问题出在源码中perl-libxml-mm.c文件中PmmRegistryDumpHashScanner函数定义(也就是 void (void *, void *, unsigned char *) )与xmlHashScan 函数期望的函数指针类型 xmlHashScanner(也就是 void (*)(void *, void *, const unsigned char *) )不匹配需要修改函数定义 -3、修改建议 +## 3、修改建议 ## 在perl-libxml-mm.c文件中PmmRegistryDumpHashScanner函数定义部分的第三个参数前加上const 即将 +``` void PmmRegistryDumpHashScanner(void * payload, void * data, xmlChar * name) +``` 改为 -void PmmRegistryDumpHashScanner(void * payload, void * data,const xmlChar * name) \ No newline at end of file +``` +void PmmRegistryDumpHashScanner(void * payload, void * data,const xmlChar * name) +``` \ No newline at end of file diff --git "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/pkcs11-helper.md" "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/pkcs11-helper.md" index f196afc..d674e2f 100644 --- "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/pkcs11-helper.md" +++ "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/pkcs11-helper.md" @@ -1,27 +1,27 @@ -pkcs11-helper +# pkcs11-helper # -1、问题现象 +## 1、问题现象 ## 出自:https://gitee.com/src-openeuler/pkcs11-helper(openEuler-24.03-LTS) - +``` [ 101s] pkcs11h-openssl.c:1108:3: error: incompatible function pointer types passing 'int (CRYPTO_EX_DATA *, const CRYPTO_EX_DATA *, void *, int, long, void *)' (aka 'int (struct crypto_ex_data_st *, const struct crypto_ex_data_st *, void *, int, long, void *)') to parameter of type 'CRYPTO_EX_dup *' (aka 'int (*)(struct crypto_ex_data_st *, const struct crypto_ex_data_st *, void **, int, long, void *)') [-Wincompatible-function-pointer-types] [ 101s] 1108 | __pkcs11h_openssl_ex_data_dup, [ 101s] | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [ 101s] /usr/include/openssl/rsa.h:444:62: note: expanded from macro 'RSA_get_ex_new_index' [ 101s] 444 | CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_RSA, l, p, newf, dupf, freef) [ 101s] | ^~~~ - -2、问题定位 +``` +## 2、问题定位 ## 这个错误表明在 pkcs11h-openssl.c 文件的第 1108 行,传递的函数指针类型与期望的类型不兼容。 -具体来说,正在尝试将函数 __pkcs11h_openssl_ex_data_dup 的指针传递给一个期望类型为 CRYPTO_EX_dup *(即 int (*)(struct crypto_ex_data_st *, const struct crypto_ex_data_st *, void **, int, long, void *))的参数,但 __pkcs11h_openssl_ex_data_dup 的类型是 int (CRYPTO_EX_DATA *, const CRYPTO_EX_DATA *, void *, int, long, void *)(等同于 int (struct crypto_ex_data_st *, const struct crypto_ex_data_st *, void *, int, long, void *))。 +具体来说,正在尝试将函数 __pkcs11h_openssl_ex_data_dup 的指针传递给一个期望类型为` CRYPTO_EX_dup *(即 int (*)(struct crypto_ex_data_st *, const struct crypto_ex_data_st *, void **, int, long, void *))`的参数,但 __pkcs11h_openssl_ex_data_dup 的类型是` int (CRYPTO_EX_DATA *, const CRYPTO_EX_DATA *, void *, int, long, void *)(等同于 int (struct crypto_ex_data_st *, const struct crypto_ex_data_st *, void *, int, long, void *))`。 即__pkcs11h_openssl_ex_data_dup函数定义的第三个参数有问题: 需要的是void ** 结果传递的是void * -3、修改建议 +## 3、修改建议 ## 在lib/pkcs11h-openssl.c文件中将__pkcs11h_openssl_ex_data_dup函数定义中的void *from_d, 改为void **from_d, diff --git "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/python-dmidecode.1.md" "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/python-dmidecode.1.md" index 152f080..9f4a3d0 100644 --- "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/python-dmidecode.1.md" +++ "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/python-dmidecode.1.md" @@ -1,26 +1,29 @@ -python-dmidecode.1 +# python-dmidecode.1 # -1、问题现象 +## 1、问题现象 ## 出自:https://gitee.com/src-openeuler/python-dmidecode(openEuler-24.03-LTS) - +``` [ 75s] src/dmidecodemodule.c:916:28: error: incompatible function pointer types initializing 'PyCFunction' (aka 'struct _object *(*)(struct _object *, struct _object *)') with an expression of type 'PyObject *(PyObject *, PyObject *, PyObject *)' (aka 'struct _object *(struct _object *, struct _object *, struct _object *)') [-Wincompatible-function-pointer-types] [ 75s] 916 | {(char *)"xmlapi", dmidecode_xmlapi, METH_VARARGS | METH_KEYWORDS, [ 75s] | ^~~~~~~~~~~~~~~~ - -2、问题定位 +``` +## 2、问题定位 ## 即不兼容的函数指针类型错误: -在第src/dmidecodemodule.c的 916 行,尝试将一个函数指针类型为PyObject *(PyObject *, PyObject *, PyObject *)的表达式初始化为PyCFunction类型(即struct _object *(*)(struct _object *, struct _object *))。这意味着函数的参数个数不匹配,一个接受三个参数,一个只接受两个参数。 +在第src/dmidecodemodule.c的 916 行,尝试将一个函数指针类型为`PyObject *(PyObject *, PyObject *, PyObject *)`的表达式初始化为PyCFunction类型(即struct _object *(*)(struct _object *, struct _object *))。这意味着函数的参数个数不匹配,一个接受三个参数,一个只接受两个参数。 -3、修改建议 +## 3、修改建议 ## 首先我尝试进行封装,但是依旧报错,于是我再次尝试进行手动数据类型转换 即将 +``` {(char *)"xmlapi", dmidecode_xmlapi, METH_VARARGS | METH_KEYWORDS, (char *) "Internal API for retrieving data as raw XML data"}, - +``` 改为 +``` {"xmlapi", (PyCFunction)dmidecode_xmlapi, METH_VARARGS | METH_KEYWORDS, "Internal API for retrieving data as raw XML data"}, +``` 即可修复这个问题 \ No newline at end of file diff --git "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/python-dmidecode.2.md" "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/python-dmidecode.2.md" index e69f27a..c131a4f 100644 --- "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/python-dmidecode.2.md" +++ "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/python-dmidecode.2.md" @@ -1,24 +1,26 @@ -python-dmidecode.2 +# python-dmidecode.2 # -1、问题现象 +## 1、问题现象 ## 出自:https://gitee.com/src-openeuler/python-dmidecode(openEuler-24.03-LTS) - +``` [ 75s] src/dmidecodemodule.c:1027:72: error: incompatible function pointer types passing 'void (void *)' to parameter of type 'PyCapsule_Destructor' (aka 'void (*)(struct _object *)') [-Wincompatible-function-pointer-types] [ 75s] 1027 | PyModule_AddObject(module, "options", PyCapsule_New(opt, NULL, destruct_options)); [ 75s] | ^~~~~~~~~~~~~~~~ - -2、问题定位 +``` +## 2、问题定位 ## 即这个错误表明在将一个函数指针作为PyCapsule的析构函数传递时,函数指针类型不兼容。 具体来说,错误发生在src/dmidecodemodule.c文件的第 1027 行,尝试将一个类型为void (void *)的函数指针传递给期望类型为PyCapsule_Destructor(即void (*)(struct _object *))的参数。 -3、修改建议 +## 3、修改建议 ## 将函数定义由void destruct_options(void *ptr)换为void destruct_options(PyObject *capsule) { 再通过 +``` void *ptr = PyCapsule_GetPointer(capsule, NULL); options *opt = (options *) ptr; +``` 使该代码与原来的部分保持一致 即可解决问题 \ No newline at end of file diff --git "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/python-sybil.md" "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/python-sybil.md" index 6f13b2a..769c87b 100644 --- "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/python-sybil.md" +++ "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/python-sybil.md" @@ -1,14 +1,14 @@ -python-sybil +# python-sybil # -1、问题现象 +## 1、问题现象 ## 出自:https://gitee.com/src-openeuler/python-sybil (openEuler-24.03-LTS)、 - +``` [ 75s] FAILED tests/test_functional.py::test_pytest - AssertionError: [ 75s] ========================= 1 failed, 80 passed in 2.82s ========================= [ 75s] error: Bad exit status from /var/tmp/rpm-tmp.vV5eGG (%check) - -2、问题定位 +``` +## 2、问题定位 ## 问题为偶发性问题,十次构建未必失败一次,本地构建也成功,怀疑为obs的问题 \ No newline at end of file diff --git "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/rarian.md" "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/rarian.md" index 6052e43..2251430 100644 --- "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/rarian.md" +++ "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/rarian.md" @@ -1,19 +1,19 @@ -rarian +# rarian # -1、问题现象 +## 1、问题现象 ## 出自:https://gitee.com/src-openeuler/rarian(openEuler-24.03-LTS) - +``` [ 79s] rarian-example.c:80:1: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int] [ 79s] 80 | info_for_each (RrnInfoEntry *entry, void *data) [ 79s] | ^ [ 79s] | int - -2、问题定位 +``` +## 2、问题定位 ## 即rarian-example.c 文件的第 80 行,定义函数时没有明确指定函数的返回类型,编译器默认认为是 int,但在 ISO C99 及更高版本中不支持这种隐式的 int 类型声明。 要解决这个问题,可以在函数定义处明确指定函数的返回类型。 -3、修改建议 +## 3、修改建议 ## 只要在函数前加一个int即可 \ No newline at end of file diff --git "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/satyr.md" "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/satyr.md" index 231ae20..48e26cc 100644 --- "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/satyr.md" +++ "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/satyr.md" @@ -1,14 +1,14 @@ -satyr +# satyr # -1、问题现象 +## 1、问题现象 ## 出自:https://gitee.com/src-openeuler/satyr(openEuler-24.03-LTS) - +``` FAIL: core_stacktrace ...... FAIL: 1 - -2、问题定位 +``` +## 2、问题定位 ## 该问题上游已经解决,obs平台上aarch是succeed x86是fail diff --git "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/sysstat.md" "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/sysstat.md" index 25428e6..1e06570 100644 --- "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/sysstat.md" +++ "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/sysstat.md" @@ -1,17 +1,17 @@ -sysstat +# sysstat # -1、问题现象 +## 1、问题现象 ## 出自:https://gitee.com/src-openeuler/sysstat(openEuler-24.03-LTS) - +``` [ 72s] rd_stats.c:995:4: error: non-void function 'read_tty_driver_serial' should return a value [-Wreturn-type] [ 72s] 995 | return; [ 72s] | ^ - -2、问题定位 +``` +## 2、问题定位 ## 上一个人提交的patch里,return后面没有返回值 -3.解决方案 +## 3.解决方案 ## 在return后面加上返回值0即可解决问题 \ No newline at end of file diff --git "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/tpm2-tss.md" "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/tpm2-tss.md" index cc4227f..65b0421 100644 --- "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/tpm2-tss.md" +++ "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/tpm2-tss.md" @@ -1,11 +1,11 @@ -tpm2-tss +# tpm2-tss # -1、问题现象 +## 1、问题现象 ## 出自:https://gitee.com/src-openeuler/tpm2-tss(openEuler-24.03-LTS) aarch成功,x86失败 - +``` [ 1109s] ERROR: test/integration/sys-asymmetric-encrypt-decrypt.int [ 1249s] ERROR: test/integration/sys-nv-policy-locality.int [ 1388s] ERROR: test/integration/sys-nv-readwrite.int @@ -26,17 +26,21 @@ aarch成功,x86失败 [29647s] # FAIL: 0 [29647s] # XPASS: 0 [29647s] # ERROR: 205 +``` 总结为: test/integration目录下全部error -2、问题定位 +## 2、问题定位 ## -第一次我对比aarch和x86的日志,发现aarch与x86大部分相同,区别在于aarch的日志中会出现大量的clang: warning: argument unused during compilation: '-fstack-clash-protection' [-Wunused-command-line-argument]警告 +第一次我对比aarch和x86的日志,发现aarch与x86大部分相同,区别在于aarch的日志中会出现大量的`clang: warning: argument unused during compilation: '-fstack-clash-protection' [-Wunused-command-line-argument]`警告 而x86的日志中从未出现过类似的警告 -这种情况在之前的satyr包中也出现过,当时的解决方案是加入%if "%toolchain" == "clang" +这种情况在之前的satyr包中也出现过,当时的解决方案是加入 +``` +%if "%toolchain" == "clang" export CFLAGS="$CFLAGS -Wno-error=unused-command-line-argument" %endif(简称为可用降级操作) +``` 即可通过,unused-command-line-argument后续会加入,所以当做社区已修复 而在tpm2-tss这个包里加入类似的代码却没有反应,这条修复路径就此阻塞 @@ -46,14 +50,16 @@ test/integration目录下全部error 第三次我怀疑之所以aarch成功而x86失败是因为aarch架构和x86架构下的clang的指令集不同,又出错的单元为unit和integration,于是我将%build下做了一个判断将integration删除,结果成功 -3.解决方案 +## 3.解决方案 ## 即将 +``` %configure --disable-static --disable-silent-rules --with-udevrulesdir=%{_udevrulesdir} --with-udevrulesprefix=80- \ --with-runstatedir=%{_rundir} --with-tmpfilesdir=%{_tmpfilesdir} --with-sysusersdir=%{_sysusersdir} \ --enable-unit --enable-integration - +``` 改为 +``` %if "%toolchain" == "clang" %configure --disable-static --disable-silent-rules --with-udevrulesdir=%{_udevrulesdir} --with-udevrulesprefix=80- \ --with-runstatedir=%{_rundir} --with-tmpfilesdir=%{_tmpfilesdir} --with-sysusersdir=%{_sysusersdir} @@ -63,4 +69,5 @@ test/integration目录下全部error --enable-unit --enable-integration %endif +``` 不影响ci和gcc \ No newline at end of file diff --git "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/trace-cmd.md" "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/trace-cmd.md" index 79fb81e..a130433 100644 --- "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/trace-cmd.md" +++ "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/trace-cmd.md" @@ -1,9 +1,9 @@ -trace-cmd +# trace-cmd # -1、问题现象 +## 1、问题现象 ## 出自:https://gitee.com/src-openeuler/trace-cmd(openEuler-24.03-LTS) - +``` [ 111s] trace-hooks.c:135:5: error: call to undeclared function 'warning'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] [ 111s] 135 | warning("unknown flag %c\n", flags[i]); [ 111s] | ^ @@ -11,17 +11,17 @@ trace-cmd [ 111s] 152 | warning("Invalid hook format '%s'", arg); [ 111s] | ^ [ 111s] 2 errors generated. - +``` 即调用了未声明的函数warning -2、问题定位 +## 2、问题定位 ## 即在trace-hooks.c文件中调用了未声明的函数warning 尝试在这个文件里加入相关定义后,别的文件又出现了同样的问题 依次加上之后就解决了问题 -3.解决方案 +## 3.解决方案 ## 在相关c文件里补上warning函数定义即可 -void warning(const char *fmt, ...); \ No newline at end of file +`void warning(const char *fmt, ...); ` \ No newline at end of file diff --git "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/vdo.md" "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/vdo.md" index 87594e5..6b50b78 100644 --- "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/vdo.md" +++ "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/vdo.md" @@ -1,28 +1,30 @@ -vdo +# vdo # -1、问题现象 +## 1、问题现象 ## 出自:https://gitee.com/src-openeuler/vdo (openEuler-24.03-LTS) - +``` [ 77s] error: unknown warning option '-Wlogical-op'; did you mean '-Wlong-long'? [-Werror,-Wunknown-warning-option] [ 77s] make[2]: *** [Makefile:137: murmurhash3.o] Error 1 [ 77s] make[2]: Leaving directory '/home/abuild/rpmbuild/BUILD/vdo-8.2.2.2/utils/uds' [ 77s] make[2]: Entering directory '/home/abuild/rpmbuild/BUILD/vdo-8.2.2.2/utils/uds' [ 77s] clang -O2 -g -grecord-gcc-switches -pipe -fstack-protector-strong -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS --config /usr/lib/rpm/generic-hardened-clang.cfg -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -D_GNU_SOURCE -g -O3 -fno-omit-frame-pointer -Wall -Wcast-align -Werror -Wextra -Winit-self -Wlogical-op -Wmissing-include-dirs -Wpointer-arith -Wredundant-decls -Wunused -Wwrite-strings -DCURRENT_VERSION='"8.2.2.2"' -I. -std=gnu99 -pedantic -Wbad-function-cast -Wcast-qual -Wfloat-equal -Wformat=2 -Wmissing-declarations -Wmissing-format-attribute -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wswitch-default -c -MD -MF .deps/buffer.d.new -MP -MT buffer.o buffer.c -o buffer.o - -2、问题定位 +``` +## 2、问题定位 ## 即utils/uds/Makefile文件和utils/vdo/Makefile文件中的-WARNS和-C_WARNS部分是clang不接受的形式, -3.解决方案 +## 3.解决方案 ## 于是做了一个判断,如果编译器为gcc则执行-WARNS和-C_WARNS,如果是clang则不执行,成功修复 即 +``` +# Define WARNS and C_WARNS only if using gcc +CLANG_VERSION := $(shell $(CC) --version | grep -i clang) +ifeq ($(findstring clang, $(CLANG_VERSION)),clang) +WARNS = +C_WARNS = -+else \ No newline at end of file ++else +``` \ No newline at end of file -- Gitee From f5d42dd14785dbea701edb2b684a0cf53996ba14 Mon Sep 17 00:00:00 2001 From: shen-chenbang <1944340417@qq.com> Date: Sun, 29 Sep 2024 09:28:21 +0800 Subject: [PATCH 5/6] support clang --- .../openssh.1.md" | 2 +- .../openssh.2.md" | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/openssh.1.md" "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/openssh.1.md" index c05506e..4479085 100644 --- "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/openssh.1.md" +++ "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/openssh.1.md" @@ -1,4 +1,4 @@ -# openssh # +# openssh.1 # ## 1、问题现象 ## 出自:https://gitee.com/src-openeuler/openssh(openEuler-24.03-LTS) diff --git "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/openssh.2.md" "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/openssh.2.md" index dc17638..c0b3f0c 100644 --- "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/openssh.2.md" +++ "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/openssh.2.md" @@ -1,4 +1,4 @@ -# openssh # +# openssh.2 # ## 1、问题现象 ## 出自:https://gitee.com/src-openeuler/openssh(openEuler-24.03-LTS) -- Gitee From 26c32a30fbaa1c486533ba6ef74a781411551bea Mon Sep 17 00:00:00 2001 From: shen-chenbang <1944340417@qq.com> Date: Sun, 29 Sep 2024 09:48:27 +0800 Subject: [PATCH 6/6] support clang --- .../openssh.1.md" | 4 +- .../openssh.2.md" | 2 +- .../perl-XML-LibXML.md" | 4 +- .../pkcs11-helper.md" | 23 ++++++++- .../python-dmidecode.1.md" | 10 +++- .../python-dmidecode.2.md" | 10 +++- .../python-sybil.md" | 2 +- .../rarian.md" | 47 ++++++++++++++++++- .../satyr.md" | 2 +- .../sysstat.md" | 19 ++++++-- .../tpm2-tss.md" | 2 +- .../trace-cmd.md" | 9 +++- .../vdo.md" | 27 ++++++++++- 13 files changed, 139 insertions(+), 22 deletions(-) diff --git "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/openssh.1.md" "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/openssh.1.md" index 4479085..1dcab7a 100644 --- "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/openssh.1.md" +++ "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/openssh.1.md" @@ -7,12 +7,12 @@ [ 188s] ssh-ecdsa.c:267:6: error: call to undeclared function 'is_ecdsa_pkcs11'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] [ 188s] 267 | if (is_ecdsa_pkcs11(key->ecdsa)) { ^ ``` -## 2、问题定位 ## +## 2、问题定位及根因分析 ## 源代码中没有出现问题代码 问题出在openssh-9.3p1-merged-openssl-evp.patch中 is_ecdsa_pkcs11函数调用了一个未声明的函数,而这个函数在ssh-pkcs11.h中定义了,这就是导致这个问题的原因 - +`if (key->ecdsa != NULL && is_ecdsa_pkcs11(key->ecdsa)) {` ## 3、修改建议 ## 在ssh-rsa.c和ssh-ecdsa.c中加入头文件 diff --git "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/openssh.2.md" "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/openssh.2.md" index c0b3f0c..e64567c 100644 --- "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/openssh.2.md" +++ "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/openssh.2.md" @@ -10,7 +10,7 @@ ``` 这意味着在尝试将 SELinux 的强制模式设置为宽容模式时,由于没有足够的权限,操作未能成功 -## 2、问题定位 ## +## 2、问题定位及根因分析 ## 源代码中没有出现问题代码 spec文件中: diff --git "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/perl-XML-LibXML.md" "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/perl-XML-LibXML.md" index b6714cc..903baa6 100644 --- "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/perl-XML-LibXML.md" +++ "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/perl-XML-LibXML.md" @@ -11,11 +11,11 @@ void (*)(void *, void *, const unsigned char *)’)[-Wincompatible-function poin 142 xmlHashScan(r, PmmRegistryDumpllashScanner, NuLL); ``` -## 2、问题定位 ## +## 2、问题定位及根因分析 ## 函数指针类型不兼容 问题出在源码中perl-libxml-mm.c文件中PmmRegistryDumpHashScanner函数定义(也就是 void (void *, void *, unsigned char *) )与xmlHashScan 函数期望的函数指针类型 xmlHashScanner(也就是 void (*)(void *, void *, const unsigned char *) )不匹配需要修改函数定义 - +`void PmmRegistryDumpHashScanner(void * payload, void * data, xmlChar * name)` ## 3、修改建议 ## 在perl-libxml-mm.c文件中PmmRegistryDumpHashScanner函数定义部分的第三个参数前加上const diff --git "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/pkcs11-helper.md" "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/pkcs11-helper.md" index d674e2f..e2069e1 100644 --- "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/pkcs11-helper.md" +++ "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/pkcs11-helper.md" @@ -11,12 +11,21 @@ [ 101s] 444 | CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_RSA, l, p, newf, dupf, freef) [ 101s] | ^~~~ ``` -## 2、问题定位 ## +## 2、问题定位及根因分析 ## 这个错误表明在 pkcs11h-openssl.c 文件的第 1108 行,传递的函数指针类型与期望的类型不兼容。 具体来说,正在尝试将函数 __pkcs11h_openssl_ex_data_dup 的指针传递给一个期望类型为` CRYPTO_EX_dup *(即 int (*)(struct crypto_ex_data_st *, const struct crypto_ex_data_st *, void **, int, long, void *))`的参数,但 __pkcs11h_openssl_ex_data_dup 的类型是` int (CRYPTO_EX_DATA *, const CRYPTO_EX_DATA *, void *, int, long, void *)(等同于 int (struct crypto_ex_data_st *, const struct crypto_ex_data_st *, void *, int, long, void *))`。 - +``` +__pkcs11h_openssl_ex_data_dup ( + CRYPTO_EX_DATA *to, + CRYPTO_EX_DATA *from, + void *from_d, + int idx, + long argl, + void *argp +) +``` 即__pkcs11h_openssl_ex_data_dup函数定义的第三个参数有问题: 需要的是void ** 结果传递的是void * @@ -26,3 +35,13 @@ 在lib/pkcs11h-openssl.c文件中将__pkcs11h_openssl_ex_data_dup函数定义中的void *from_d, 改为void **from_d, 因为有两个该函数,是在判断条件下执行不同的函数,所以要改两次 +``` +__pkcs11h_openssl_ex_data_dup ( + CRYPTO_EX_DATA *to, + CRYPTO_EX_DATA *from, + void **from_d, + int idx, + long argl, + void *argp +) +``` diff --git "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/python-dmidecode.1.md" "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/python-dmidecode.1.md" index 9f4a3d0..f1af826 100644 --- "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/python-dmidecode.1.md" +++ "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/python-dmidecode.1.md" @@ -8,11 +8,17 @@ [ 75s] 916 | {(char *)"xmlapi", dmidecode_xmlapi, METH_VARARGS | METH_KEYWORDS, [ 75s] | ^~~~~~~~~~~~~~~~ ``` -## 2、问题定位 ## +## 2、问题定位及根因分析 ## 即不兼容的函数指针类型错误: 在第src/dmidecodemodule.c的 916 行,尝试将一个函数指针类型为`PyObject *(PyObject *, PyObject *, PyObject *)`的表达式初始化为PyCFunction类型(即struct _object *(*)(struct _object *, struct _object *))。这意味着函数的参数个数不匹配,一个接受三个参数,一个只接受两个参数。 - +``` +static PyObject *dmidecode_xmlapi(PyObject *self, PyObject *args, PyObject *keywds) +``` +``` +{(char *)"xmlapi", dmidecode_xmlapi, METH_VARARGS | METH_KEYWORDS, +(char *) "Internal API for retrieving data as raw XML data"}, +``` ## 3、修改建议 ## 首先我尝试进行封装,但是依旧报错,于是我再次尝试进行手动数据类型转换 diff --git "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/python-dmidecode.2.md" "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/python-dmidecode.2.md" index c131a4f..e36b271 100644 --- "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/python-dmidecode.2.md" +++ "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/python-dmidecode.2.md" @@ -8,11 +8,19 @@ [ 75s] 1027 | PyModule_AddObject(module, "options", PyCapsule_New(opt, NULL, destruct_options)); [ 75s] | ^~~~~~~~~~~~~~~~ ``` -## 2、问题定位 ## +## 2、问题定位及根因分析 ## 即这个错误表明在将一个函数指针作为PyCapsule的析构函数传递时,函数指针类型不兼容。 具体来说,错误发生在src/dmidecodemodule.c文件的第 1027 行,尝试将一个类型为void (void *)的函数指针传递给期望类型为PyCapsule_Destructor(即void (*)(struct _object *))的参数。 +``` +void destruct_options(void *ptr) +{ +#ifdef IS_PY3K + ptr = PyCapsule_GetPointer(ptr, NULL); +#endif + options *opt = (options *) ptr; +``` ## 3、修改建议 ## 将函数定义由void destruct_options(void *ptr)换为void destruct_options(PyObject *capsule) { diff --git "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/python-sybil.md" "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/python-sybil.md" index 769c87b..3578f68 100644 --- "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/python-sybil.md" +++ "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/python-sybil.md" @@ -9,6 +9,6 @@ [ 75s] ========================= 1 failed, 80 passed in 2.82s ========================= [ 75s] error: Bad exit status from /var/tmp/rpm-tmp.vV5eGG (%check) ``` -## 2、问题定位 ## +## 2、问题定位及根因分析 ## 问题为偶发性问题,十次构建未必失败一次,本地构建也成功,怀疑为obs的问题 \ No newline at end of file diff --git "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/rarian.md" "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/rarian.md" index 2251430..75e018f 100644 --- "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/rarian.md" +++ "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/rarian.md" @@ -9,11 +9,54 @@ [ 79s] | ^ [ 79s] | int ``` -## 2、问题定位 ## +## 2、问题定位及根因分析 ## 即rarian-example.c 文件的第 80 行,定义函数时没有明确指定函数的返回类型,编译器默认认为是 int,但在 ISO C99 及更高版本中不支持这种隐式的 int 类型声明。 +``` +info_for_each (RrnInfoEntry *entry, void *data) +{ + if (entry->section) + printf ("Info page: %s\n\tPath: %s#%s\n\tComment: %s\n", + entry->doc_name, entry->base_filename, + entry->section, entry->comment); + else + printf ("Info page: %s\n\tPath: %s\n\tComment: %s\n", + entry->doc_name, entry->base_filename, + entry->comment); + return TRUE; +} + +man_for_each (RrnManEntry *entry, void *data) +{ + printf ("Man page %s\n", entry->name); + printf ("\tPath: %s\n", entry->path); + return TRUE; +} +``` 要解决这个问题,可以在函数定义处明确指定函数的返回类型。 ## 3、修改建议 ## -只要在函数前加一个int即可 \ No newline at end of file +只要在函数前加一个int即可 +``` +int +info_for_each (RrnInfoEntry *entry, void *data) +{ + if (entry->section) + printf ("Info page: %s\n\tPath: %s#%s\n\tComment: %s\n", + entry->doc_name, entry->base_filename, + entry->section, entry->comment); + else + printf ("Info page: %s\n\tPath: %s\n\tComment: %s\n", + entry->doc_name, entry->base_filename, + entry->comment); + return TRUE; +} + +man_for_each (RrnManEntry *entry, void *data) +{ + printf ("Man page %s\n", entry->name); + printf ("\tPath: %s\n", entry->path); + return TRUE; +} +``` \ No newline at end of file diff --git "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/satyr.md" "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/satyr.md" index 48e26cc..ee2f819 100644 --- "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/satyr.md" +++ "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/satyr.md" @@ -8,7 +8,7 @@ FAIL: core_stacktrace ...... FAIL: 1 ``` -## 2、问题定位 ## +## 2、问题定位及根因分析 ## 该问题上游已经解决,obs平台上aarch是succeed x86是fail diff --git "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/sysstat.md" "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/sysstat.md" index 1e06570..7fae5e9 100644 --- "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/sysstat.md" +++ "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/sysstat.md" @@ -8,10 +8,23 @@ [ 72s] 995 | return; [ 72s] | ^ ``` -## 2、问题定位 ## +## 2、问题定位及根因分析 ## 上一个人提交的patch里,return后面没有返回值 - +``` ++ if ((fp = fopen(TTYAMA, "r")) == NULL) { ++ if ((fp = fopen(SERIAL, "r")) == NULL) { ++ return; ++ } ++ } +``` ## 3.解决方案 ## -在return后面加上返回值0即可解决问题 \ No newline at end of file +在return后面加上返回值0即可解决问题 +``` ++ if ((fp = fopen(TTYAMA, "r")) == NULL) { ++ if ((fp = fopen(SERIAL, "r")) == NULL) { ++ return 0; ++ } ++ } +``` \ No newline at end of file diff --git "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/tpm2-tss.md" "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/tpm2-tss.md" index 65b0421..fc4a1e6 100644 --- "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/tpm2-tss.md" +++ "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/tpm2-tss.md" @@ -30,7 +30,7 @@ aarch成功,x86失败 总结为: test/integration目录下全部error -## 2、问题定位 ## +## 2、问题定位及根因分析 ## 第一次我对比aarch和x86的日志,发现aarch与x86大部分相同,区别在于aarch的日志中会出现大量的`clang: warning: argument unused during compilation: '-fstack-clash-protection' [-Wunused-command-line-argument]`警告 而x86的日志中从未出现过类似的警告 diff --git "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/trace-cmd.md" "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/trace-cmd.md" index a130433..2b47c40 100644 --- "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/trace-cmd.md" +++ "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/trace-cmd.md" @@ -14,10 +14,15 @@ ``` 即调用了未声明的函数warning -## 2、问题定位 ## +## 2、问题定位及根因分析 ## 即在trace-hooks.c文件中调用了未声明的函数warning - +``` +invalid_tok: + warning("Invalid hook format '%s'", arg); + return NULL; +} +``` 尝试在这个文件里加入相关定义后,别的文件又出现了同样的问题 依次加上之后就解决了问题 diff --git "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/vdo.md" "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/vdo.md" index 6b50b78..060a929 100644 --- "a/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/vdo.md" +++ "b/\351\227\256\351\242\230\344\277\256\346\224\271\346\226\207\346\241\243/vdo.md" @@ -11,10 +11,33 @@ [ 77s] make[2]: Entering directory '/home/abuild/rpmbuild/BUILD/vdo-8.2.2.2/utils/uds' [ 77s] clang -O2 -g -grecord-gcc-switches -pipe -fstack-protector-strong -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS --config /usr/lib/rpm/generic-hardened-clang.cfg -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -D_GNU_SOURCE -g -O3 -fno-omit-frame-pointer -Wall -Wcast-align -Werror -Wextra -Winit-self -Wlogical-op -Wmissing-include-dirs -Wpointer-arith -Wredundant-decls -Wunused -Wwrite-strings -DCURRENT_VERSION='"8.2.2.2"' -I. -std=gnu99 -pedantic -Wbad-function-cast -Wcast-qual -Wfloat-equal -Wformat=2 -Wmissing-declarations -Wmissing-format-attribute -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wswitch-default -c -MD -MF .deps/buffer.d.new -MP -MT buffer.o buffer.c -o buffer.o ``` -## 2、问题定位 ## +## 2、问题定位及根因分析 ## -即utils/uds/Makefile文件和utils/vdo/Makefile文件中的-WARNS和-C_WARNS部分是clang不接受的形式, +即utils/uds/Makefile文件和utils/vdo/Makefile文件中的-WARNS和-C_WARNS部分是clang不接受的形式 +``` +WARNS = -Wall \ + -Wcast-align \ + -Werror \ + -Wextra \ + -Winit-self \ + -Wlogical-op \ + -Wmissing-include-dirs \ + -Wpointer-arith \ + -Wredundant-decls \ + -Wunused \ + -Wwrite-strings +C_WARNS = -Wbad-function-cast \ + -Wcast-qual \ + -Wfloat-equal \ + -Wformat=2 \ + -Wmissing-declarations \ + -Wmissing-format-attribute \ + -Wmissing-prototypes \ + -Wnested-externs \ + -Wold-style-definition \ + -Wswitch-default +``` ## 3.解决方案 ## 于是做了一个判断,如果编译器为gcc则执行-WARNS和-C_WARNS,如果是clang则不执行,成功修复 -- Gitee