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

Segmentation fault when a function uses a relation that was declared with different arity #17

Open
pt7k opened this issue Jan 10, 2025 · 4 comments
Labels
bug Something isn't working

Comments

@pt7k
Copy link
Contributor

pt7k commented Jan 10, 2025

  1. Summary

    • Description: Bug Summary in 2 to 3 sentences.
    • Each relation declared as an output of a function needs to be declared first, or else we get an (Error) Unknown type for: xxx yyy.
    • But it is possible to use a relation with one arity in some function's output while declaring (prior or subsequently) a relation of the same name with different arity.
    • The crash seems to be happening only if there is just one arity version of the relation being used as the output of another function with contradicting arity version (if the relation itself was declared twice with different arities then this error would be prioritised and handled gracefully with for example: (Error) Argument arity mismatch. yes_it_is() : bf/[0]3 declared as bf/[0]2 ).
  2. Environment

    • Tau Version: for now "v0.7-alpha" -158
    • Build Number or Date: eb3d8e5
    • Operating System: Ubuntu
  3. Steps to Reproduce
    Step 1: What input did you first provide?

is_one(1) := yes_it_is(1)
yes_it_is(0,0) := 0
n is_one(1)

Step 2: Any additional input to Tau?
Expected Result
Arity mismatch error message.
Actual Result
Segmentation fault without any warnings or error messages.

  1. Additional Information
    • Error Messages or Logs:
    • Segmentation fault (core dumped)
    • Screenshots:
    • When arity in both cases matches:

image

When there's mismatch between arity used as an output and type declaration:

image

  1. Severity and Impact

    • Severity Level: Minor
    • Impact on Work: Crash
  2. Workaround (if applicable)

    • Using the same arity of the corresponding relations in other functions definitions as in their original declarations.
  3. Contact Information

    • Name: pt7k
    • Email: Telegram @ksdjfskfh
    • Additional Notes: Any other message for the Tau Team

Submission Instructions

@pt7k pt7k added the bug Something isn't working label Jan 10, 2025
@LuccaT95
Copy link
Contributor

Dear pt7k,

thank you for this report. We are able to reproduce the bug and will investigate it soon!

Best,
Lucca

@pt7k
Copy link
Contributor Author

pt7k commented Jan 14, 2025

Dear Lucca,
I just wanted to add that one does not need to necessarily invoke another function to trigger this.
You could just as easily make a slip up while entering one too many/few arguments compared to what was originally declared and your REPL goes boom.
image

Thanks and Regards,
pt7k

@LuccaT95
Copy link
Contributor

Thanks for the update. We are in the process of fixing it.

@pt7k
Copy link
Contributor Author

pt7k commented Jan 15, 2025

Cool!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants