The Wayback Machine - https://web.archive.org/web/20200906181940/https://github.com/mongodb/mongo/pull/1296/
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

ssl_manager.cpp: fix build with gcc 7 and -fpermissive #1296

Open
wants to merge 1 commit into
base: master
from

Conversation

@ffontaine
Copy link

ffontaine commented Feb 10, 2019

Change prototype of DERToken::parse function from
parse(ConstDataRange cdr, size_t* outLength);
to parse(ConstDataRange cdr, uint64_t* outLength);

Otherwise, we got the following error:

src/mongo/util/net/ssl_manager.cpp: In static member function 'static mongo::StatusWithmongo::{anonymous}::DERToken mongo::{anonymous}::DERToken::parse(mongo::ConstDataRange, size_t*)':
src/mongo/util/net/ssl_manager.cpp:575:79: error: invalid conversion from 'size_t* {aka unsigned int*}' to 'long unsigned int*' [-fpermissive]
if (mongoUnsignedAddOverflow64(tagAndLengthByteCount, derLength, outLength) ||

Signed-off-by: Fabrice Fontaine [email protected]

Change prototype of DERToken::parse function from
parse(ConstDataRange cdr, size_t* outLength);
to parse(ConstDataRange cdr, uint64_t* outLength);

Otherwise, we got the following error:

src/mongo/util/net/ssl_manager.cpp: In static member function 'static mongo::StatusWith<mongo::{anonymous}::DERToken> mongo::{anonymous}::DERToken::parse(mongo::ConstDataRange, size_t*)':
src/mongo/util/net/ssl_manager.cpp:575:79: error: invalid conversion from 'size_t* {aka unsigned int*}' to 'long unsigned int*' [-fpermissive]
  if (mongoUnsignedAddOverflow64(tagAndLengthByteCount, derLength, outLength) ||

Signed-off-by: Fabrice Fontaine <[email protected]>
@acmorrow
Copy link
Contributor

acmorrow commented Feb 10, 2019

@ffontaine - Thanks for the pull request. The master branch of MongoDB recently switched to requiring GCC 8, and we do not see this error in our builds that use OpenSSL. Could you try your build again with the most recent HEAD of master, and see if you still see this issue? If so, I'd like to understand what is different about your build environment and ours. Could you also provide information on your build OS, OpenSSL version, SCons command line, etc.

@acmorrow acmorrow self-requested a review Feb 10, 2019
@acmorrow acmorrow self-assigned this Feb 10, 2019
@ffontaine
Copy link
Author

ffontaine commented Feb 10, 2019

I'm building latest stable version (4.0.6) with buildroot on ARM cortex a9 and openssl in version 1.1.1a. On this target architecture (and any other 32-bits architectures), size_t is defined as unsigned int.
I could disable mongodb on all 32 bits architectures but it seems to build fine with this fix.

@acmorrow
Copy link
Contributor

acmorrow commented Feb 10, 2019

I get it now: this is 32-bit only. Thank you for clarifying that. We don't happen to do any 32-bit SSL enabled builds in our CI system, so we wouldn't have noticed. We can take a look at making this change.

I am a little curious about what storage engine(s) you are configuring in 32-bit mode though, as WiredTiger doesn't work there.

In order to help expedite getting this merged could you please:

Thanks!
Andrew

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.