[asterisk-bugs] [JIRA] (ASTERISK-21978) Crash caused by RAII_VAR in test_json when loading module

Matt Jordan (JIRA) noreply at issues.asterisk.org
Fri Jun 28 14:45:05 CDT 2013


Matt Jordan created ASTERISK-21978:
--------------------------------------

             Summary: Crash caused by RAII_VAR in test_json when loading module
                 Key: ASTERISK-21978
                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-21978
             Project: Asterisk
          Issue Type: Bug
          Components: Tests/General
    Affects Versions: 12
            Reporter: Matt Jordan
         Attachments: ASTERISK-21978-backtrace.txt

When Asterisk loads a test module, it actually calls each test module with the TEST_INIT flag to set the info struct's properties (summary, description, etc.) Tests have to be careful to not call any test execution logic when this occurs.

The test_json tests are using RAII_VAR to stub out and track memory allocation leaks. Because they are being called as a result of RAII_VAR, they are called when TEST_INIT is passed to the test function.

This can apparently cause a crash.

The unit test framework now has the ability to have pre/post-test executions called before/after test execution, which will handle not calling such methods when TEST_INIT is used.



--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.asterisk.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the asterisk-bugs mailing list