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

Avoid re-opening the log file for every debug message on Windows (fixes #824, superseedes #910) #913

Closed
wants to merge 4 commits into from

Conversation

frankmorgner
Copy link
Member

#910 fixes #824 by extending the logic for reopening the debug file for every log message. This approach, however, is very problematic in regard to performance.

Instead of building on sandy ground, this PR tries to solve #824 by reopening the debug file once, when needed. This improves overall performance for logging on Windows, simplifies the user configuration options and, of course, fixes the segmentation fault in question.

This PR is compile tested only and needs to be verified on Windows with a IASECC card.

remove the user configuration option reopen_debug_file and instead
handle the underlying problem internally. File handles may not be shared
among DLLs, so we reopen the debug file descriptor once when loading a
module that OpenSC's internal debugging.

Fixes OpenSC#824
Closes OpenSC#910
@viktorTarasov
Copy link
Member

@frankmorgner

  • "problematic in regard to performance"
    Do you mean the performance of smart card application in debug mode ?
    I do not think that it's a valid argument.

  • "This PR is compile tested only and needs to be verified on Windows with a IASECC card"
    I will not even try to test it.
    It will segfault in the main module at the first log message after the loaded SM DLL used.

  • This PR contains the commits that are weakly linked one with other.

Question for @frankmorgner:
How can you put in the same message both these statements:

... of course, fixes the segmentation fault in question...
... This PR is compile tested only and needs to be verified ...

@frankmorgner
Copy link
Member Author

This PR was meant to show a different kind of direction to illustrate my comments on #910. Since I don't have any way of testing, I'm closing this PR.

@frankmorgner frankmorgner deleted the reopen branch February 13, 2017 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crash attempting to query AIS card
2 participants