未验证 提交 705882c6 编写于 作者: O openharmony_ci 提交者: Gitee

!986 fix "exit" in global constructor causes the program to hang

Merge pull request !986 from fangting/master
#include <stdlib.h>
#include "test.h"
__attribute__((constructor))
void B_ctor() {
exit(t_status);
}
int main() {
return t_status;
}
\ No newline at end of file
......@@ -80,6 +80,7 @@ functional_list = [
"wcstol",
"dlclose_reset",
"atexit_dlclose",
"exit_constructor",
]
if (use_pthread_cancel) {
......
......@@ -2570,7 +2570,7 @@ static void do_init_fini(struct dso **queue)
{
struct dso *p;
size_t dyn[DYN_CNT], i;
int self = __pthread_self()->tid;
pthread_t self = __pthread_self();
pthread_mutex_lock(&init_fini_lock);
for (i=0; (p=queue[i]); i++) {
......
......@@ -106,7 +106,7 @@ struct dso {
dev_t dev;
ino_t ino;
uint64_t file_offset;
int ctor_visitor;
pthread_t ctor_visitor;
char *rpath_orig, *rpath;
struct tls_module tls;
size_t tls_id;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册