Skip to content

Memory composition support #7

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

Merged
merged 5 commits into from
Mar 20, 2023
Merged

Memory composition support #7

merged 5 commits into from
Mar 20, 2023

Conversation

CaelmBleidd
Copy link
Member

@CaelmBleidd CaelmBleidd commented Mar 2, 2023

Added support for memory composition.

Minor changes:

  • Replaced redundant fields in UContext with values from KContext
  • Added a printer for UConcreteHeapRef
  • Added an upper bound type for the RegionId generic parameter in many places
  • Split the UMemoryRegions file into three: MemoryRegions, UMemoryUpdates, and UpdateNodes, containing corresponding classes and their inheritors.
  • Fixed a bug with isEmpty returning true for the Universe region
  • Fixed a bug with key deduplication while writing inside UFlatUpdates

Unsolved problems:

  • keyMapper is still an uncomposable object, that leads to a problem with recalculation of lower bounds in lambda closure inside the URangedUpdateNode

Open questions:

  • Can memcpy function contain a memory region? Can we have a heap without regions?
  • How to restrict external users from using writeArrayLength? Create an abstract class? Or an external interface? Or implement a default behaviour throwing an error

Added tests:

  • org.usvm.MapCompositionTest for map operations in different classes
  • org.usvm.MemoryRegionTests#testMultipleWriteTheSameUpdateNode for key deduplication
  • org.usvm.CompositionTest for composition as an operation

@CaelmBleidd CaelmBleidd force-pushed the caelmbleidd/map_regions branch from af17fd7 to a065454 Compare March 3, 2023 15:12
@CaelmBleidd CaelmBleidd changed the title [DRAFT] Composition support Composition support Mar 3, 2023
@CaelmBleidd CaelmBleidd changed the title Composition support Memory composition support Mar 3, 2023
@CaelmBleidd CaelmBleidd force-pushed the caelmbleidd/map_regions branch from a065454 to 11cf1a5 Compare March 3, 2023 16:49
@sergeypospelov
Copy link
Member

I am not sure about UHeap::memcpy, so @dvvrd take a look, please

    fun <RegionId : URegionId, Key, Sort : USort> memcpy(
        fromKey: Key,
        toKey: Key,
        fromRegion: UMemoryRegion<RegionId, Key, Sort>
    )

- RegionId made generic
- No instantiator constructors
- Composer is less than 70 lines now
- No unclear heap interfaces extensions
- Memcpy is entirely implemented
Copy link
Member

@sergeypospelov sergeypospelov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, add tests on composition of URangeUpdateNodes.

@CaelmBleidd CaelmBleidd force-pushed the caelmbleidd/map_regions branch from 5ed85f7 to 7ff8aa1 Compare March 16, 2023 13:46
@CaelmBleidd CaelmBleidd force-pushed the caelmbleidd/map_regions branch from 1f0af7f to be28b95 Compare March 16, 2023 16:44
@sergeypospelov sergeypospelov merged commit 56cc4d7 into main Mar 20, 2023
@CaelmBleidd CaelmBleidd deleted the caelmbleidd/map_regions branch March 22, 2023 07:36
petrukhinandrew added a commit to petrukhinandrew/usvm that referenced this pull request Apr 4, 2025
* update type argument rendering logic

* fix mockMvc1 field name, when mockMvc not present

* add JcSpringImportManager

* remove redundant cp argument from annotations

* JcDeadCodeTransformer rework

* update jacodb version

* fix lint

* remove redundant check

* remove redundant super calls
petrukhinandrew added a commit to petrukhinandrew/usvm that referenced this pull request May 5, 2025
* update type argument rendering logic

* fix mockMvc1 field name, when mockMvc not present

* add JcSpringImportManager

* remove redundant cp argument from annotations

* JcDeadCodeTransformer rework

* update jacodb version

* fix lint

* remove redundant check

* remove redundant super calls
Saloed pushed a commit that referenced this pull request Jun 2, 2025
* Add support for memory composition

* Review fixes

* Composition refactoring and array copying implementation
- RegionId made generic
- No instantiator constructors
- Composer is less than 70 lines now
- No unclear heap interfaces extensions
- Memcpy is entirely implemented

* Refactoring

* Review fixes

---------

Co-authored-by: Dmitry Mordvinov <[email protected]>
petrukhinandrew added a commit to petrukhinandrew/usvm that referenced this pull request Jun 19, 2025
* update type argument rendering logic

* fix mockMvc1 field name, when mockMvc not present

* add JcSpringImportManager

* remove redundant cp argument from annotations

* JcDeadCodeTransformer rework

* update jacodb version

* fix lint

* remove redundant check

* remove redundant super calls
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

Successfully merging this pull request may close these issues.

3 participants