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

Memory leaks about smt.string_solver #7342

Open
Heaven2024 opened this issue Aug 14, 2024 · 0 comments
Open

Memory leaks about smt.string_solver #7342

Heaven2024 opened this issue Aug 14, 2024 · 0 comments
Labels

Comments

@Heaven2024
Copy link

Heaven2024 commented Aug 14, 2024

Hi!
Z3 [version 4.13.1 - 64 bit]
ubuntu:22.04

cat test.smt2
(set-option :smt.string_solver z3str3)
(set-logic QF_SLIA)
(declare-fun s1 () String)
(declare-fun s2 () String)

(assert (str.in.re s2 (re.inter (re.* (re.union (str.to.re "a") (str.to.re "b")))
                                (re.comp (re.* (str.to.re "aa"))))))

(check-sat)
(get-model)
z3 test.smt2
sat
(
  (define-fun s2 () String
    "b")
  (define-fun s1 () String
    "")
)

=================================================================
==2500827==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 160 byte(s) in 2 object(s) allocated from:
    #0 0x564bb1ed836e in malloc (/yuhao/z3/build/z3+0x28436e) (BuildId: 5c00c5286df32e49d27f99f213a657243f3d2f76)
    #1 0x564bb73fbc95 in memory::allocate(unsigned long) /yuhao/z3/build/../src/util/memory_manager.cpp:301:16

Indirect leak of 14464 byte(s) in 126 object(s) allocated from:
    #0 0x564bb1ed836e in malloc (/yuhao/z3/build/z3+0x28436e) (BuildId: 5c00c5286df32e49d27f99f213a657243f3d2f76)
    #1 0x564bb73fbc95 in memory::allocate(unsigned long) /yuhao/z3/build/../src/util/memory_manager.cpp:301:16

Indirect leak of 56 byte(s) in 2 object(s) allocated from:
    #0 0x564bb1ed8795 in __interceptor_realloc (/yuhao/z3/build/z3+0x284795) (BuildId: 5c00c5286df32e49d27f99f213a657243f3d2f76)
    #1 0x564bb73fbf5a in memory::reallocate(void*, unsigned long) /yuhao/z3/build/../src/util/memory_manager.cpp:334:15

SUMMARY: AddressSanitizer: 14680 byte(s) leaked in 130 allocation(s).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants