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

Compilation failure for GSM_MAP protocol #43

Open
abodin opened this issue Feb 19, 2019 · 8 comments
Open

Compilation failure for GSM_MAP protocol #43

abodin opened this issue Feb 19, 2019 · 8 comments

Comments

@abodin
Copy link

abodin commented Feb 19, 2019

Hi Mouse,

Back to Issue 185 in the vlm's asn1c repository, with regard to the problem in compiling "Information Object Set", the problem seems solved and S1AP, RANAP, X2AP, M3AP, LPPa, PCAP, XwAP are successfully compiled. However, when compiling the GSM_MAP protocol, that issue still rises.

asn1c -fcompound-names -gen-PER GSMMAP.asn MAP-MS-DataTypes.asn MAP-SS-DataTypes.asn MAP-CommonDataTypes.asn MAP-ExtensionDataTypes.asn MAP-SS-Code.asn MAP-BS-Code.asn MAP-TS-Code.asn MAP-ER-DataTypes.asn MAP-OM-DataTypes.asn MAP-CH-DataTypes.asn MAP-DialogueInformation.asn MAP-SM-DataTypes.asn

Do you have any clue that how this can be resolved? Maybe with similar approach which addressed the problem for S1AP?

Thanks

@mouse07410
Copy link
Owner

One suggestion from @brchiu was to combine/concatenate the .asn input files into one, and feed that file to asn1c.

I don't think I have any other ideas. Please let me know if the above helped.

@mouse07410
Copy link
Owner

@abodin anything to report? If nothing - I'll close this issue, as it doesn't seem to be active.

Please feel free to re-open it if/when you have any update.

@abodin
Copy link
Author

abodin commented Mar 14, 2019

Hi Mouse,
The protocol is compiled with old versions of the compiler.
But, after the commit 4dcf836 (by vlm), the problem appears.

The error is raised in funnction asn1c_get_ioc_table_from_objset(), in file asnc_ioc.c.
In this function, it is verified whether objset->ioc_table is empty.
If yes, the error arises.
For removing (avoiding) this FATAL error, one can simply disable this verification.

The function after modification looks like:

static asn1c_ioc_table_and_objset_t
asn1c_get_ioc_table_from_objset(arg_t *arg, const asn1p_ref_t *objset_ref, asn1p_expr_t *objset) {
    asn1c_ioc_table_and_objset_t ioc_tao = { 0, 0, 1 };

    (void)objset_ref;

    ioc_tao.ioct = objset->ioc_table;
    ioc_tao.objset = objset;
    ioc_tao.fatal_error = 0;
    return ioc_tao;
} 

With this change, the (map) protocol is successfully compiled.

@mouse07410
Copy link
Owner

@abodin thank you for reporting the problem and a workaround.

Did you have a chance to try @brchiu's suggestion to concatenate all the *.asn files together and compile them as one with the new compiler?

Also, what's the semantics of objset->ioc_table being empty? @brchiu, @velichkov - what's your take? Should that be a fatal error, or should the processing continue?

@mouse07410 mouse07410 reopened this Mar 15, 2019
@abodin
Copy link
Author

abodin commented Mar 15, 2019

Dear Mouse, I try @brchiu's suggestion and concatenate the .asn input files. But it does not work for me. I don't know why objset->ioc_table was empty, but try to debug this issue and prepare an answer to your question.

@clairvoyant
Copy link

clairvoyant commented Nov 20, 2020

@mouse07410

I think the objset->ioc_table is empty because in the MAP there is one section that is empty in MAP-ExtensionDataTypes.

Lastest versions of the MAP have more problems. But following code snip are the relevant section for the issue raised by @abodin. The ExtensionSet at the end seems to be the issue.

MAP-EXTENSION  ::= CLASS {
    &ExtensionType      OPTIONAL,
    &extensionId    OBJECT IDENTIFIER }

MAP-EXTENSION  ::= CLASS {
    &ExtensionType      OPTIONAL,
    &extensionId    OBJECT IDENTIFIER }
    -- The length of the Object Identifier shall not exceed 16 octets and the
    -- number of components of the Object Identifier shall not exceed 16


PrivateExtension ::= SEQUENCE {
    extId   MAP-EXTENSION.&extensionId
        ({ExtensionSet}),
    extType MAP-EXTENSION.&ExtensionType
        ({ExtensionSet}{@extId})    OPTIONAL}

ExtensionSet    MAP-EXTENSION ::=
    {...
--  ExtensionSet is the set of all defined private extensions
    }                                                                                                                                                      
--  Unsupported private extensions shall be discarded if received.

@panteluke
Copy link

Is there any update on this?
I'm trying to compile GSM MAP protocol, but I get various errors depending on which ASN1 files I use, even when using source prior to commit 4dcf836
I suppose that I'm doing something terribly wrong. Could someone guide me through this?

@attina
Copy link

attina commented Dec 26, 2023

I meet same issue with MAP-ExtensionDataTypes.asn, looking forward to see a solution.

FATAL: Information Object Set ExtensionSet contains no objects at line 58
FATAL: Cannot compile "PrivateExtension" (20:1) at line 52
FATAL: Cannot compile "PrivateExtension" (20:1) at line 52

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

5 participants