-
Notifications
You must be signed in to change notification settings - Fork 3
Test malloc #119
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
Open
preeja33
wants to merge
54
commits into
develop
Choose a base branch
from
test_malloc
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Test malloc #119
Changes from all commits
Commits
Show all changes
54 commits
Select commit
Hold shift + click to select a range
90031b5
add sleep in destructor of test
preeja33 0c277fd
Update MiracastServiceImplementation.cpp
preeja33 c361e04
Update L1-tests.yml
preeja33 ed8950a
Update MiracastController.cpp
preeja33 6d1817d
Update MiracastController.cpp
preeja33 d7c93e9
Update MiracastController.cpp
preeja33 b960740
Update MiracastP2P.cpp
preeja33 256de6d
Update MiracastController.cpp
preeja33 b6616ae
Update MiracastP2P.cpp
preeja33 18377be
Update MiracastCommon.cpp
preeja33 97bf9d1
Update MiracastLogger.cpp
preeja33 5b72bc0
Update MiracastP2P.cpp
preeja33 4834db8
Update MiracastController.cpp
preeja33 c431142
Update MiracastController.cpp
preeja33 2cfd0c0
Update MiracastCommon.cpp
preeja33 e4b52b9
Update MiracastController.cpp
preeja33 d07c743
Update MiracastCommon.cpp
preeja33 052b64c
Update MiracastCommon.cpp
preeja33 a6c22d8
Update MiracastCommon.cpp
preeja33 32d7992
Update MiracastCommon.cpp
preeja33 cd44116
Update MiracastCommon.cpp
preeja33 7eaab09
Update MiracastController.cpp
preeja33 82774d1
Update MiracastController.cpp
preeja33 b64725b
Update MiracastController.cpp
preeja33 5739a01
Update MiracastController.cpp
preeja33 2088ce2
Update MiracastController.cpp
preeja33 5a9936a
Update MiracastCommon.cpp
preeja33 b4fa0eb
Update MiracastCommon.cpp
preeja33 1a0e2bf
Update MiracastCommon.cpp
preeja33 7979434
Update MiracastCommon.cpp
preeja33 a2fa25c
Update MiracastController.cpp
preeja33 fa8e4bf
Update MiracastServiceImplementation.cpp
preeja33 07cb92a
Update test_MiracastService.cpp
preeja33 c5339da
Update test_MiracastService.cpp
preeja33 85ccdca
Update test_MiracastService.cpp
preeja33 e83e97f
Update test_MiracastService.cpp
preeja33 93329d9
Update MiracastServiceImplementation.cpp
preeja33 873d70d
remove sleep hack
preeja33 85d314d
comment plyaer test
preeja33 a07917b
Update test_MiracastPlayer.cpp
preeja33 f2b9040
Update MiracastService.cpp
preeja33 8f933c6
Update MiracastServiceImplementation.cpp
preeja33 c908a60
Update MiracastServiceImplementation.cpp
preeja33 829410b
Update MiracastService.cpp
preeja33 09fe767
Update MiracastService.cpp
preeja33 682f835
Update MiracastService.cpp
preeja33 5286bc1
Update MiracastService.cpp
preeja33 43653bb
Update MiracastService.cpp
preeja33 e379875
Update MiracastController.cpp
preeja33 11728ad
Update MiracastService.cpp
balav08 70c35a2
Update test_MiracastService.cpp
balav08 f18129e
Update MiracastServiceImplementation.cpp
preeja33 fae9ae2
Update MiracastService.cpp
preeja33 ce3b0ee
Merge branch 'develop' into test_malloc
preeja33 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -46,14 +46,15 @@ MiracastController *MiracastController::getInstance(MiracastError &error_code, M | |
|
|
||
| void MiracastController::destroyInstance() | ||
| { | ||
| MIRACASTLOG_TRACE("Entering..."); | ||
| MIRACASTLOG_INFO("Entering..."); | ||
| if (nullptr != m_miracast_ctrl_obj) | ||
| { | ||
| m_miracast_ctrl_obj->destroy_ControllerFramework(); | ||
| delete m_miracast_ctrl_obj; | ||
| m_miracast_ctrl_obj = nullptr; | ||
| } | ||
| MIRACASTLOG_TRACE("Exiting..."); | ||
|
|
||
| MIRACASTLOG_INFO("Exiting..."); | ||
| } | ||
|
|
||
| MiracastController::MiracastController(void) | ||
|
|
@@ -71,7 +72,7 @@ MiracastController::MiracastController(void) | |
|
|
||
| MiracastController::~MiracastController() | ||
| { | ||
| MIRACASTLOG_TRACE("Entering..."); | ||
| MIRACASTLOG_INFO("Entering..."); | ||
|
|
||
| while (!m_deviceInfoList.empty()) | ||
| { | ||
|
|
@@ -85,13 +86,17 @@ MiracastController::~MiracastController() | |
| m_groupInfo = nullptr; | ||
| } | ||
|
|
||
| MIRACASTLOG_TRACE("Exiting..."); | ||
|
|
||
|
|
||
| // ControllerThreadCallback(this); | ||
| //destroy_ControllerFramework(); | ||
| MIRACASTLOG_INFO("Exiting..."); | ||
| } | ||
|
|
||
| MiracastError MiracastController::create_ControllerFramework(std::string p2p_ctrl_iface) | ||
| { | ||
| MiracastError ret_code = MIRACAST_OK; | ||
| MIRACASTLOG_TRACE("Entering..."); | ||
| MIRACASTLOG_INFO("Entering...start controller thread"); | ||
|
|
||
| m_controller_thread = new MiracastThread(CONTROLLER_THREAD_NAME, | ||
| CONTROLLER_THREAD_STACK, | ||
|
|
@@ -503,7 +508,7 @@ void MiracastController::event_handler(P2P_EVENTS eventId, void *data, size_t le | |
| std::string event_buffer; | ||
| MIRACASTLOG_TRACE("Entering..."); | ||
|
|
||
| event_buffer = (char *)data; | ||
| event_buffer = static_cast<char*>(data); | ||
| free(data); | ||
|
|
||
| if ( false == m_start_discovering_enabled ) | ||
|
|
@@ -518,8 +523,8 @@ void MiracastController::event_handler(P2P_EVENTS eventId, void *data, size_t le | |
| controller_msgq_data.state = convertP2PtoSessionActions(eventId); | ||
| strncpy(controller_msgq_data.msg_buffer, event_buffer.c_str(), sizeof(controller_msgq_data.msg_buffer)); | ||
| controller_msgq_data.msg_buffer[sizeof(controller_msgq_data.msg_buffer) - 1] = '\0'; | ||
|
|
||
| MIRACASTLOG_INFO("event_handler to Controller Action[%#08X] buffer:%s ", controller_msgq_data.state, event_buffer.c_str()); | ||
| MIRACASTLOG_INFO("event_handler to Controller Action[%#08X] buffer:%s len %d", controller_msgq_data.state, event_buffer.c_str(),len); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Coverity Issue - Invalid type in argument to printf format specifierArgument "len" to format specifier "%d" was expected to have type "int" but has type "unsigned long". Medium Impact, CWE-686 |
||
| m_controller_thread->send_message(&controller_msgq_data, sizeof(controller_msgq_data)); | ||
| MIRACASTLOG_VERBOSE("event received : %d buffer:%s ", eventId, event_buffer.c_str()); | ||
| } | ||
|
|
@@ -642,7 +647,7 @@ bool MiracastController::get_connection_status() | |
| void MiracastController::create_DeviceCacheData(std::string deviceMAC,std::string authType,std::string modelName,std::string deviceType, bool force_overwrite) | ||
| { | ||
| bool new_device_entry = false; | ||
| MIRACASTLOG_TRACE("Entering..."); | ||
| MIRACASTLOG_INFO("Entering..."); | ||
| DeviceInfo *cur_device_info_ptr = MiracastController::get_device_details(deviceMAC); | ||
|
|
||
| // Allocate memory and update the device cache info | ||
|
|
@@ -651,7 +656,7 @@ void MiracastController::create_DeviceCacheData(std::string deviceMAC,std::strin | |
| cur_device_info_ptr = new DeviceInfo; | ||
| new_device_entry = true; | ||
| force_overwrite = true; | ||
| MIRACASTLOG_VERBOSE("#### Creating Device Cache ####"); | ||
| MIRACASTLOG_INFO("#### Creating Device Cache ####"); | ||
| } | ||
|
|
||
| if (( nullptr != cur_device_info_ptr ) && (force_overwrite)) | ||
|
|
@@ -673,24 +678,25 @@ void MiracastController::create_DeviceCacheData(std::string deviceMAC,std::strin | |
| { | ||
| m_deviceInfoList.push_back(cur_device_info_ptr); | ||
| } | ||
| MIRACASTLOG_TRACE("Exiting..."); | ||
| MIRACASTLOG_INFO("Exiting..."); | ||
| } | ||
|
|
||
| DeviceInfo *MiracastController::get_device_details(std::string MAC) | ||
| { | ||
| DeviceInfo *deviceInfo = nullptr; | ||
| std::size_t found; | ||
| MIRACASTLOG_TRACE("Entering..."); | ||
| MIRACASTLOG_INFO("Entering..."); | ||
| for (auto device : m_deviceInfoList) | ||
| { | ||
| MIRACASTLOG_INFO("Entering device info list"); | ||
| found = device->deviceMAC.find(MAC); | ||
| if (found != std::string::npos) | ||
| { | ||
| deviceInfo = device; | ||
| break; | ||
| } | ||
| } | ||
| MIRACASTLOG_TRACE("Exiting..."); | ||
| MIRACASTLOG_INFO("Exiting..."); | ||
| return deviceInfo; | ||
| } | ||
|
|
||
|
|
@@ -784,19 +790,19 @@ void MiracastController::Controller_Thread(void *args) | |
| session_restart_required = false, | ||
| p2p_group_instance_alive = false; | ||
|
|
||
| MIRACASTLOG_TRACE("Entering..."); | ||
| MIRACASTLOG_INFO("Entering..."); | ||
|
|
||
| while (nullptr != m_controller_thread) | ||
| { | ||
| std::string event_buffer; | ||
| event_buffer.clear(); | ||
|
|
||
| MIRACASTLOG_TRACE("!!! Waiting for Event !!!\n"); | ||
| MIRACASTLOG_INFO("!!! Waiting for Event !!!\n"); | ||
| m_controller_thread->receive_message(&controller_msgq_data, CONTROLLER_MSGQ_SIZE, THREAD_RECV_MSG_INDEFINITE_WAIT); | ||
|
|
||
| event_buffer = controller_msgq_data.msg_buffer; | ||
|
|
||
| MIRACASTLOG_TRACE("!!! Received Action[%#08X]Data[%s] !!!\n", controller_msgq_data.state, event_buffer.c_str()); | ||
| MIRACASTLOG_INFO("!!! Received Action[%#08X]Data[%s] !!!\n", controller_msgq_data.state, event_buffer.c_str()); | ||
|
|
||
| if (CONTROLLER_SELF_ABORT == controller_msgq_data.state) | ||
| { | ||
|
|
@@ -1099,6 +1105,7 @@ void MiracastController::Controller_Thread(void *args) | |
| else | ||
| { | ||
| error_code = WPEFramework::Exchange::IMiracastService::REASON_CODE_GENERIC_FAILURE; | ||
| MIRACASTLOG_INFO("predebug session restart"); | ||
| session_restart_required = true; | ||
| MIRACASTLOG_ERROR("!!!! Unable to get the Source Device IP and Terminating Group Here !!!!"); | ||
| remove_P2PGroupInstance(); | ||
|
|
@@ -1124,6 +1131,7 @@ void MiracastController::Controller_Thread(void *args) | |
| p2p_group_instance_alive = false; | ||
| } | ||
| m_connect_req_notified = false; | ||
| MIRACASTLOG_ERROR("####exit from failure condition"); | ||
| } | ||
|
|
||
| if ( true == session_restart_required ) | ||
|
|
@@ -1142,6 +1150,7 @@ void MiracastController::Controller_Thread(void *args) | |
| session_restart_required = false; | ||
| } | ||
| } | ||
| MIRACASTLOG_ERROR("####exit from CONTROLLER_GO_GROUP_FORMATION_FAILURE"); | ||
| break; | ||
| case CONTROLLER_GO_GROUP_REMOVED: | ||
| { | ||
|
|
@@ -1247,6 +1256,7 @@ void MiracastController::Controller_Thread(void *args) | |
| } | ||
| new_thunder_req_client_connection_sent = false; | ||
| another_thunder_req_client_connection_sent = false; | ||
| MIRACASTLOG_INFO("predebug session_restart_required\n"); | ||
| session_restart_required = true; | ||
| p2p_group_instance_alive = false; | ||
| m_connect_req_notified = false; | ||
|
|
@@ -1336,7 +1346,8 @@ void MiracastController::Controller_Thread(void *args) | |
| MIRACASTLOG_ERROR("!!! Invalid MsgType Received[%#08X]Data[%s] !!!", controller_msgq_data.msg_type, event_buffer.c_str()); | ||
| } | ||
| break; | ||
| } | ||
| } | ||
| MIRACASTLOG_ERROR("!!! exit from outer switch"); | ||
| } | ||
| MIRACASTLOG_TRACE("Exiting..."); | ||
| } | ||
|
|
@@ -1605,10 +1616,10 @@ void ControllerThreadCallback(void *args) | |
| { | ||
| MiracastController *miracast_ctrler_obj = (MiracastController *)args; | ||
| MIRACASTLOG_TRACE("Entering..."); | ||
| sleep(1); | ||
| sleep(1); | ||
| if ( nullptr != miracast_ctrler_obj ) | ||
| { | ||
| miracast_ctrler_obj->Controller_Thread(nullptr); | ||
| } | ||
| MIRACASTLOG_TRACE("Exiting..."); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coverity issue no longer present as of: undefined
Show issue
Coverity Issue - Uncaught exception
An exception of type "std::regex_error" is thrown but the exception specification "/implicit/noexcept" doesn't allow it to be thrown. This will result in a call to terminate().
Medium Impact, CWE-248
UNCAUGHT_EXCEPT