https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121550

            Bug ID: 121550
           Summary: Uninitialized memory with msync call in
                    symbol_table_extend
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: cobol
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sjames at gcc dot gnu.org
  Target Milestone: ---

With gcobol built from GCC trunk, I see (using the loop I mention at
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120244#c0):
```
+ gcobol cobol.dg/group2/ALLOCATE_Rule_8_OPTION_INITIALIZE_with_figconst.cob
-O2 -wrapper valgrind,-q
==1915401== Syscall param msync(start) points to uninitialised byte(s)
==1915401==    at 0x9B33A35: msync (msync.c:25)
==1915401==    by 0x6B10A5B: symbol_table_extend() [clone .lto_priv.0]
(symbols.cc:153)
==1915401==    by 0x6B5C98B: symbol_field_add(unsigned long, cbl_field_t*)
(symbols.cc:2565)
==1915401==    by 0x6A85B5D: field_add(YYLTYPE const&, cbl_field_t*)
(parse_ante.h:2738)
==1915401==    by 0x6A9AC9B: yyparse() (parse.y:3387)
==1915401==    by 0x6B63A8A: parse_file (util.cc:2412)
==1915401==    by 0x6B63A8A: cobol_parse_files(int, char const**)
(util.cc:2466)
==1915401==    by 0x67827B4: compile_file() [clone .lto_priv.0] (toplev.cc:453)
==1915401==    by 0x675D351: do_compile (toplev.cc:2226)
==1915401==    by 0x675D351: toplev::main(int, char**) (toplev.cc:2389)
==1915401==    by 0x675C0EC: main (main.cc:39)
==1915401==  Address 0x92bb89c is in a rw- mapped file /tmp/#89018 (deleted)
segment
==1915401==
+ set +x
```

```
$ valgrind --version
valgrind-3.26.0.GIT
```

```
$ ld.so --version
ld.so (Gentoo 2.42.9999 (patchset 1)) stable release version 2.42.
[...]
```

```
$ uname -a
Linux mop 6.15.9 #1 SMP PREEMPT_DYNAMIC Tue Aug  5 22:38:19 BST 2025 x86_64 AMD
Ryzen 9 3950X 16-Core Processor AuthenticAMD GNU/Linux
```

Reply via email to