hampi icon indicating copy to clipboard operation
hampi copied to clipboard

thread 'main' panicked

Open Its-Just-Nans opened this issue 10 months ago • 4 comments

hello,

I tried running hampi against this freshly exported x2ap specification:

https://github.com/tramex/types_lte_3gpp/blob/main/asn/36.423_spec_X2AP.asn

You can test by using this command this the repo

cargo run -- --codec uper --module code.re -- 36.423_spec_X2AP.asn

but I ended up having this error

thread 'main' panicked at asn-compiler/src/resolver/asn/values.rs:28:66:
called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Is that normal ?

Its-Just-Nans avatar Apr 26 '24 14:04 Its-Just-Nans

Also with https://github.com/tramex/types_lte_3gpp/blob/main/asn/36.413_spec_S1AP.asn

Error: Custom { kind: InvalidInput, error: "Compilation Error: Resolve: Referenced Type for 'CSGMembershipStatus' Not resolved yet!" }

Its-Just-Nans avatar Apr 26 '24 15:04 Its-Just-Nans

hello,

I tried running hampi against this freshly exported x2ap specification:

https://github.com/tramex/types_lte_3gpp/blob/main/asn/36.423_spec_X2AP.asn

You can test by using this command this the repo

cargo run -- --codec uper --module code.re -- 36.423_spec_X2AP.asn

but I ended up having this error

thread 'main' panicked at asn-compiler/src/resolver/asn/values.rs:28:66:
called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Is that normal ?

This is very likely a bug in the compiler - some unhandled construct. Will take a look at this.

gabhijit avatar Apr 26 '24 18:04 gabhijit

Also with https://github.com/tramex/types_lte_3gpp/blob/main/asn/36.413_spec_S1AP.asn

Error: Custom { kind: InvalidInput, error: "Compilation Error: Resolve: Referenced Type for 'CSGMembershipStatus' Not resolved yet!" }

This looks like symbol resolution issue most likely due to the dependency not being compiled. For any protocol, you will generally have to use ALL files that are dependent on each other for those to be compiled successfully. For S1AP we have been able to successfully compile this. Please take a look here for how it is done.

This is not related to the issue above most likely.

gabhijit avatar Apr 26 '24 18:04 gabhijit

hello, I tried running hampi against this freshly exported x2ap specification: https://github.com/tramex/types_lte_3gpp/blob/main/asn/36.423_spec_X2AP.asn You can test by using this command this the repo

cargo run -- --codec uper --module code.re -- 36.423_spec_X2AP.asn

but I ended up having this error

thread 'main' panicked at asn-compiler/src/resolver/asn/values.rs:28:66:
called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Is that normal ?

This is very likely a bug in the compiler - some unhandled construct. Will take a look at this.

I am trying to reproduce this, but I am not able to reproduce it. Following is my command line -

cargo run --bin hampi-rs-asn1c -- --codec uper --module code.re -- x2ap.asn

I keep getting one of the two errors. I believe this problem is due to both id-CSGMembershipStatus and CSGMembershipStatus not being there in the IMPORTS section of the ASN.1 Spec file.

That is the likely cause.

gabhijit avatar Apr 28 '24 04:04 gabhijit

Hi thanks for your answer

Looks like some defiinitions have been renamed but not all

I needed to manual patch some asn file : https://github.com/tramex/types_lte_3gpp/blob/ddee7577a293211aabb0e3f6b6eb078b550c2b3f/build.py#L40

I have now a compiled s1ap. Now working on x2ap

I've made #119 to have a clearer error

Will update the thread when I have a working x2ap

Its-Just-Nans avatar May 29 '24 08:05 Its-Just-Nans

Turns out the patch is the same for x2ap

I've made a second PR #120 to add some error handling :)

Its-Just-Nans avatar May 29 '24 08:05 Its-Just-Nans

Both #119 and #120 are merged. You may want to close this issue if you think nothing needs to be addressed.

gabhijit avatar May 29 '24 09:05 gabhijit

Thanks for the help and merges!

Closing this issue

Its-Just-Nans avatar May 29 '24 09:05 Its-Just-Nans