trafodion-codereview mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From selvaganesang <>
Subject [GitHub] incubator-trafodion pull request #909: [TRAFODION-2433] Capture and log call...
Date Wed, 01 Feb 2017 01:07:48 GMT
Github user selvaganesang commented on a diff in the pull request:
    --- Diff: core/sql/arkcmp/CompException.cpp ---
    @@ -113,11 +114,21 @@ FatalException::FatalException(const char *msg,
       else {
         msg_[0] = 0;
    +  if(stackTrace) {
    +    strncpy(stackTrace_, stackTrace, sizeof(stackTrace_));
    +    stackTrace_[sizeof(stackTrace_)-1] = 0;
    --- End diff --
    @prashanth-vasudev What I meant is if the stackTrace_ is declared as char *, then sizeof(stackTrace_)
would return 4 or 8 bytes irrespective of the buffer size that was allocated to hold the stack
trace. If it is declared as char stackTrace_[<max_stack_trace_len>], then sizeof(stackTrace_)
will be correct. 
    This article illustrates the concern I mentioned via a program.
    This may not be applicable here though because stackTrace_ is the member variable of the
class and this is the method of the class.

If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at or file a JIRA ticket
with INFRA.

View raw message