summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSangho Park <sangho1206.park@samsung.com>2014-05-20 02:07:58 -0700
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>2014-05-20 02:07:58 -0700
commitc1ce46dd8327e59bc391c6dccb3a75d035bd8584 (patch)
tree3137918b72926eead80a7b852c5280c9ae91f7e9
parenteb2a22ef2578540a7731a4b2936323371ccf71cd (diff)
parent1f7837babf5904a6ac58c59392b0319456f1f56e (diff)
downloadqemu-c1ce46dd8327e59bc391c6dccb3a75d035bd8584.tar.gz
qemu-c1ce46dd8327e59bc391c6dccb3a75d035bd8584.tar.bz2
qemu-c1ce46dd8327e59bc391c6dccb3a75d035bd8584.zip
Merge changes Icc56eea0,I76dfbd3c into tizen
* changes: backtrace: avoid possible memory corruption have to resolve this asap; ecs : make client list thread-safe use QTAIL_FOREACH_SAFE instead of QTAIL_FOREACH not to call ecs_close in stop_ecs (FIXME)
-rw-r--r--tizen/src/ecs/ecs.c25
-rw-r--r--tizen/src/maru_err_table.c5
2 files changed, 16 insertions, 14 deletions
diff --git a/tizen/src/ecs/ecs.c b/tizen/src/ecs/ecs.c
index ef50442845..758ae15555 100644
--- a/tizen/src/ecs/ecs.c
+++ b/tizen/src/ecs/ecs.c
@@ -122,9 +122,9 @@ bool send_to_all_client(const char* data, const int len) {
TRACE("data len: %d, data: %s\n", len, data);
pthread_mutex_lock(&mutex_clilist);
- ECS_Client *clii;
+ ECS_Client *clii,*next;
- QTAILQ_FOREACH(clii, &clients, next)
+ QTAILQ_FOREACH_SAFE(clii, &clients, next, next)
{
send_to_client(clii->client_fd, data, len);
}
@@ -197,7 +197,7 @@ static Monitor *monitor_create(void) {
}
static void ecs_close(ECS_State *cs) {
- ECS_Client *clii;
+ ECS_Client *clii, *next;
INFO("### Good bye! ECS ###\n");
if (cs == NULL)
@@ -223,7 +223,7 @@ static void ecs_close(ECS_State *cs) {
cs->alive_timer = NULL;
}
- QTAILQ_FOREACH(clii, &clients, next)
+ QTAILQ_FOREACH_SAFE(clii, &clients, next, next)
{
ecs_client_close(clii);
}
@@ -369,9 +369,9 @@ static void epoll_cli_add(ECS_State *cs, int fd) {
#endif
static ECS_Client *ecs_find_client(int fd) {
- ECS_Client *clii;
+ ECS_Client *clii, *next;
- QTAILQ_FOREACH(clii, &clients, next)
+ QTAILQ_FOREACH_SAFE(clii, &clients, next, next)
{
if (clii->client_fd == fd)
return clii;
@@ -380,9 +380,9 @@ static ECS_Client *ecs_find_client(int fd) {
}
ECS_Client *find_client(unsigned char id, unsigned char type) {
- ECS_Client *clii;
+ ECS_Client *clii, *next;
- QTAILQ_FOREACH(clii, &clients, next)
+ QTAILQ_FOREACH_SAFE(clii, &clients, next, next)
{
if (clii->client_id == id && clii->client_type == type)
return clii;
@@ -513,13 +513,13 @@ static void make_keep_alive_msg(void) {
static void alive_checker(void *opaque) {
- ECS_Client *clii;
+ ECS_Client *clii, *next;
if (NULL != current_ecs && !current_ecs->ecs_running) {
return;
}
- QTAILQ_FOREACH(clii, &clients, next)
+ QTAILQ_FOREACH_SAFE(clii, &clients, next, next)
{
if (1 == clii->keep_alive) {
INFO("get client fd %d - keep alive fail\n", clii->client_fd);
@@ -619,17 +619,14 @@ static int ecs_loop(ECS_State *cs)
for (index = 0; index < cs->reads.fd_count; index++) {
if (cs->reads.fd_array == NULL)
continue;
-
if (FD_ISSET(cs->reads.fd_array[index], &temps)) {
if (cs->reads.fd_array[index] == cs->listen_fd) {
ecs_accept(cs);
continue;
}
-
ecs_read(ecs_find_client(cs->reads.fd_array[index]));
}
}
-
return 0;
}
#elif defined(CONFIG_DARWIN)
@@ -729,7 +726,7 @@ int stop_ecs(void) {
INFO("ecs is closing.\n");
if (NULL != current_ecs) {
current_ecs->ecs_running = 0;
- ecs_close(current_ecs);
+ // ecs_close(current_ecs);
}
pthread_mutex_destroy(&mutex_clilist);
diff --git a/tizen/src/maru_err_table.c b/tizen/src/maru_err_table.c
index 29f55d699d..b12dcf369b 100644
--- a/tizen/src/maru_err_table.c
+++ b/tizen/src/maru_err_table.c
@@ -265,6 +265,11 @@ void maru_dump_backtrace(void *ptr, int depth)
pTopFrame = (void *)((PCONTEXT)pContext)->Ebp;
}
+ if (pTopFrame == NULL) {
+ INFO("ebp is null, skip this for now\n");
+ return ;
+ }
+
nCount = 0;
currentFrame.pNext = ((struct frame_layout *)pTopFrame)->pNext;
currentFrame.pReturnAddr = ((struct frame_layout *)pTopFrame)->pReturnAddr;