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

Command got signal ILL. #120

Open
mimoo opened this issue Mar 13, 2023 · 2 comments
Open

Command got signal ILL. #120

mimoo opened this issue Mar 13, 2023 · 2 comments

Comments

@mimoo
Copy link
Contributor

mimoo commented Mar 13, 2023

Screenshot 2023-03-13 at 3 33 43 PM

getting this error due to this code:

    pub fn fp_state_add_legacy_constraint(
        mut state: ocaml::Pointer<CamlFpState>,
        constraint: ocaml::Pointer<BasicSnarkyConstraint<CamlFpVar>>,
    ) {
        let state = state.as_mut
        if let Some(cs) = &mut state.as_mut().0.system {

Looks like it does not like &mut state.as_mut().0.system. I'm not sure exactly why :D

@mimoo
Copy link
Contributor Author

mimoo commented Mar 13, 2023

breaking it up, the ILL seems to come from the last function call in here:

``rust
let state = &mut state.as_mut().0;
let constraint = constraint.as_ref();
if let Some(cs) = &mut state.system {
let constraint: BasicSnarkyConstraint<FieldVar> =
convert_basic_constraint(constraint);


where the function is defined as:

```rust
    pub fn convert_basic_constraint<F, CamlFVar>(
        constraint: &BasicSnarkyConstraint<CamlFVar>,
    ) -> BasicSnarkyConstraint<FieldVar<F>>
    where
        F: PrimeField,
        for<'a> FieldVar<F>: From<&'a CamlFVar>,
    {
        use BasicSnarkyConstraint::*;
        match constraint {
            Boolean(a) => Boolean(a.into()),
            Equal(a, b) => Equal(a.into(), b.into()),
            Square(a, b) => Square(a.into(), b.into()),
            R1CS(a, b, c) => R1CS(a.into(), b.into(), c.into()),
        }
    }

I'm guessing the for<'a> are not working well

@mimoo
Copy link
Contributor Author

mimoo commented Mar 13, 2023

trying to debug print the CamlFVar here gives me a different signal: "Command got signal SEGV." (and now a "Command got signal ABRT.", I'm collecting them all!)

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