-
Notifications
You must be signed in to change notification settings - Fork 795
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
testSubgraphPreconditioner bad_alloc exception under i386 #182
Comments
I tested on a i386 box with gcc 5.4.0 on DigitalOcean:
One test hangs: |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Now everything points to
|
(cont.d) whose reason is that This maps to that
Note that @jlblancoc @dellaert void KeyInfo::initialize(const GaussianFactorGraph &fg) {
const map<Key, size_t> colspec = fg.getKeyDimMap();
const size_t n = ordering_.size();
size_t start = 0;
cout << "SIZE: " << colspec.size() << endl;
for (const auto &[k, v] : colspec)
cout << "[" << k << ", " << (size_t)k << ", " << v << "], ";
cout << endl;
for (size_t i = 0; i < n; ++i) {
const size_t key = ordering_[i];
cout << "KEY:" << key << endl;
auto item = colspec.find(key);
cout << (item == colspec.end()) << endl;
const size_t dim = item->second;
this->emplace(key, KeyInfoEntry(i, dim, start));
start += dim;
}
numCols_ = start;
} |
I see. Well, indeed we want Key to always be 64 bit, so we should track
down we’re this goes wrong....
On Sun, Dec 22, 2019 at 23:58 Fan Jiang ***@***.***> wrote:
(cont.d) whose reason is that const map<Key, size_t> colspec =
fg.getKeyDimMap(); does not have the key.
This maps to that fg.getKeyDimMap() is misbehaving.
SIZE: 9
[8646911284551353321, 1001, 2], [8646911284551353322, 1002, 2], [8646911284551353323, 1003, 2], [8646911284551354321, 2001, 2], [8646911284551354322, 2002, 2], [8646911284551354323, 2003, 2], [8646911284551355321, 3001, 2], [8646911284551355322, 3002, 2], [8646911284551355323, 3003, 2],
KEY:1001
1
Note that 8646911284551353321 is 0x78*2^{63-8}-1001, and (size_t) k is
indeed 1001.
@jlblancoc <https://github.com/jlblancoc> @dellaert
<https://github.com/dellaert>
In short, the issue is with the wrong assumption that size_t is the same
with Key (uint_64 always).
void KeyInfo::initialize(const GaussianFactorGraph &fg) {
const map<Key, size_t> colspec = fg.getKeyDimMap();
const size_t n = ordering_.size();
size_t start = 0;
cout << "SIZE: " << colspec.size() << endl;
for (const auto &[k, v] : colspec)
cout << "[" << k << ", " << (size_t)k << ", " << v << "], ";
cout << endl;
for (size_t i = 0; i < n; ++i) {
const size_t key = ordering_[i];
cout << "KEY:" << key << endl;
auto item = colspec.find(key);
cout << (item == colspec.end()) << endl;
const size_t dim = item->second;
this->emplace(key, KeyInfoEntry(i, dim, start));
start += dim;
}
numCols_ = start;
}
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#182?email_source=notifications&email_token=ACQHGSPSQTG6F5TZDVYKNYDQ2BAPVA5CNFSM4JXKFZQKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHQGSRI#issuecomment-568355141>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACQHGSM7RMXISGG35ZFT2VDQ2BAPVANCNFSM4JXKFZQA>
.
--
Best !
Frank Dellaert
http://frank.dellaert.com
|
Great debugging! 👍 I think the line to blame is 118 in IterativeSolver.cpp
Will open a PR for you to test, @ProfFan . |
Another spin off of #168 .
Building for i386, the unit test testSubgraphPreconditioner fails.
Here's a gdb stack trace:
Will have to re-run with debug info to investigate what's wrong...
The text was updated successfully, but these errors were encountered: