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

Importing a file while being in the wrong working directory, which resulted in a stack overflow: #115

Closed
TeamSPoon opened this issue Sep 5, 2024 · 2 comments
Labels
bug Issues that represent errors in the code good first issue Good for newcomers Implemented-AwaitsTest
Milestone

Comments

@TeamSPoon
Copy link
Collaborator

TeamSPoon commented Sep 5, 2024

Robert Haas:

A second but possibly related observation: I accidentally tried to import a file while being in the wrong working directory, which resulted in a stack overflow:

root@ca898574a16c:~/metta-wam# mettalog --repl
metta+>!(import! &hald hald_spo.metta)
[

(error
(resource_error stack) stack_overflow{choicepoints:1314916,depth:4930906,environments:3287263,globalused:3

@TeamSPoon TeamSPoon modified the milestones: Month 1 of 5, Month 2 of 5 Sep 5, 2024
@TeamSPoon TeamSPoon added bug Issues that represent errors in the code good first issue Good for newcomers High Priority labels Sep 5, 2024
@TeamSPoon
Copy link
Collaborator Author

Expected outcome instead:

We should print an error to stderr that the file wasnt found and return [] no results as if nothing happened

@TeamSPoon
Copy link
Collaborator Author

TeamSPoon commented Sep 5, 2024

teh underlying bug (to @jazzbox35 or @AdrickTench) is that we accept non existent path as they might be a python or a class module that our virtual loader system is goign to finjd..
in this case hald_spo we first looked into the python module importer (it wasnt there, thenere we looked for a hald_spo/init.py and it wasnt there. then look for hald_spo.metta

In the case of a file extension like .metta we can assume is realy a file that should exist somewhere :) and can probe for it.. if its missing return a stderr message and fail which will return empty results

TeamSPoon added a commit that referenced this issue Sep 8, 2024
TeamSPoon added a commit that referenced this issue Sep 8, 2024
TeamSPoon added a commit that referenced this issue Sep 8, 2024
TeamSPoon added a commit that referenced this issue Sep 8, 2024
TeamSPoon added a commit that referenced this issue Dec 4, 2024
TeamSPoon added a commit that referenced this issue Dec 4, 2024
TeamSPoon added a commit that referenced this issue Dec 4, 2024
TeamSPoon added a commit that referenced this issue Dec 4, 2024
TeamSPoon added a commit that referenced this issue Dec 4, 2024
TeamSPoon added a commit that referenced this issue Dec 4, 2024
TeamSPoon added a commit that referenced this issue Dec 4, 2024
TeamSPoon added a commit that referenced this issue Dec 4, 2024
TeamSPoon added a commit that referenced this issue Dec 4, 2024
TeamSPoon added a commit that referenced this issue Dec 4, 2024
TeamSPoon added a commit that referenced this issue Dec 4, 2024
TeamSPoon added a commit that referenced this issue Dec 4, 2024
TeamSPoon added a commit to logicmoo/metta-testsuite that referenced this issue Dec 9, 2024
TeamSPoon added a commit to logicmoo/metta-testsuite that referenced this issue Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues that represent errors in the code good first issue Good for newcomers Implemented-AwaitsTest
Projects
None yet
Development

No branches or pull requests

1 participant