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

valgrind warnnings #39

Open
lynch1981 opened this issue Mar 10, 2024 · 0 comments
Open

valgrind warnnings #39

lynch1981 opened this issue Mar 10, 2024 · 0 comments

Comments

@lynch1981
Copy link

lynch1981 commented Mar 10, 2024

When I use the application tracked by valgrind, got lots of valgrind warnnings like this

my code like this

static jp::Regex e(R"(\b0x[0-9a-f]{3,}\b)", "S");
asm_txt = e.replace(asm_txt, "HEX", "g");

When I change it to the following method, the warning can be eliminated, but when I use this code in a loop, the regular expression will be JIT compiled repeatedly.

static jp::Regex e(R"(\b0x[0-9a-f]{3,}\b)");
asm_code = e.addModifier("S").replace(asm_code, "HEX", "g");

bash valgrind --track-origins=yes --leak-check=full -q my_program

==71672== Conditional jump or move depends on uninitialised value(s)
==71672== at 0x5244B3F: ???
==71672== by 0x5B7FD37: ???
==71672== Uninitialised value was created by a heap allocation
==71672== at 0x4845FF5: operator new(unsigned long) (vg_replace_malloc.c:422)
==71672== by 0x4A46B89: std::__cxx11::basic_string<char, std::char_traits, std::allocator >::_M_assign(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&) (basic_string.tcc:284)
==71672== by 0x40B4D1: assign (basic_string.h:1571)
==71672== by 0x40B4D1: operator= (basic_string.h:805)
==71672== by 0x40B4D1: setSubject (jpcre2.hpp:3245)
==71672== by 0x40B4D1: replace (jpcre2.hpp:4312)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant