Libelektra: cmerge:segfault

创建于 2019-11-15  ·  7评论  ·  资料来源: ElektraInitiative/libelektra

重现问题的步骤

配置并制作libelektra。

make run all

预期结果

所有测试均成功。

实际结果

The following tests FAILED:
    210 - testshell_markdown_cmerge (Failed)
    225 - test_cmerge (SEGFAULT)
 valgrind ./bin/test_cmerge
==200629== Memcheck, a memory error detector
==200629== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==200629== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info
==200629== Command: ./bin/test_cmerge
==200629== 
CMERGE       TESTS
==================

Executing testValuesWithGivenLength with size 59
==200629== Jump to the invalid address stated on the next line
==200629==    at 0x0: ???
==200629==    by 0xF: ???
==200629==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==200629== 
==200629== 
==200629== Process terminating with default action of signal 11 (SIGSEGV): dumping core
==200629==  Bad permissions for mapped region at address 0x0
==200629==    at 0x0: ???
==200629==    by 0xF: ???
==200629== 
==200629== HEAP SUMMARY:
==200629==     in use at exit: 4,388 bytes in 64 blocks
==200629==   total heap usage: 169 allocs, 105 frees, 81,447 bytes allocated
==200629== 
==200629== LEAK SUMMARY:
==200629==    definitely lost: 0 bytes in 0 blocks
==200629==    indirectly lost: 0 bytes in 0 blocks
==200629==      possibly lost: 0 bytes in 0 blocks
==200629==    still reachable: 4,388 bytes in 64 blocks
==200629==         suppressed: 0 bytes in 0 blocks
==200629== Rerun with --leak-check=full to see details of leaked memory
==200629== 
==200629== For lists of detected and suppressed errors, rerun with: -s
==200629== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
[1]    200629 segmentation fault (core dumped)  valgrind ./bin/test_cmerge

系统信息

  • Elektra版本:大师
  • 浅顶软呢帽31

更多日志文件和输出

cmerge.txt

最有用的评论

@ Chemin1感谢您如此迅速地修复它。 我可以确认它现在对我有用。

所有7条评论

我在Linux上有libgit2 0.28.3,这不起作用。 删除代码中的CMERGE_ON_LINUX检查可修复segfault。
https://github.com/ElektraInitiative/libelektra/blob/4ee9617186fe053107530624b27ff2825478f257/src/libs/merge/kdbmerge.c#L991

感谢您报告此问题!

我们绝对应该在0.9.1之前解决此问题。 也许在这种情况下,只需禁用libgit2即可。

@mpranj还可以发布gdb输出吗,valgrind输出不是那么有用。

我敢打赌这与LibGit有关。 该库应根据其文档使用git_libgit2_init()初始化。

如果不在构建服务器上的所有Linux上初始化LibGit,则不会发生内存泄漏。 如果我们初始化,我们就会这样做。 但是,如果我们不为FreeBSD构建初始化,则会出现段错误。 这就是那些奇怪的ifdef存在的原因。 我也对此发表了第一篇Stackoverflow帖子

希望#3221解决此问题。

Gdb输出也不是很有帮助。 我不确定为什么,我有库的调试符号,并且是elektra的Debug版本。

GNU gdb (GDB) Fedora 8.3.50.20190824-24.fc31
Copyright (C) 2019 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 "x86_64-redhat-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://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 ./bin/test_cmerge...
(gdb) r
Starting program: /home/mpranj/workspace/libelektra/build/bin/test_cmerge 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
CMERGE       TESTS
==================

Executing testValuesWithGivenLength with size 59

Program received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
(gdb) q

我已经验证了#ifndef CMERGE_ON_LINUX是系统上的根本原因,但是我没有时间为其制作便携式补丁。

@ Chemin1感谢您的努力!

@ Chemin1感谢您如此迅速地修复它。 我可以确认它现在对我有用。

感谢您对其进行测试, @mpranj

此页面是否有帮助?
0 / 5 - 0 等级

相关问题

markus2330 picture markus2330  ·  3评论

mpranj picture mpranj  ·  3评论

mpranj picture mpranj  ·  4评论

mpranj picture mpranj  ·  3评论

mpranj picture mpranj  ·  3评论