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

Issue with preloading library that uses easylogging++ #87

Closed
easylogging opened this issue Aug 17, 2013 · 2 comments
Closed

Issue with preloading library that uses easylogging++ #87

easylogging opened this issue Aug 17, 2013 · 2 comments
Labels
Milestone

Comments

@easylogging
Copy link
Contributor

To reproduce this issue do

$ LD_PRELOAD=mylib/libmylib.so ./myapp

from samples/Qt/shared-lib/myapp-build

@easylogging
Copy link
Contributor Author

Problem seem to be in getEnvironmentVariable() function, if we comment it out for test purposes, it works fine

    static std::string getEnvironmentVariable(const char* variableName, const char* defaultVal, const char* alternativeBashCommand = nullptr) {
/*#if _ELPP_OS_UNIX
        const char* val = getenv(variableName);
#elif _ELPP_OS_WINDOWS
        const char* val = getWindowsEnvironmentVariable(variableName);
#endif // _ELPP_OS_UNIX
        if ((val == nullptr) || ((strcmp(val, "") == 0))) {
#if _ELPP_OS_UNIX
            /// Try harder on unix-based systems
            std::string valBash = base::utils::OS::getBashOutput(alternativeBashCommand);
            if (valBash.empty()) {
                return std::string(defaultVal);
            } else {
                return valBash;
            }
#elif _ELPP_OS_WINDOWS
            _ELPP_UNUSED(alternativeBashCommand);
            return std::string(defaultVal);
#endif // _ELPP_OS_WINDOWS
        }
        return std::string(val);*/
        return std::string();
    }

Looking further...

@easylogging
Copy link
Contributor Author

Looked even further so issue is in getBashOut() since it tries to open process so i believe it runs into stack overflow (keep trying to open process)

@abumq abumq closed this as completed in bc12570 Aug 17, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant