You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafodion.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/02/01 01:07:51 UTC
[jira] [Commented] (TRAFODION-2433) Logging function call trace
upon internal assert failures.
[ https://issues.apache.org/jira/browse/TRAFODION-2433?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15847841#comment-15847841 ]
ASF GitHub Bot commented on TRAFODION-2433:
-------------------------------------------
Github user selvaganesang commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/909#discussion_r98810157
--- 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.
http://www.geeksforgeeks.org/using-sizof-operator-with-array-paratmeters/
This may not be applicable here though because stackTrace_ is the member variable of the class and this is the method of the class.
> Logging function call trace upon internal assert failures.
> ----------------------------------------------------------
>
> Key: TRAFODION-2433
> URL: https://issues.apache.org/jira/browse/TRAFODION-2433
> Project: Apache Trafodion
> Issue Type: Improvement
> Components: sql-general
> Reporter: Prashanth Vasudev
> Assignee: Prashanth Vasudev
>
> Internal Asserts most of the time do not create core files nor return enough information to debug the issue.
> This is an attempt to capture the function call trace and log it as part of assertion failure.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)