[Bug analyzer/108400] [12/13/14/15 Regression] -Wanalyzer-null-dereference false positive on SoftEtherVPN's src/Cedar/WebUI.c

2024-06-20 Thread chipitsine at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108400

--- Comment #7 from Илья Шипицин  ---
Thank you for fixing this bug!

On Thu, Jun 20, 2024, 11:11 rguenth at gcc dot gnu.org <
gcc-bugzi...@gcc.gnu.org> wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108400
>
> Richard Biener  changed:
>
>What|Removed |Added
>
> 
>Target Milestone|12.4|12.5
>
> --- Comment #6 from Richard Biener  ---
> GCC 12.4 is being released, retargeting bugs to GCC 12.5.
>
> --
> You are receiving this mail because:
> You reported the bug.

[Bug tree-optimization/106297] [12/13/14/15 Regression] stringop-overflow misbehaviour on atomic since r12-4725-g88b504b7a8c5affb

2024-06-20 Thread chipitsine at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106297

--- Comment #10 from Илья Шипицин  ---
Thank you for fixing a bug!

On Thu, Jun 20, 2024, 11:08 rguenth at gcc dot gnu.org <
gcc-bugzi...@gcc.gnu.org> wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106297
>
> Richard Biener  changed:
>
>What|Removed |Added
>
> 
>Target Milestone|12.4|12.5
>
> --- Comment #9 from Richard Biener  ---
> GCC 12.4 is being released, retargeting bugs to GCC 12.5.
>
> --
> You are receiving this mail because:
> You are on the CC list for the bug.
> You reported the bug.

[Bug analyzer/108400] [12/13/14 Regression] -Wanalyzer-null-dereference false positive on SoftEtherVPN's src/Cedar/WebUI.c

2024-03-04 Thread chipitsine at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108400

--- Comment #5 from Илья Шипицин  ---
quick question, is it going to be fixed in 12.4 ?

[Bug analyzer/108400] [12/13/14 Regression] -Wanalyzer-null-dereference false positive on SoftEtherVPN's src/Cedar/WebUI.c

2024-03-04 Thread chipitsine at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108400

--- Comment #4 from Илья Шипицин  ---
will it be fixed in 12.4 ?

пн, 4 мар. 2024 г. в 13:59, rguenth at gcc dot gnu.org <
gcc-bugzi...@gcc.gnu.org>:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108400
>
> Richard Biener  changed:
>
>What|Removed |Added
>
> 
>Target Milestone|--- |12.4
>
> --
> You are receiving this mail because:
> You reported the bug.

[Bug analyzer/108400] New: false positive: null dereference

2023-01-13 Thread chipitsine at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108400

Bug ID: 108400
   Summary: false positive: null dereference
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: analyzer
  Assignee: dmalcolm at gcc dot gnu.org
  Reporter: chipitsine at gmail dot com
  Target Milestone: ---

bug is reproduced on the following gcc version:

commit f54e3b3ba01ced7ecda3caed51b42f707d489c77 (HEAD -> master, origin/trunk,
origin/master, origin/HEAD)
Author: Alexandre Oliva 
Date:   Thu Jan 12 00:29:33 2023 -0300


repro steps:

git clone --recursive https://github.com/SoftEtherVPN/SoftEtherVPN
cd SoftEtherVPN

export CC=/home/ilia/gcc/gcc-home/bin/gcc
export CFLAGS="-fanalyzer"

cmake .
make




I've reviewed the following finding, which I beleive is false positive

/home/ilia/SoftEtherVPN/src/Cedar/WebUI.c: In function ‘WuExpireSessionKey’:
/home/ilia/SoftEtherVPN/src/Cedar/WebUI.c:1871:29: warning: dereference of NULL
‘0’ [CWE-476] [-Wanalyzer-null-dereference]
 1871 | WU_CONTEXT *context = (WU_CONTEXT*)entry->Value;
  | ^~~
  ‘WuExpireSessionKey’: event 1
|
| 1868 | for(i=0; iContexts); i++)
|
  ‘WuExpireSessionKey’: event 2
|
| 1870 | STRMAP_ENTRY *entry =
(STRMAP_ENTRY*)LIST_DATA(wu->Contexts, i);
|
  ‘WuExpireSessionKey’: event 3
|
| 1870 | STRMAP_ENTRY *entry =
(STRMAP_ENTRY*)LIST_DATA(wu->Contexts, i);
|
  ‘WuExpireSessionKey’: event 4
|
|/home/ilia/SoftEtherVPN/src/./Mayaqua/Memory.h:116:54:
|  116 | #define LIST_DATA(o, i) (((o) != NULL) ? ((o)->p[(i)]) :
NULL)
|  |   ~~~^~~
|  |  |
|  |  (4) ...to
here
/home/ilia/SoftEtherVPN/src/Cedar/WebUI.c:1870:54: note: in expansion of macro
‘LIST_DATA’
| 1870 | STRMAP_ENTRY *entry =
(STRMAP_ENTRY*)LIST_DATA(wu->Contexts, i);
|  |  ^
|
  ‘WuExpireSessionKey’: event 5
|
| 1868 | for(i=0; iContexts); i++)
|
  ‘WuExpireSessionKey’: events 6-7
|
| 1870 | STRMAP_ENTRY *entry =
(STRMAP_ENTRY*)LIST_DATA(wu->Contexts, i);
| 1871 | WU_CONTEXT *context = (WU_CONTEXT*)entry->Value;
|  | ~~~
|  | |
|  | (7) dereference of NULL ‘’
|




WU_CONTEXT *context = (WU_CONTEXT*)entry->Value; - it is variable definition,
there's no dereference.

[Bug analyzer/108252] false positive: leak detection

2023-01-12 Thread chipitsine at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108252

--- Comment #7 from Илья Шипицин  ---
(In reply to David Malcolm from comment #6)
> (In reply to Илья Шипицин from comment #5)
> > thank you, David!
> > 
> > I'll rerun haproxy check soon
> 
> Note that I haven't yet fixed bug 108251, so I don't know how useful the
> results will be to you :/
> 
> FWIW I've added a build of haproxy-2.7.1 with -fanalyzer to my integration
> tests of -fanalyzer:
>   https://github.com/davidmalcolm/gcc-analyzer-integration-tests
> to try to track the output.
> 
> Prior to the above patch I got this from gcc trunk with haproxy-2.7.1:
> 
> warning: 185
>  - -Wanalyzer-null-dereference dereference of NULL ‘0’: 17
>  - -Wanalyzer-null-dereference dereference of NULL ‘conn’: 14
>  - -Wanalyzer-malloc-leak leak of ‘b’: 11
>  - -Wanalyzer-malloc-leak leak of ‘’: 10
>  - -Wanalyzer-malloc-leak leak of ‘strdup(args[1])’: 8
>  - -Wanalyzer-use-of-uninitialized-value use of uninitialized value
> ‘sl.rq.m.ptr’: 7
>  - -Wanalyzer-use-of-uninitialized-value use of uninitialized value
> ‘sl.rq.u.ptr’: 7
>  - -Wanalyzer-malloc-leak leak of ‘strdup(tmp)’: 5
>  - -Wanalyzer-fd-leak leak of file descriptor ‘*rx.fd’: 4
>  - -Wanalyzer-null-dereference dereference of NULL ‘fstrm’: 4
>  - -Wanalyzer-use-of-uninitialized-value use of uninitialized value
> ‘sl.rq.v.ptr’: 4
>  - -Wanalyzer-out-of-bounds heap-based buffer under-read: 3
>  - -Wanalyzer-malloc-leak leak of ‘u’: 3
>  - -Wanalyzer-use-of-uninitialized-value use of uninitialized value
> ‘sl.rq.u.len’: 3
>  - -Wanalyzer-null-dereference dereference of NULL ‘s’: 3
>  - -Wanalyzer-malloc-leak leak of ‘strdup(&buf)’: 2
>  - -Wanalyzer-null-dereference dereference of NULL ‘ret’: 2
>  - -Wanalyzer-malloc-leak leak of ‘chk.area’: 2
>  - -Wanalyzer-fd-leak leak of file descriptor ‘socket(1, 1, 0)’: 2
>  - -Wanalyzer-use-of-uninitialized-value use of uninitialized value
> ‘ring.buf.data’: 2
>  - -Wanalyzer-deref-before-check check of ‘meth’ for NULL after already
> dereferencing it: 2
>  - -Wanalyzer-deref-before-check check of ‘uri’ for NULL after already
> dereferencing it: 2
>  - -Wanalyzer-deref-before-check check of ‘vsn’ for NULL after already
> dereferencing it: 2
>  - -Wanalyzer-allocation-size allocated buffer size is not a multiple of the
> pointee's size: 2
>  - -Wanalyzer-deref-before-check check of ‘etag_buffer’ for NULL after
> already dereferencing it: 2
>  - -Wanalyzer-use-of-uninitialized-value use of uninitialized value
> ‘*(unsigned int *)memPtr’: 2
>  - -Wanalyzer-deref-before-check check of ‘result’ for NULL after already
> dereferencing it: 2
>  - -Wanalyzer-possible-null-dereference dereference of possibly-NULL ‘p’: 2
>  - -Wanalyzer-null-argument use of NULL ‘params’ where non-null expected: 2
>  - -Wanalyzer-null-dereference dereference of NULL ‘uri’: 2
>  - -Wanalyzer-deref-before-check check of ‘dash’ for NULL after already
> dereferencing it: 2
>  - -Wanalyzer-fd-leak leak of file descriptor: 1
>  - -Wanalyzer-malloc-leak leak of ‘calloc((long unsigned int)(hdr_num + 1),
> 32)’: 1
>  - -Wanalyzer-malloc-leak leak of ‘node’: 1
>  - -Wanalyzer-malloc-leak leak of ‘malloc((long unsigned int)(len + 1))’: 1
>  - -Wanalyzer-use-of-uninitialized-value use of uninitialized value ‘data’: 1
>  - -Wanalyzer-malloc-leak leak of ‘newkey’: 1
>  - -Wanalyzer-possible-null-dereference dereference of possibly-NULL ‘p1’: 1
>  - -Wanalyzer-malloc-leak leak of ‘conf_err’: 1
>  - -Wanalyzer-malloc-leak leak of ‘new_conf_err’: 1
>  - -Wanalyzer-malloc-leak leak of ‘strdup(*args_21(D) + _3)’: 1
>  - -Wanalyzer-use-of-uninitialized-value use of uninitialized value
> ‘*(struct lru64 *)_117 = PHI <_8(16), troot_4(13), ret_106(24)>.revision’: 1
>  - -Wanalyzer-use-of-uninitialized-value use of uninitialized value
> ‘*(struct lru64 *)_117 = PHI <_8(16), troot_4(13), ret_106(24)>.lru.n’: 1
>  - -Wanalyzer-use-of-uninitialized-value use of uninitialized value
> ‘*(struct lru64 *)_117 = PHI <_8(16), troot_4(13), ret_106(24)>.lru.p’: 1
>  - -Wanalyzer-malloc-leak leak of ‘*lru.spare’: 1
>  - -Wanalyzer-malloc-leak leak of ‘strdup(*args_18(D) + _4)’: 1
>  - -Wanalyzer-possible-null-dereference dereference of possibly-NULL ‘dst’: 1
>  - -Wanalyzer-use-after-free use after ‘free’ of ‘link’: 1
>  - -Wanalyzer-malloc-leak leak of ‘strdup(backing)’: 1
>  - -Wanalyzer-possible-null-dereference dereference of possibly-NULL ‘comp’:
> 1
>  - -Wanalyzer-malloc-leak leak of ‘fconf’: 1
>  - -Wanalyzer-malloc-leak leak of ‘strdup("/haproxy?stats")’: 1
>  - -Wanalyzer-malloc-leak leak of ‘strdup(".internal-stats-userlist")’: 1
>  - -Wanalyzer-malloc-leak leak of ‘calloc(1, 72)’: 1
>  - -Wanalyzer-malloc-leak leak of ‘strdup(*args_153(D) + _49)’: 1
>  - -Wanalyzer-deref-before-check check of ‘ext_child’ for NULL after already
> dereferencing it: 1
>  - -Wanalyzer-use-of-uninitialized-value use of uninitialized value
> ‘sl.rq.m.len’: 1
>  - -Wanalyzer-use-of-uninitialized-value use of uninitialized value
> ‘sl.rq.v.l

[Bug analyzer/108252] false positive: leak detection

2023-01-11 Thread chipitsine at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108252

--- Comment #5 from Илья Шипицин  ---
thank you, David!

I'll rerun haproxy check soon

[Bug analyzer/108252] New: false positive: leak detection

2022-12-29 Thread chipitsine at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108252

Bug ID: 108252
   Summary: false positive: leak detection
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: analyzer
  Assignee: dmalcolm at gcc dot gnu.org
  Reporter: chipitsine at gmail dot com
  Target Milestone: ---

repro steps

git clone https://github.com/haproxy/haproxy
cd haproxy

export CC=/home/ilia/gcc/gcc-home/bin/gcc
make TARGET=linux-glibc USE_OPENSSL=1 DEBUG_CFLAGS="-fanalyzer"

detection


```
src/cfgparse-ssl.c: In function ‘ssl_parse_global_ciphers’:
src/cfgparse-ssl.c:264:17: warning: leak of ‘strdup(args[1])’ [CWE-401]
[-Wanalyzer-malloc-leak]
  264 | *target = strdup(args[1]);
  | ^
  ‘ssl_parse_global_ciphers’: events 1-6
|
|  255 | if (too_many_args(1, args, err, NULL))
|  |^
|  ||
|  |(1) following ‘false’ branch...
|..
|  258 | if (*(args[1]) == 0) {
|  |~ ~
|  ||  |
|  ||  (2) ...to here
|  |(3) following ‘false’ branch...
|..
|  263 | free(*target);
|  | ~
|  | |
|  | (4) ...to here
|  264 | *target = strdup(args[1]);
|  | ~
|  | | |
|  | | (5) allocated here
|  | (6) ‘strdup(args[1])’ leaks here; was allocated at
(5)
|

```

is wrong

detailed review:
https://github.com/haproxy/haproxy/issues/1745#issuecomment-1367207339

[Bug analyzer/108251] New: false positive: null dereference

2022-12-29 Thread chipitsine at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108251

Bug ID: 108251
   Summary: false positive: null dereference
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: analyzer
  Assignee: dmalcolm at gcc dot gnu.org
  Reporter: chipitsine at gmail dot com
  Target Milestone: ---

repro steps:

git clone https://github.com/haproxy/haproxy
cd haproxy
export CC=/home/ilia/gcc/gcc-home/bin/gcc 
make TARGET=linux-glibc USE_OPENSSL=1 DEBUG_CFLAGS="-fanalyzer"

this finding is wrong

```
src/ssl_sample.c:502:34: warning: dereference of NULL '0' [CWE-476]
[-Wanalyzer-null-dereference]
  502 | smp->data.u.sint = ((conn->flags & CO_FL_EARLY_DATA)  &&
  |  ^~~
  'smp_fetch_ssl_fc_has_early': events 1-3
|
|  491 | if (!ssl)
|  |^
|  ||
|  |(1) following 'false' branch (when 'ssl' is
non-NULL)...
|..
|  494 | smp->flags = 0;
|  | ~~
|  ||
|  |(2) ...to here
|..
|  502 | smp->data.u.sint = ((conn->flags & CO_FL_EARLY_DATA)  &&
|  |  ~~~
|  |  |
|  |  (3) dereference of NULL
''
|
```

if conn is null, we'll return here (two lines above):

```
ssl = ssl_sock_get_ssl_object(conn);
if (!ssl)
return 0;
```

detailed review:
https://github.com/haproxy/haproxy/issues/1745#issuecomment-1367200781

[Bug tree-optimization/106297] stringop-overflow misbehaviour on atomic

2022-07-14 Thread chipitsine at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106297

--- Comment #2 from Илья Шипицин  ---
I have provided repro steps, hope they can be used to find any answer.

I tried to add "-save-temps", but it gave another error (not seen without that
option):

  CC  src/slz.o
In file included from src/slz.c:29:
include/import/slz-tables.h: In function ‘dist_to_code’:
include/import/slz-tables.h:182:35: error: this statement may fall through
[-Werror=implicit-fallthrough=]
  182 | case 24577 ... 32768: code++; /* fall through */
  |   ^~
compilation terminated due to -Wfatal-errors.
cc1: all warnings being treated as errors
make: *** [Makefile:1004: src/slz.o] Error 1

[Bug c/106297] New: stringop-overflow misbehaviour on atomic

2022-07-14 Thread chipitsine at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106297

Bug ID: 106297
   Summary: stringop-overflow misbehaviour on atomic
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: chipitsine at gmail dot com
  Target Milestone: ---

repro steps

git clone https://github.com/haproxy/haproxy
cd haproxy

export CC=/path/to/gcc
make CC=$CC ERR=1 TARGET=linux-glibc 

error reported:

src/haproxy.c: In function ‘run_poll_loop’:
include/haproxy/atomic.h:428:39: error: ‘__atomic_load_8’ writing 8 bytes into
a region of size 0 overflows the destination [-Werror=stringop-overflow=]
  428 | #define _HA_ATOMIC_LOAD(val)  __atomic_load_n(val,
__ATOMIC_RELAXED)
  |  
^~
src/haproxy.c:2843:46: note: in expansion of macro ‘_HA_ATOMIC_LOAD’
 2843 | if
((_HA_ATOMIC_LOAD(&ha_tgroup_ctx[i].stopping_threads) &
ha_tgroup_info[i].threads_enabled) !=
  |  ^~~
compilation terminated due to -Wfatal-errors.




error was reviewed by Willy Tarreau in
https://github.com/haproxy/haproxy/issues/1767 and it is considered as false
positive.

I bisected gcc, breaking change is:
https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=88b504b7a8c5affb0ffa97990d22af2b199e36ed

[Bug analyzer/106066] crash dump when "-fdump-analyzer" enabled

2022-06-23 Thread chipitsine at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106066

--- Comment #1 from Илья Шипицин  ---
another crash using "-fanalyzer-verbose-state-changes"

stacktrace


during IPA pass: analyzer
src/ssl_crtlist.c:523:17: internal compiler error: Segmentation fault
  523 | entry = crtlist_entry_new();
  | ^
0xf3ec3f crash_signal
/home/ilia/gcc/gcc-master/gcc/toplev.cc:322
0x950028 c_tree_printer
/home/ilia/gcc/gcc-master/gcc/c/c-objc-common.cc:305
0x1eea9ef pp_format(pretty_printer*, text_info*)
/home/ilia/gcc/gcc-master/gcc/pretty-print.cc:1475
0x1e65b58 make_label_text(bool, char const*, ...)
/home/ilia/gcc/gcc-master/gcc/analyzer/analyzer.cc:439
0x1e6afc0 ana::state_change_event::get_desc(bool) const
/home/ilia/gcc/gcc-master/gcc/analyzer/checker-path.cc:409
0x1e68232 ana::checker_event::prepare_for_emission(ana::checker_path*,
ana::pending_diagnostic*, diagnostic_event_id_t)
/home/ilia/gcc/gcc-master/gcc/analyzer/checker-path.cc:237
0x1e8622f ana::checker_path::prepare_for_emission(ana::pending_diagnostic*)
/home/ilia/gcc/gcc-master/gcc/analyzer/checker-path.h:652
0x1e8622f ana::diagnostic_manager::emit_saved_diagnostic(ana::exploded_graph
const&, ana::saved_diagnostic const&)
/home/ilia/gcc/gcc-master/gcc/analyzer/diagnostic-manager.cc:1396
0x1e8a0d3 ana::dedupe_winners::emit_best(ana::diagnostic_manager*,
ana::exploded_graph const&)
/home/ilia/gcc/gcc-master/gcc/analyzer/diagnostic-manager.cc:1296
0x1e8677c ana::diagnostic_manager::emit_saved_diagnostics(ana::exploded_graph
const&)
/home/ilia/gcc/gcc-master/gcc/analyzer/diagnostic-manager.cc:1348
0x12e148a ana::impl_run_checkers(ana::logger*)
/home/ilia/gcc/gcc-master/gcc/analyzer/engine.cc:5846
0x12e230e ana::run_checkers()
/home/ilia/gcc/gcc-master/gcc/analyzer/engine.cc:5906
0x12d1c48 execute
/home/ilia/gcc/gcc-master/gcc/analyzer/analyzer-pass.cc:87
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug analyzer/106066] New: crash dump when "-fdump-analyzer" enabled

2022-06-23 Thread chipitsine at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106066

Bug ID: 106066
   Summary: crash dump when "-fdump-analyzer" enabled
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: analyzer
  Assignee: dmalcolm at gcc dot gnu.org
  Reporter: chipitsine at gmail dot com
  Target Milestone: ---

reproduce steps (using latest gcc13 from git):


git clone https://github.com/haproxy/haproxy
cd haproxy

export CC=/path/to/latest/gcc13
export ADDITIONAL_CFLAGS="-fanalyzer -fdump-analyzer"


QUICTLS=yes scripts/build-ssl.sh
make -j3 CC=$CC V=1 ERR=1 TARGET=linux-glibc USE_OPENSSL=1 USE_QUIC=1
USE_ZLIB=1 USE_PCRE=1 USE_PCRE_JIT=1 USE_LUA=1 USE_SYSTEMD=1
ADDLIB="-Wl,-rpath,${HOME}/opt/lib" SSL_LIB=${HOME}/opt/lib
SSL_INC=${HOME}/opt/include DEBUG_CFLAGS="-g ${ADDITIONAL_CFLAGS}"




stacktrace:

during IPA pass: analyzer
src/ev_epoll.c: In function ‘_do_poll’:
src/ev_epoll.c:239:55: internal compiler error: Segmentation fault
  239 | ((e & EPOLLERR)   ? FD_EV_ERR_RW  : 0);
  | ~~^~~~
0xf3ec3f crash_signal
/home/ilia/gcc/gcc-master/gcc/toplev.cc:322
0x101a64c tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
/home/ilia/gcc/gcc-master/gcc/tree.h:3638
0x101a64c dump_mem_ref
/home/ilia/gcc/gcc-master/gcc/tree-pretty-print.cc:1700
0x100ff3f dump_generic_node(pretty_printer*, tree_node*, int, dump_flag, bool)
/home/ilia/gcc/gcc-master/gcc/tree-pretty-print.cc:2061
0x1011554 dump_generic_node(pretty_printer*, tree_node*, int, dump_flag, bool)
/home/ilia/gcc/gcc-master/gcc/tree-pretty-print.cc:2425
0x1014d46 dump_generic_node(pretty_printer*, tree_node*, int, dump_flag, bool)
/home/ilia/gcc/gcc-master/gcc/tree-pretty-print.cc:2910
0x12faef9 ana::dump_tree(pretty_printer*, tree_node*)
/home/ilia/gcc/gcc-master/gcc/analyzer/region-model.cc:87
0x12faef9 ana::dump_quoted_tree(pretty_printer*, tree_node*)
/home/ilia/gcc/gcc-master/gcc/analyzer/region-model.cc:97
0x12ed6f9 ana::sm_state_map::print(ana::region_model const*, bool, bool,
pretty_printer*) const
/home/ilia/gcc/gcc-master/gcc/analyzer/program-state.cc:242
0x12ef45e ana::program_state::dump_to_pp(ana::extrinsic_state const&, bool,
bool, pretty_printer*) const
/home/ilia/gcc/gcc-master/gcc/analyzer/program-state.cc:901
0x12f0283 ana::program_state::detect_leaks(ana::program_state const&,
ana::program_state const&, ana::svalue const*, ana::extrinsic_state const&,
ana::region_model_context*)
/home/ilia/gcc/gcc-master/gcc/analyzer/program-state.cc:1366
0x12f0986 ana::program_state::prune_for_point(ana::exploded_graph&,
ana::program_point const&, ana::exploded_node*, ana::uncertainty_t*) const
/home/ilia/gcc/gcc-master/gcc/analyzer/program-state.cc:1214
0x12de456 ana::exploded_graph::process_node(ana::exploded_node*)
/home/ilia/gcc/gcc-master/gcc/analyzer/engine.cc:3822
0x12df0fa ana::exploded_graph::process_worklist()
/home/ilia/gcc/gcc-master/gcc/analyzer/engine.cc:3240
0x12e1467 ana::impl_run_checkers(ana::logger*)
/home/ilia/gcc/gcc-master/gcc/analyzer/engine.cc:5832
0x12e2295 ana::run_checkers()
/home/ilia/gcc/gcc-master/gcc/analyzer/engine.cc:5906
0x12d1c48 execute
/home/ilia/gcc/gcc-master/gcc/analyzer/analyzer-pass.cc:87
Please submit a full bug report, with preprocessed source.
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug gcov-profile/102746] gcov returns 0 un erroneuos incovation

2021-10-18 Thread chipitsine at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102746

--- Comment #9 from Илья Шипицин  ---
ok, so we'll migrate to gcc-12 :)

[Bug gcov-profile/102746] gcov returns 0 un erroneuos incovation

2021-10-18 Thread chipitsine at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102746

--- Comment #7 from Илья Шипицин  ---
wow. thanks for that.

btw, will it be "gcc-12 only" or it is going to be backported (I'm interested
in gcc-8) ?

[Bug gcov-profile/102746] gcov returns 0 un erroneuos incovation

2021-10-14 Thread chipitsine at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102746

--- Comment #3 from Илья Шипицин  ---
> The question is if we should return 1 if we can't open .gcda (or .gcno) file 
> for one input file, or for all of them?

any input file.

[Bug gcov-profile/102746] gcov returns 0 un erroneuos incovation

2021-10-14 Thread chipitsine at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102746

--- Comment #2 from Илья Шипицин  ---
I came to this situation using wrong powershell approach. I found all "gcda"
and merged them into single string. Powershell executed "gcov" and passed 1
(!!) argument as concatenated string.

Actually, if gcov cannot find some required file, it should return "1" (or
other non zero).

[Bug gcov-profile/102747] New: gcov returns 0 when invoked on gcda generated by previous gcc version

2021-10-14 Thread chipitsine at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102747

Bug ID: 102747
   Summary: gcov returns 0 when invoked on gcda generated by
previous gcc version
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: gcov-profile
  Assignee: unassigned at gcc dot gnu.org
  Reporter: chipitsine at gmail dot com
CC: marxin at gcc dot gnu.org
  Target Milestone: ---

we use several gcc versions, so we do not know whether particular "gcda" was
produced by gcc-N or gcc-M.

for example, mixing gcc11 and gcc12 together:

running gcov-12 on gcda produced by gcc-11

gcov a-hello.gcda
a-hello.gcno:version 'B12R', prefer 'B20 '
a-hello.gcno:no functions found
a-hello.gcda:version 'B12R', prefer version 'B20 '
No executable lines
$ echo $?
0
$ 



I'm fine with error itself, it is expected. However I beleive exit status
should be "1"

[Bug gcov-profile/102746] New: gcov returns 0 un erroneuos incovation

2021-10-14 Thread chipitsine at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102746

Bug ID: 102746
   Summary: gcov returns 0 un erroneuos incovation
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: gcov-profile
  Assignee: unassigned at gcc dot gnu.org
  Reporter: chipitsine at gmail dot com
CC: marxin at gcc dot gnu.org
  Target Milestone: ---

repro steps:

several source files (for example, two)

main.c:

void hello(void);

void main(void){
 hello();
}

hello.c:

#include 

void hello(void) {
   printf("hello"); 
}


..

build with coverage (using master branch gcc)

gcc --coverage -o hello main.c hello.c



execute

./hello



executing "gcov" in erroneous way 

gcov "hello-hello.gcda  hello-main.gcda"
hello-hello.gcda  hello-main.gcno:cannot open notes file
hello-hello.gcda  hello-main.gcda:cannot open data file, assuming not executed
No executable lines

however, exit status is "0"

$ echo $?
0
$



it is hard to identify error situation when exit status is "0". I beleive it
should be "1" under such circumstances