-
Notifications
You must be signed in to change notification settings - Fork 137
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
t/vector fails on 32bit platforms at ASSERT_FALSE(vec.resize(INT64_MAX)) #279
Comments
There are Lines 188 to 205 in a6bd168
Shouldn't it cause an exception on 32bit system?
The assertion has a long history 255137a. |
This is not specific to 1.1.19, right? This applies to 1.1.18, 1.1.17, etc., too? |
yes |
If this is the only thing that fails, then that is easily fixed, right? Is there any reason not to support 32-bit architectures? |
Quoting Ed Sabol (2020-02-22 17:07:05)
The only failing assertion is ASSERT_FALSE(vec.resize(INT64_MAX)).
If this is the only thing that fails, then that is easily fixed, right?
Is there any reason not to support 32-bit architectures?
There will be relevant 32-bit arches for many years to come.
This is an easy fix with a conditional define. I don't have time, but
yes, somebody should fix this.
… —
You are receiving this because you are subscribed to this thread.
Reply to this email directly, [1]view it on GitHub, or [2]unsubscribe.
References
1. #279?email_source=notifications&email_token=AADS6YDIOOY4PNGWLDCB2E3REHD3TA5CNFSM4KXUL7K2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEMVOUDI#issuecomment-590014989
2. https://github.com/notifications/unsubscribe-auth/AADS6YC7QB6HGXM65WS2TOTREHD3TANCNFSM4KXUL7KQ
|
So I think this works on both 32-bit and 64-bit systems: // SIZE_MAX is ((size_t)(-1)), but we need to subtract 1 because the
// gearman_vector_st implementation adds 1 to the capacity.
ASSERT_FALSE(vec.resize(((size_t)(-1)) -1)); Anyone see a problem with that? Otherwise, things get complicated: #if defined(__LP64__) || defined(_WIN64) || (defined(__x86_64__) && !defined(__ILP32__)) || defined(_M_X64) || defined(__ia64) || defined (_M_IA64) || defined(__aarch64__) || defined(__powerpc64__)
ASSERT_FALSE(vec.resize(INT64_MAX));
#else
// SIZE_MAX is ((size_t)(-1)), but we need to subtract 1 because the
// gearman_vector_st implementation adds 1 to the capacity.
ASSERT_FALSE(vec.resize(((size_t)(-1)) -1));
#endif References: Should we bother to rename |
LGTM. My worry is, that we haven't 32 CI environment for testing.
Wouldn't it be appropriate to cut off |
In C++ style, it would be better to use
What's the real intention of using |
In reply to @p-alik's comment:
Yeah. I've tested it with a Docker i386/centos7 image similar to what @cheese posted above, fwiw. I think it is possible to add Docker builds to Travis CI, but I don't know how. I think it's not worth the effort.
Sure, that would be appropriate. In reply to @cheese's comment:
Interesting. I'll test that (maybe later today) and report back.
I'm not sure any of us can answer that question since I'm guessing these tests were written before any of us got involved with gearmand. I think the intent is to just test
Is that a significant distinction? |
If your guess of the test intent is right, the argument should be |
So this issue has languished. Rereading the thread here, I'm still not clear what the solution is. I think I'm still inclined to go with @cheese's suggestion of |
I'm of the same opinion because it is most appropriate for the purpose of test. gearmand/libgearman/vector.hpp Line 89 in 36c1e23
|
Issue #279: Fix t/vector test on 32-bit systems
Merged commit addresses this issue, so I’m going to close this. |
Are 32bit platforms still supported?
Tested 1.1.19.1 on 32bit CentOS7 altarch, and t/vector failed during
make test
.The same on 32bit ARM.
The only failing assertion is
ASSERT_FALSE(vec.resize(INT64_MAX))
.This Dockerfile can reproduce the issue:
The text was updated successfully, but these errors were encountered: