From: giwoong.kim Date: Fri, 4 May 2012 10:35:20 +0000 (+0900) Subject: [Title] memory exception popup X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.1~1617 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2554d6754ee81b46c2d65c20e461dea66a6d2ed5;p=sdk%2Femulator%2Fqemu.git [Title] memory exception popup [Type] [Module] [Priority] [Jira#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] --- diff --git a/oslib-posix.c b/oslib-posix.c index ce755496b5..cf5d18bde6 100644 --- a/oslib-posix.c +++ b/oslib-posix.c @@ -61,10 +61,39 @@ int qemu_daemon(int nochdir, int noclose) return daemon(nochdir, noclose); } +#ifdef CONFIG_MARU +//TODO: temp +#define JAR_SKINFILE_PATH "emulator-skin.jar" +#define JAVA_EXEFILE_PATH "java" +#define JAVA_EXEOPTION "-jar" +#define MAX_COMMAND 512 + +static int start_simple_client(char* msg) { + int ret = 0; + char cmd[MAX_COMMAND] = {0}; + + sprintf(cmd, "%s %s %s %s=\"%s\"", JAVA_EXEFILE_PATH, JAVA_EXEOPTION, JAR_SKINFILE_PATH, "simple.msg", msg); + +#ifdef __WIN32 + ret = WinExec(cmd, SW_SHOW); +#else + ret = system(cmd); +#endif + + return 1; +} +#endif + void *qemu_oom_check(void *ptr) { if (ptr == NULL) { fprintf(stderr, "Failed to allocate memory: %s\n", strerror(errno)); + +#ifdef CONFIG_MARU + char _msg[] = "Failed to allocate memory in qemu"; + start_simple_client(_msg); +#endif + abort(); } return ptr; diff --git a/oslib-win32.c b/oslib-win32.c index 5e3de7dc8a..586d802821 100644 --- a/oslib-win32.c +++ b/oslib-win32.c @@ -31,10 +31,39 @@ #include "trace.h" #include "qemu_socket.h" +#ifdef CONFIG_MARU +//TODO: temp +#define JAR_SKINFILE_PATH "emulator-skin.jar" +#define JAVA_EXEFILE_PATH "java" +#define JAVA_EXEOPTION "-jar" +#define MAX_COMMAND 512 + +static int start_simple_client(char* msg) { + int ret = 0; + char cmd[MAX_COMMAND] = {0}; + + sprintf(cmd, "%s %s %s %s=\"%s\"", JAVA_EXEFILE_PATH, JAVA_EXEOPTION, JAR_SKINFILE_PATH, "simple.msg", msg); + +#ifdef __WIN32 + ret = WinExec(cmd, SW_SHOW); +#else + ret = system(cmd); +#endif + + return 1; +} +#endif + void *qemu_oom_check(void *ptr) { if (ptr == NULL) { fprintf(stderr, "Failed to allocate memory: %lu\n", GetLastError()); + +#ifdef CONFIG_MARU + char _msg[] = "Failed to allocate memory in qemu"; + start_simple_client(_msg); +#endif + abort(); } return ptr; diff --git a/tizen/src/skin/maruskin_client.c b/tizen/src/skin/maruskin_client.c index 458c6542d3..f1950316be 100644 --- a/tizen/src/skin/maruskin_client.c +++ b/tizen/src/skin/maruskin_client.c @@ -132,11 +132,14 @@ static void* run_skin_client(void* arg) } //retrieves the termination status of the specified process - GetExitCodeProcess(pi.hProcess, &dwRet); + if (GetExitCodeProcess(pi.hProcess, &dwRet) != 0) { + ERR("failed to GetExitCodeProcess, error %u\n", GetLastError()); + } INFO("child return value : %d\n", dwRet); if (dwRet == -1) { - //TODO: + //child process is terminated with some problem. + //so qemu process will terminate, too. immediately. exit(1); } @@ -161,7 +164,8 @@ static void* run_skin_client(void* arg) INFO("child return value : %d\n", ret); if (ret == 0xff) { - //TODO: + //child process is terminated with some problem. + //so qemu process will terminate, too. immediately. exit(1); } }