You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficserver.apache.org by "Yakov Markovitch (JIRA)" <ji...@apache.org> on 2010/08/20 16:20:16 UTC

[jira] Created: (TS-419) Segmentation fault in INKError when error output is made both in error log and as debug messages

Segmentation fault in INKError when error output is made both in error log and as debug messages  
--------------------------------------------------------------------------------------------------

                 Key: TS-419
                 URL: https://issues.apache.org/jira/browse/TS-419
             Project: Traffic Server
          Issue Type: Bug
          Components: InkAPI
    Affects Versions: 2.0.0, 2.1.0, 2.1.1, 2.0.1
            Reporter: Yakov Markovitch


When TS is configures so that to print INKError messages both to the error log and as debug messages (e.g. by starting TS with -B 'deft'), calling INKError with variable arguments (like INKError("The answer to the %s is %d", "Ultimate Question of Life, the Universe, and Everything", 42)) causes segfault.

The cause of this bug is that INKError uses once initialised va_args pointer two times.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (TS-419) Segmentation fault in INKError when error output is made both in error log and as debug messages

Posted by "Yakov Markovitch (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TS-419?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Yakov Markovitch updated TS-419:
--------------------------------

    Attachment: INKError.patch

Here the patch that fixes the bug. Works both again 2.0.0 and the trunk.

> Segmentation fault in INKError when error output is made both in error log and as debug messages  
> --------------------------------------------------------------------------------------------------
>
>                 Key: TS-419
>                 URL: https://issues.apache.org/jira/browse/TS-419
>             Project: Traffic Server
>          Issue Type: Bug
>          Components: InkAPI
>    Affects Versions: 2.1.1, 2.1.0, 2.0.1, 2.0.0
>            Reporter: Yakov Markovitch
>         Attachments: INKError.patch
>
>
> When TS is configures so that to print INKError messages both to the error log and as debug messages (e.g. by starting TS with -B 'deft'), calling INKError with variable arguments (like INKError("The answer to the %s is %d", "Ultimate Question of Life, the Universe, and Everything", 42)) causes segfault.
> The cause of this bug is that INKError uses once initialised va_args pointer two times.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TS-419) Segmentation fault in INKError when error output is made both in error log and as debug messages

Posted by "Leif Hedstrom (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TS-419?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12900720#action_12900720 ] 

Leif Hedstrom commented on TS-419:
----------------------------------

Hmmm, shouldn't we do a va_end() before this new va_start(), just to be consistent?

> Segmentation fault in INKError when error output is made both in error log and as debug messages  
> --------------------------------------------------------------------------------------------------
>
>                 Key: TS-419
>                 URL: https://issues.apache.org/jira/browse/TS-419
>             Project: Traffic Server
>          Issue Type: Bug
>          Components: InkAPI
>    Affects Versions: 2.1.1, 2.1.0, 2.0.1, 2.0.0
>            Reporter: Yakov Markovitch
>         Attachments: INKError.patch
>
>
> When TS is configures so that to print INKError messages both to the error log and as debug messages (e.g. by starting TS with -B 'deft'), calling INKError with variable arguments (like INKError("The answer to the %s is %d", "Ultimate Question of Life, the Universe, and Everything", 42)) causes segfault.
> The cause of this bug is that INKError uses once initialised va_args pointer two times.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (TS-419) Segmentation fault in INKError when error output is made both in error log and as debug messages

Posted by "Yakov Markovitch (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TS-419?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12900705#action_12900705 ] 

Yakov Markovitch edited comment on TS-419 at 8/20/10 10:29 AM:
---------------------------------------------------------------

Here the patch that fixes the bug. Works both against 2.0.0 and the trunk.

      was (Author: ymarkovitch):
    Here the patch that fixes the bug. Works both again 2.0.0 and the trunk.
  
> Segmentation fault in INKError when error output is made both in error log and as debug messages  
> --------------------------------------------------------------------------------------------------
>
>                 Key: TS-419
>                 URL: https://issues.apache.org/jira/browse/TS-419
>             Project: Traffic Server
>          Issue Type: Bug
>          Components: InkAPI
>    Affects Versions: 2.1.1, 2.1.0, 2.0.1, 2.0.0
>            Reporter: Yakov Markovitch
>         Attachments: INKError.patch
>
>
> When TS is configures so that to print INKError messages both to the error log and as debug messages (e.g. by starting TS with -B 'deft'), calling INKError with variable arguments (like INKError("The answer to the %s is %d", "Ultimate Question of Life, the Universe, and Everything", 42)) causes segfault.
> The cause of this bug is that INKError uses once initialised va_args pointer two times.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TS-419) Segmentation fault in INKError when error output is made both in error log and as debug messages

Posted by "Leif Hedstrom (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TS-419?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12900742#action_12900742 ] 

Leif Hedstrom commented on TS-419:
----------------------------------

Here's a slight modification to the patch proposal:

diff --git a/proxy/InkAPI.cc b/proxy/InkAPI.cc
index 6ad6380..f594536 100644
--- a/proxy/InkAPI.cc
+++ b/proxy/InkAPI.cc
@@ -393,10 +393,13 @@ void
 INKError(const char *fmt, ...)
 {
   va_list args;
-  va_start(args, fmt);
   if (is_action_tag_set("deft") || is_action_tag_set("sdk_vbos_errors")) {
+    va_start(args, fmt);
     diags->print_va(NULL, DL_Error, NULL, NULL, fmt, args);
+    va_end(args);
   }
+
+  va_start(args, fmt);
   Log::va_error((char *) fmt, args);
   va_end(args);
 }




> Segmentation fault in INKError when error output is made both in error log and as debug messages  
> --------------------------------------------------------------------------------------------------
>
>                 Key: TS-419
>                 URL: https://issues.apache.org/jira/browse/TS-419
>             Project: Traffic Server
>          Issue Type: Bug
>          Components: InkAPI
>    Affects Versions: 2.1.1, 2.1.0, 2.0.1, 2.0.0
>            Reporter: Yakov Markovitch
>         Attachments: INKError.patch
>
>
> When TS is configures so that to print INKError messages both to the error log and as debug messages (e.g. by starting TS with -B 'deft'), calling INKError with variable arguments (like INKError("The answer to the %s is %d", "Ultimate Question of Life, the Universe, and Everything", 42)) causes segfault.
> The cause of this bug is that INKError uses once initialised va_args pointer two times.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (TS-419) Segmentation fault in INKError when error output is made both in error log and as debug messages

Posted by "Leif Hedstrom (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TS-419?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Leif Hedstrom resolved TS-419.
------------------------------

    Resolution: Fixed

Committed the slightly modified version of this patch. Thanks!

> Segmentation fault in INKError when error output is made both in error log and as debug messages  
> --------------------------------------------------------------------------------------------------
>
>                 Key: TS-419
>                 URL: https://issues.apache.org/jira/browse/TS-419
>             Project: Traffic Server
>          Issue Type: Bug
>          Components: InkAPI
>    Affects Versions: 2.1.1, 2.1.0, 2.0.1, 2.0.0
>            Reporter: Yakov Markovitch
>         Attachments: INKError.patch
>
>
> When TS is configures so that to print INKError messages both to the error log and as debug messages (e.g. by starting TS with -B 'deft'), calling INKError with variable arguments (like INKError("The answer to the %s is %d", "Ultimate Question of Life, the Universe, and Everything", 42)) causes segfault.
> The cause of this bug is that INKError uses once initialised va_args pointer two times.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.