You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by GitBox <gi...@apache.org> on 2020/12/03 11:44:22 UTC

[GitHub] [incubator-weex] lb4110991 commented on issue #3255: [Android]Android 11 Not working properly

lb4110991 commented on issue #3255:
URL: https://github.com/apache/incubator-weex/issues/3255#issuecomment-737890574


   > I found the result of **fork() is not 0**, so enter the condition three. m_impl->futexPageQueue->spinWaitPeer() will call **sched_yield()**,until **timeout**.
   > 
   > I am puzzled, what has changed in fork(), on android11 ​​phones.
   > 
   > IPCSender *WeexJSConnection::start(bool reinit) {
   > ......
   > 
   > // static bool startupPie = s_start_pie;
   > static bool startupPie = SoUtils::pie_support();
   > LOGE("startupPie :%d", startupPie);
   > 
   > pid_t child;
   > if (reinit) {
   > #if PRINT_LOG_CACHEFILE
   > mcfile << "reinit is ture use vfork" << std::endl;
   > mcfile.close();
   > #endif
   > child = vfork();
   > } else {
   > #if PRINT_LOG_CACHEFILE
   > mcfile << "reinit is false use fork" << std::endl;
   > mcfile.close();
   > #endif
   > child = fork();
   > }
   > LOGD("fork result=%d", child);
   > if (child == -1) {
   > int myerrno = errno;
   > munmap(base, IPCFutexPageQueue::ipc_size);
   > throw IPCException("failed to fork: %s", strerror(myerrno));
   > } else if (child == 0 || child == 6743) {
   > LOGE("weexcore fork child success\n");
   > // the child
   > closeAllButThis(client_->ipcFd, server_->ipcFd);
   > // implements close all but handles[1]
   > // do exec
   > doExec(client_->ipcFd, server_->ipcFd, true, startupPie);
   > LOGE("exec Failed completely.");
   > // failed to exec
   > _exit(1);
   > } else {
   > **//step into here ====condition three**
   > printLogOnFile("fork success on main process and start m_impl->futexPageQueue->spinWaitPeer()");
   > LOGD("fork success on main process and start m_impl->futexPageQueue->spinWaitPeer()");
   > m_impl->child = child;
   > try {
   > m_impl->futexPageQueue->spinWaitPeer();
   > } catch (IPCException &e) {
   > LOGE("WeexJSConnection catch: %s", e.msg());
   > // TODO throw exception
   > if(s_in_find_icu) {
   > // WeexCore::WeexProxy::reportNativeInitStatus("-1013", "find icu timeout");
   > }
   > return nullptr;
   > }
   > }
   > return m_impl->serverSender.get();
   > }
   
   hello, Have you solved this problem?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org