GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Remove dependency on apr by using c++11 / c++14 features by normanmaurer · Pull Request #759 · netty/netty-tcnative

Conversation

@normanmaurer

@normanmaurer normanmaurer commented Jan 11, 2023

Copy link
Copy Markdown
Member

Motivation:

We had some limited use of apr left in our tcnative fork which complicated the deployment. This apr usages can be replaced by using c++.

Modification:

Remove the dependency on apr by using c++11 / c++14 features

Result:

No apr dependeny

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@normanmaurer

normanmaurer commented Jan 11, 2023

Copy link
Copy Markdown
Member Author

Still some cleanup missing

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@normanmaurer
normanmaurer force-pushed the apr_removal branch from 66c16af to 73a3493 Compare January 11, 2023 13:06
@normanmaurer normanmaurer added this to the 2.0.57.Final milestone Jan 11, 2023
@normanmaurer
Remove dependency on apr by using c++11 / c++14 features
8740651
Motivation:

We had some limited use of apr left in our tcnative fork which complicated the deployment. This apr usages can be replaced by using c++.

Modification:

Remove the dependency on apr by using c++11 / c++14 features

Result:

No apr dependeny
@normanmaurer
normanmaurer force-pushed the apr_removal branch from 8aaff90 to 8740651 Compare January 11, 2023 14:12
@normanmaurer

normanmaurer commented Jan 11, 2023

Copy link
Copy Markdown
Member Author

This is ready to review now! :)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@normanmaurer
normanmaurer requested a review from chrisvest January 11, 2023 14:13
Scottmitch
Scottmitch reviewed Jan 11, 2023
View reviewed changes

@Scottmitch Scottmitch left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good work! took a quick peak at c API and c++ bridge code and lgtm ... will defer to someone else to take a deeper look.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread openssl-dynamic/src/main/c/tcn_lock.h Outdated

typedef void* tcn_lock_t;

tcn_lock_t tcn_lock_new();

@Scottmitch Scottmitch Jan 11, 2023

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: use malloc/free terminology or new/delete, since this is a c API maybe the former makes sense?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread openssl-dynamic/src/main/c/tcn_lock_rw.cpp
#include <mutex>

tcn_lock_rw_t tcn_lock_rw_new() {
// Once we switch to c++17 we should use std::shared_mutex

@Scottmitch Scottmitch Jan 11, 2023

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we not do this bcz of centos6 support and our current compiler version?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@normanmaurer normanmaurer Jan 11, 2023

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we can even use c++17... let me double check

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@normanmaurer normanmaurer Jan 12, 2023

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah seems like we not always have it... so lets just leave it as it is

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@chrisvest

chrisvest commented Jan 11, 2023

Copy link
Copy Markdown
Member

I don't think we need to add C++ to the mix. C11 has atomics and mutexes as well: https://en.cppreference.com/w/c/thread

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

chrisvest
chrisvest approved these changes Jan 11, 2023
View reviewed changes
@normanmaurer

normanmaurer commented Jan 12, 2023

Copy link
Copy Markdown
Member Author

@chrisvest I tried this after reading your comment but it turns out not a lot of glibc / compilers implement it (yet). See also https://www.reddit.com/r/C_Programming/comments/v0xxnj/is_c11_threadsh_worth_using/. So maybe lets just stick to c++11 etc

chrisvest reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@normanmaurer
rename functions for consistency
7ee7804
@normanmaurer

normanmaurer commented Jan 12, 2023

Copy link
Copy Markdown
Member Author

I am still investigating some linking stuff. Dont merge yet

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chrisvest

chrisvest commented Jan 12, 2023

Copy link
Copy Markdown
Member

Alright. Ping me when it's ready to be looked at again.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@normanmaurer
normanmaurer force-pushed the apr_removal branch from c93dd3a to d67ba3e Compare January 16, 2023 11:49
@normanmaurer
Link libstdc++ statically on linux
a288f03
@normanmaurer
normanmaurer force-pushed the apr_removal branch from d67ba3e to a288f03 Compare January 16, 2023 14:41
@normanmaurer
Fix format usage
eecaaa8
@normanmaurer

normanmaurer commented Jan 16, 2023

Copy link
Copy Markdown
Member Author

@chrisvest this is ready now... Convincing autoconf to do the right thing was quite challenging: a288f03 🤦

franz1981 reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@normanmaurer normanmaurer closed this Jan 16, 2023
@normanmaurer normanmaurer reopened this Jan 16, 2023
chrisvest
chrisvest approved these changes Jan 17, 2023
View reviewed changes
@chrisvest
chrisvest merged commit b2c45de into main Jan 17, 2023
@chrisvest
chrisvest deleted the apr_removal branch January 17, 2023 16:24
@slandelle slandelle mentioned this pull request May 4, 2023
Memory leak on SslProvider instantiation with netty-tcnative-boringssl-static #788
Closed
normanmaurer added a commit that referenced this pull request May 5, 2023
@normanmaurer
Fix memory leak when creating and destroying a lot of context
8273172
Motivation:

During introducing #759 I missed to add a free call which did introduce a small memory leak. This was not noticable for most users as creating and destroying of SSL context is usually very rare. That said some users might still do this and so notice the leak.

Modifications:

- Add missing free(...) call to match calloc(...)
- Move code of one function to the other as it was the only calling function. This simplifies the code and makes it less error-prone

Result:

Fixes #788
@normanmaurer normanmaurer mentioned this pull request May 5, 2023
Fix memory leak when creating and destroying a lot of context #790
Merged
normanmaurer added a commit that referenced this pull request May 5, 2023
@normanmaurer
Fix memory leak when creating and destroying a lot of context (#790)
fd8fb2a
Motivation:

During introducing #759 I missed to add a free call which did introduce a small memory leak. This was not noticable for most users as creating and destroying of SSL context is usually very rare. That said some users might still do this and so notice the leak.

Modifications:

- Add missing free(...) call to match calloc(...)
- Move code of one function to the other as it was the only calling function. This simplifies the code and makes it less error-prone

Result:

Fixes #788
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@Scottmitch Scottmitch Scottmitch left review comments
@chrisvest chrisvest chrisvest approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

2.0.57.Final

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@normanmaurer @chrisvest @Scottmitch
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.