cccc crashed with SIGABRT in __gnu_cxx::__verbose_terminate_handler()

Bug #1504454 reported by Thomas A. F. Thorne
This bug report is a duplicate of:  Bug #376859: CCCC crashed on AMD64. Edit Remove
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cccc (Ubuntu)
Confirmed
Medium
Unassigned

Bug Description

I was in a sub-directory of a C and C++ project that I am working on. In a lazy attempt at getting CCCC to look at all the files it could I ran it with:
$ cccc **
It seemed to start off by printing all directory names out and then it printed:
CCCC - a code counter for C and C++
===================================

A program to analyse C and C++ source code and report on
some simple software metrics
Version 3.1.4
Copyright Tim Littlefair, 1995, 1996, 1997, 1998, 1999, 2000
with contributions from Bill McLean, Herman Hueni, Lynn Wilson
Peter Bell, Thomas Hieber and Kenneth H. Cox.

The development of this program was heavily dependent on
the Purdue Compiler Construction Tool Set (PCCTS)
by Terence Parr, Will Cohen, Hank Dietz, Russel Quoung,
Tom Moog and others.

CCCC comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions. See the file COPYING in the source
code distribution for details.
Parsing
terminate called after throwing an instance of 'std::out_of_range'
  what(): basic_string::substr
Aborted (core dumped)

There are no C or C++ in the directory that I was in, only sub-directories which then contain code files or further sub-directories.

I shall try installing the debug symbols and then check if I can get the problem to reproduce.

1)
$ lsb_release -rd
Description: Ubuntu 14.04.3 LTS
Release: 14.04

2)
$ apt-cache policy cccc
cccc:
  Installed: 1:3.1.4-6
  Candidate: 1:3.1.4-6
  Version table:
 *** 1:3.1.4-6 0
        500 http://gb.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages
        100 /var/lib/dpkg/status
     1:3.1.4-5 0
        500 http://old-releases.ubuntu.com/ubuntu/ raring/universe amd64 Packages

3)
I expected the program to moan at me about my poor use of the command line or do some analysis.

4)
It seems to have terminated after throwing an instance of std::out_of_range

ProblemType: Crash
DistroRelease: Ubuntu 14.04
Package: cccc 1:3.1.4-6
ProcVersionSignature: Ubuntu 3.16.0-50.67~14.04.1-generic 3.16.7-ckt16
Uname: Linux 3.16.0-50-generic x86_64
ApportVersion: 2.14.1-0ubuntu3.15
Architecture: amd64
CurrentDesktop: Unity
Date: Fri Oct 9 10:02:17 2015
ExecutablePath: /usr/bin/cccc
InstallationDate: Installed on 2015-03-12 (210 days ago)
InstallationMedia: Ubuntu 14.04.2 LTS "Trusty Tahr" - Release amd64 (20150218.1)
ProcCmdline: cccc access_mgmt acl aggr altera_spi arp_inspection auth board ces cli conf daylight_saving ddmi dhcp6_client dhcp_client dhcp_helper dhcp_relay dhcp_server dhcp_snooping dns eps erps eth_link_oam evc firmware green_ethernet hpic_spi hqos https icfg icli include ip ipmc ip_misc ip_source_guard json_rpc json_rpc_notification l2proto lacp libfetch lldp loop_detect loop_protection mac macsec main md5 mep mirror misc mpls_tp msg mstp mvr nas ntp packet perf_mon perf_mon_conf phy poe port priv_lvl psec psec_limit ptp pvlan qos radius rmon sflow snmp sntp sprout ssh ssh_lib subject symreg synce syslog sysutil tacplus thermal_protect timer tn_alarm tn_ether_sat tn_external_timing tn_monitor tn_mrp tn_periph_dev tn_static_routing tod traffic_test udld upnp users util vcl vlan vlan_translation voice_vlan web xxrp zl_3034x_api
Signal: 6
SourcePackage: cccc
StacktraceTop:
 __gnu_cxx::__verbose_terminate_handler() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
 ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
 std::terminate() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
 __cxa_throw () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
 std::__throw_out_of_range(char const*) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
Title: cccc crashed with SIGABRT in __gnu_cxx::__verbose_terminate_handler()
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm cdrom dialout dip lpadmin mock plugdev sambashare sudo

Revision history for this message
Thomas A. F. Thorne (tafthorne) wrote :
Revision history for this message
Apport retracing service (apport) wrote :

StacktraceTop:
 __gnu_cxx::__verbose_terminate_handler () at ../../../../src/libstdc++-v3/libsupc++/vterminate.cc:95
 __cxxabiv1::__terminate (handler=<optimized out>) at ../../../../src/libstdc++-v3/libsupc++/eh_terminate.cc:38
 std::terminate () at ../../../../src/libstdc++-v3/libsupc++/eh_terminate.cc:48
 __cxxabiv1::__cxa_throw (obj=0x1000df0, tinfo=0x7fafff84e1f0 <typeinfo for std::out_of_range>, dest=0x7fafff5d88b0 <std::out_of_range::~out_of_range()>) at ../../../../src/libstdc++-v3/libsupc++/eh_throw.cc:87
 std::__throw_out_of_range (__s=__s@entry=0x4566fb "basic_string::substr") at ../../../../../src/libstdc++-v3/src/c++11/functexcept.cc:80

Revision history for this message
Apport retracing service (apport) wrote : Stacktrace.txt
Revision history for this message
Apport retracing service (apport) wrote : StacktraceSource.txt
Revision history for this message
Apport retracing service (apport) wrote : ThreadStacktrace.txt
Changed in cccc (Ubuntu):
importance: Undecided → Medium
tags: removed: need-amd64-retrace
information type: Private → Public
Revision history for this message
Thomas A. F. Thorne (tafthorne) wrote :

Updated to public after reviewing what has been attached. I am OK with the directory names being mentioned.

Apport did a faster job of finding the symbols than I did.

Revision history for this message
Thomas A. F. Thorne (tafthorne) wrote :

I did not need to do anything quite so clumsy with the command line this time. I was using a find to deliver files to cccc
find . -regex '.*.\(h\|c\|cxx\|cpp\)$' | cccc --outdir=/home/thomasthorne/cccc_ouput/ -

Seems a resolvable enough use case to me. If I feed only the last file that was being parsed into the program it completes. My find seems to put out 489 items, which does not sound very large.
$ cloc .
     551 text files.
     551 unique files.
      17 files ignored.

http://cloc.sourceforge.net v 1.60 T=1.38 s (388.1 files/s, 188981.2 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
C++ 146 10694 16757 62416
C 77 19894 28463 59307
C/C++ Header 257 9316 19746 25332
HTML 50 1166 1072 5705
XML 2 0 2 115
make 1 10 13 13
DOS Batch 1 2 1 6
-------------------------------------------------------------------------------
SUM: 534 41082 66054 152894
-------------------------------------------------------------------------------

I would have expected the tool to be able to handle more than 150k lines of code. I guess there must be something in my code base it does not like.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in cccc (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.