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

'unsupported line_ref tag: 0' warning when decoding line refs #1388

Open
mat-hek opened this issue Dec 6, 2024 · 3 comments
Open

'unsupported line_ref tag: 0' warning when decoding line refs #1388

mat-hek opened this issue Dec 6, 2024 · 3 comments

Comments

@mat-hek
Copy link

mat-hek commented Dec 6, 2024

Hey there,

sometimes I get the unsupported line_ref tag: 0 warning when loading a module and it seems it's correlated with missing entries in a stack trace when an error is raised in that module. I'm going to debug further, but it seems that the warning comes from here:

// TODO handle integer compact encodings > 2048
fprintf(stderr, "Unsupported line_ref tag: %u\n", tag);
and it seems a part of 'compact integers decoding' implementation is missing. Is there any place (in OTP?) where I can find some details / a reference implementation of it so that I can add it to AtomVM?

@pguyot
Copy link
Collaborator

pguyot commented Dec 6, 2024

Thank you for rising this, it is indeed annoying 😀

I'm not aware of any documentation and to handle similar cases in the past I ended up looking at BEAM source code, the VM or the compiler.

@mat-hek
Copy link
Author

mat-hek commented Dec 6, 2024

Gotcha, thanks for quick answer. Do you have any idea about what the 'compact integer' is? Searching for 'compact integer' in the OTP source didn't give anything :(

@pguyot
Copy link
Collaborator

pguyot commented Dec 6, 2024

Well, I'd search the code in BEAM that builds the line table.
https://github.com/erlang/otp/blob/50c08864b6decbe3561143986bda06663a9da0b7/lib/compiler/src/beam_asm.erl#L295

And more precisely in encode_line_items :
https://github.com/erlang/otp/blob/50c08864b6decbe3561143986bda06663a9da0b7/lib/compiler/src/beam_asm.erl#L324

Reading the code, I don't understand our decoding and I wonder if it's correct as we do the same thing for TAG_COMPACT_INT and TAG_COMPACT_ATOM but we don't do the same thing for TAG_EXTENDED_INT and TAG_EXTENDED_ATOM.

There seems to be four way to encode the value depending, and we only do two. See:
https://github.com/erlang/otp/blob/50c08864b6decbe3561143986bda06663a9da0b7/lib/compiler/src/beam_asm.erl#L579

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

2 participants