Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warnings about freeing a non-allocated object #366

Open
2 of 3 tasks
Lastique opened this issue Mar 24, 2024 · 0 comments
Open
2 of 3 tasks

Warnings about freeing a non-allocated object #366

Lastique opened this issue Mar 24, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Lastique
Copy link
Contributor

Make sure you completed the following tasks

Environment and version details

  • Operating System+version: Kubuntu 22.04
  • Compiler+version: gcc 11.4
  • Shell: bash
  • B2 Version: B2 5.1.0 (OS=LINUX, jobs=8)

Brief problem description

I'm not sure if this is a genuine problem, but when building b2 with debug information gcc emits a warning that free is being called on a non-allocated object.

Steps to reproduce the issue

$ ./build.sh --debug

###
###
### Using 'gcc' toolset.
###
###

g++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


###
###

> g++ -x c++ -std=c++11 -pthread -O0 -g bindjam.cpp builtins.cpp class.cpp command.cpp compile.cpp constants.cpp cwd.cpp debug.cpp debugger.cpp execcmd.cpp execnt.cpp execunix.cpp filent.cpp filesys.cpp fileunix.cpp frames.cpp function.cpp glob.cpp hash.cpp hcache.cpp hdrmacro.cpp headers.cpp jam_strings.cpp jam.cpp jamgram.cpp lists.cpp make.cpp make1.cpp md5.cpp mem.cpp modules.cpp native.cpp option.cpp output.cpp parse.cpp pathnt.cpp pathsys.cpp pathunix.cpp regexp.cpp rules.cpp scan.cpp search.cpp startup.cpp tasks.cpp timestamp.cpp value.cpp variable.cpp w32_getreg.cpp mod_jam_builtin.cpp mod_jam_class.cpp mod_jam_errors.cpp mod_jam_modules.cpp mod_order.cpp mod_path.cpp mod_property_set.cpp mod_regex.cpp mod_sequence.cpp mod_set.cpp mod_string.cpp mod_summary.cpp mod_sysinfo.cpp mod_version.cpp -o b2
src/engine/jamgram.cpp: In function ‘int yyparse()’:
src/engine/jamgram.cpp:2282:18: warning: ‘void free(void*)’ called on unallocated object ‘yyssa’ [-Wfree-nonheap-object]
src/engine/jamgram.cpp:1152:16: note: declared here

Expected behavior summary

This warning is alarming. If this is a false positive then please silence it to avoid confusion. Otherwise, if this is a genuine bug, then please fix it.

@Lastique Lastique added the bug Something isn't working label Mar 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant