Bug 218876

Summary: devel/cppcheck: Segmentation fault
Product: Ports & Packages Reporter: Ivan Rozhuk <rozhuk.im>
Component: Individual Port(s)Assignee: Dmitry Marakasov <amdmi3>
Status: Closed DUPLICATE    
Severity: Affects Many People CC: rozhuk.im
Priority: --- Flags: bugzilla: maintainer-feedback? (amdmi3)
Version: Latest   
Hardware: Any   
OS: Any   

Description Ivan Rozhuk 2017-04-25 14:46:50 UTC
cppcheck-1.78_2
tinyxml2-2.2.0,1

cppcheck /usr/src/bin/cp/cp.c
Segmentation fault (core dumped)

(gdb) bt
#0  0x00000000005e3953 in tinyxml2::MemPoolT<104>::Alloc ()
#1  0x00000000005dcfb4 in tinyxml2::XMLDocument::Identify ()
#2  0x00000000005ddb51 in tinyxml2::XMLNode::ParseDeep ()
#3  0x00000000005e1a2b in tinyxml2::XMLDocument::LoadFile ()
#4  0x00000000005e1955 in tinyxml2::XMLDocument::LoadFile ()
#5  0x000000000051877e in Library::load ()
#6  0x0000000000456399 in CppCheckExecutor::tryLoadLibrary ()
#7  0x0000000000454da8 in CppCheckExecutor::check_internal ()
#8  0x0000000000454bf1 in CppCheckExecutor::check ()
#9  0x000000000045860b in main ()
Comment 1 Ivan Rozhuk 2017-04-25 14:54:31 UTC
Same time
cppcheck-1.75 + tinyxml2-2.2.0,1 on FreeBSD 10.2 - ok.
Comment 2 Ivan Rozhuk 2017-04-25 15:10:31 UTC
workarounds:

cp -f /usr/local/share/cppcheck/cfg/std.cfg to current dir
or
cd /usr/local/share/cppcheck/cfg/ && cppcheck ...
Comment 3 Dmitry Marakasov freebsd_committer freebsd_triage 2017-05-02 18:16:59 UTC
Cannot reproduce. Which system version do you use when you have the problem?
Comment 4 Dmitry Marakasov freebsd_committer freebsd_triage 2017-05-02 18:20:14 UTC
Also please show `make showconfig` output
Comment 5 Ivan Rozhuk 2017-05-09 01:41:39 UTC
reeBSD rimwks 11.0-STABLE FreeBSD 11.0-STABLE #3 r317805M: Thu May  4 23:17:00 MSK 2017     root@rimwks:/usr/obj/usr/src/sys/RIMWKSx64  amd64


root@rimwks# cd /usr/ports/devel/cppcheck
root@rimwks# make showconfig
===> The following configuration options are available for cppcheck-1.78_2:
     MANPAGES=off: Build and/or install manual pages
     MATCHCOMPILER=off: Build-time optimizations via Python
     RULES=on: User-defined rule support (requires PCRE)

root@rimwks# cd /usr/ports/textproc/tinyxml2
root@rimwks# make showconfig
===> The following configuration options are available for tinyxml2-2.2.0,1:
     EXAMPLES=on: Build and/or install examples
Comment 6 Dmitry Marakasov freebsd_committer freebsd_triage 2017-05-19 16:27:58 UTC

*** This bug has been marked as a duplicate of bug 217881 ***
Comment 7 commit-hook freebsd_committer freebsd_triage 2017-05-31 20:08:02 UTC
A commit references this bug:

Author: amdmi3
Date: Wed May 31 20:07:16 UTC 2017
New revision: 442261
URL: https://svnweb.freebsd.org/changeset/ports/442261

Log:
  - Update to 1.79
  - Fix segfault due to conflict between bundled and system tinyxml [1]
  - Switch to cmake build, simplifying the port
  - Enable GUI

  PR:		217881 [1], 218876 [1]

Changes:
  head/devel/cppcheck/Makefile
  head/devel/cppcheck/distinfo
  head/devel/cppcheck/files/
  head/devel/cppcheck/files/patch-CMakeLists.txt
  head/devel/cppcheck/files/patch-gui_CMakeLists.txt
  head/devel/cppcheck/files/patch-tools_matchcompiler.py
  head/devel/cppcheck/pkg-plist