[LLVMbugs] [Bug 9806] New: strncpy and strncat checkers assert when bounds argument is undefined.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Apr 28 08:02:01 PDT 2011


http://llvm.org/bugs/show_bug.cgi?id=9806

           Summary: strncpy and strncat checkers assert when bounds
                    argument is undefined.
           Product: clang
           Version: trunk
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
        AssignedTo: kremenek at apple.com
        ReportedBy: lenny at colorado.edu
                CC: llvmbugs at cs.uiuc.edu


Trace:

/home/lenny/llvm.git/tools/clang/tools/scan-build/ccc-analyzer -DHAVE_CONFIG_H
-I. -I../..    -Wall -Werror -g -DBIONET_VERSION=\"2.6.1\"    -DLINUX  -pthread
-I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include   -I../../libhab
-D_REENTRANT -I/usr/include/avahi-compat-libdns_sd/   -I../../util    -MT
random_hab-set-random-resource-value.o -MD -MP -MF
.deps/random_hab-set-random-resource-value.Tpo -c -o
random_hab-set-random-resource-value.o `test -f 'set-random-resource-value.c'
|| echo './'`set-random-resource-value.c
0  clang           0x000000000189d7ef
1  clang           0x000000000189fa62
2  libpthread.so.0 0x00002b21fa9e4b40
3  clang           0x0000000000bf18c5
4  clang           0x0000000000beedd0
5  clang           0x0000000000c4425d
clang::ento::CheckerManager::runCheckersForEvalCall(clang::ento::ExplodedNodeSet&,
clang::ento::ExplodedNodeSet const&, clang::CallExpr const*,
clang::ento::ExprEngine&, clang::ento::GraphExpander*) + 493
6  clang           0x0000000000c57498
clang::ento::ExprEngine::VisitCallExpr(clang::CallExpr const*,
clang::ento::ExplodedNode*, clang::ento::ExplodedNodeSet&) + 408
7  clang           0x0000000000c5d377
clang::ento::ExprEngine::Visit(clang::Stmt const*, clang::ento::ExplodedNode*,
clang::ento::ExplodedNodeSet&) + 487
8  clang           0x0000000000c65992
clang::ento::ExprEngine::ProcessStmt(clang::CFGStmt,
clang::ento::StmtNodeBuilder&) + 898
9  clang           0x0000000000c65d59
clang::ento::ExprEngine::processCFGElement(clang::CFGElement,
clang::ento::StmtNodeBuilder&) + 169
10 clang           0x0000000000c4a6b9
clang::ento::CoreEngine::HandlePostStmt(clang::CFGBlock const*, unsigned int,
clang::ento::ExplodedNode*) + 201
11 clang           0x0000000000c4a96c
clang::ento::CoreEngine::ExecuteWorkList(clang::LocationContext const*,
unsigned int, clang::ento::GRState const*) + 236
12 clang           0x0000000000b9669e
13 clang           0x0000000000b971e0
14 clang           0x0000000000b97554
15 clang           0x0000000000b97ec4
16 clang           0x00000000008c79fd clang::ParseAST(clang::Sema&, bool) + 413
17 clang           0x0000000000684fc3
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 371
18 clang           0x000000000065d9b4
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1268
19 clang           0x000000000065487b cc1_main(char const**, char const**, char
const*, void*) + 683
20 clang           0x000000000065c7c5 main + 6293
21 libc.so.6       0x00002b21fb5b5d8e __libc_start_main + 254
22 clang           0x0000000000652d59
Stack dump:
0.    Program arguments: /home/lenny/llvm-build/Release+Asserts/bin/clang -cc1
-triple x86_64-unknown-linux-gnu -analyze -disable-free -main-file-name
set-random-resource-value.c -analyzer-store=region
-analyzer-opt-analyze-nested-blocks -analyzer-eagerly-assume
-analyzer-checker=core -analyzer-checker=deadcode -analyzer-checker=security
-analyzer-checker=unix -analyzer-output plist -w -mrelocation-model static
-mdisable-fp-elim -masm-verbose -mconstructor-aliases -munwind-tables
-target-cpu x86-64 -target-linker-version 2.20.51 -momit-leaf-frame-pointer
-resource-dir /home/lenny/llvm-build/Release+Asserts/bin/../lib/clang/3.0 -D
HAVE_CONFIG_H -D BIONET_VERSION="2.6.1" -D LINUX -D _REENTRANT -I . -I ../.. -I
/usr/include/glib-2.0 -I /usr/lib/glib-2.0/include -I ../../libhab -I
/usr/include/avahi-compat-libdns_sd/ -I ../../util -ferror-limit 19
-fmessage-length 0 -fgnu-runtime -fdiagnostics-show-option -analyzer-checker
all-experimental -analyzer-output=html -o
/home/lenny/bionet2.bzr/trunk/llvm-trunk-csa-report/2011-04-27-1 -x c
set-random-resource-value.c 
1.    <eof> parser at end of file
2.    set-random-resource-value.c:143:3: Error evaluating statement
3.    set-random-resource-value.c:143:3: Error evaluating statement

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list