-
Notifications
You must be signed in to change notification settings - Fork 23
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
opencog::attentionbank(...) should not rely that objects compared by references are equal #6
Comments
There is no maintainer for the attentionbank code. Patches invited :-) |
Can I work on this issue. I would like to contribute for this framework. |
That would be excellent! Each atomspace gets it's own new, unique UUID (use the c++ |
So the _instance variable which is created after deleting needs to have it's own unique UUID right ? |
The AtomSpace API can be found in the header file |
We should use get_uuid() to _as variable before checking the condition right ? So that _as doesn't _as doesn't point to _asp. I am new to this code so I am a bit confused a little help would do. |
Yes, I guess so.. something like that. BTW, I plan to split out the attention/attentionbank code into it's own git repo in the next few days or weeks, so please be prepared for that change. |
I just updated the source code locally. I need to compile it and test it locally once before committing any changes. So how do I compile the source code. I have gone through multiple wiki pages but it's a bit confusing to find out. |
You need to use cmake to compile the opencog project. # install cogutil
git clone https://github.com/opencog/cogutil
mkdir -p cogutil/build
pushd
cd cogutil/build
cmake ..
make -j4
sudo make -j4 install
popd
# install atomspace
git clone https://github.com/opencog/atomspace
mkdir -p atomspace/build
pushd
cd atomspace/build
cmake ..
make -j4
sudo make -j4 install
popd
# build opencog
git clone https://github.com/opencog/opencog
cd opencog
# create branch with fix
git checkout -b fix-issue-3550
# build opencog
mkdir build
cd build
cmake ..
make -j4
# run all tests
make -j4 test
# run specific attention bank test
ARGS='-R BankImplUTest' make test |
Opencog project contains CircleCI config which can give a hint how to run the build process in docker: |
thanks @stellarspot for your resources I will go through them. |
I updated the source code to have unique UUID to the variable and tried the test multiple times. It passed every time I executed the BankImplUTest.cpp code. Should I try it a multiple times again. @linas @stellarspot Need your suggestions on this. |
You need to create a fork of opencog project, create there a branch, apply your fix, push it to the forked repository and create a pull request to the original opencog project. |
Can't we just compare the addresses of _as and asp using |
I don't understand the previous comment. Normally, code refers to the atomspace with a pointer, and not as a reference. Also, in C++, the static keyword does not prevent methods from being called. |
@linas I will try this once again and try fix this issue soon. |
opencog::attentionbank(AtomSpace* asp) method in AttentionBank has the following check to compare if two AtomSpaces are equal:
https://github.com/opencog/opencog/blob/802f0ec84e90db55389ee8ace40be6004a1ec9d1/opencog/attentionbank/bank/AttentionBank.cc#L249
This can fail if one AtomSpace is deleted and immediately after that the second one is created.
because the the new AtomSpace can be created with the same memory address as the previous one.
I encountered it in the Python test that can or can't fail depending with each address the new AtomSpace is created:
(note that the opencog/opencog#3549 pull request is required to run the test)
The text was updated successfully, but these errors were encountered: