Giter Club home page Giter Club logo

Comments (3)

tautschnig avatar tautschnig commented on August 24, 2024 1

@thomasspriggs Thank you for the analysis! Minor correction: the string s should not contain __CPROVER_bitvector to enter that branch. With the anonymous members we might end up with padding in the declaration, and that padding might be of said type. Assigning to myself as I am at fault for most of this code.

from cbmc.

mstachyraa avatar mstachyraa commented on August 24, 2024

Update:
Seems like the problem concerns any anonymous structs and unions.

struct struct1 {
    struct { // <- "struct tmp" would have worked
        char a;
        void *addr;
    };
};
int main () { struct struct1 b; }

from cbmc.

thomasspriggs avatar thomasspriggs commented on August 24, 2024

I have taken a quick look at this to ensure that it can be reproduced. As the INVARIANT violation is missing I have included it below, for reference of anyone undertaking further work to debug this issue -

--- begin invariant violation report ---
Invariant check failed
File: /home/tspriggs/Development/cbmc/src/goto-instrument/dump_c.cpp:623 function: convert_compound
Condition: false
Reason: Unreachable
Backtrace:

This condition is found here -

UNREACHABLE;

I am not entirely sure what the code block beginning on line 549 is attempting to achieve or what the fix should be. I think it is something like an initial attempt is made to serialise the type as string s. If the string contains CPROVER_bitvector then enter special case to print the the type based on the C integer type instead of the internal type. However the CPROVER_bitvector type is the type of a nested field and the special cases matching signed/unsigned bit vectors are mismatched as the type node in the AST in this case is a struct/union.

I am not planning to look at this further for the moment. But I thought my initial findings may be useful when someone continues the debugging effort.

from cbmc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.