HaxeFoundation / HaxeFoundation/hashlink

GC error encountered in Android runtime environment

Open
#553 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
901
Forks
201
Avg merge
18h 9m
Merged PRs (30d)
8

Description

https://github.com/HaxeFoundation/hashlink/commit/21ede72a8abbc39b71c3c3607eca7c8a5d688d28#r77274896

This is the key cause of the problem.

And i chaneg it:
```c
pextra *e = extra_pages, *prev = NULL;
while( e ) {
__android_log_print(ANDROID_LOG_VERBOSE, "SDL", "page_ptr=%d ptr=%d", e->page_ptr,ptr);
if( e->page_ptr == ptr ) {
if( prev )
prev->next = e->next;
else
extra_pages = e->next;
munmap(e->base_ptr, size + EXTRA_SIZE);
return;
}
prev = e;
e = e->next;
}
munmap(ptr,size);
```

Crash log:
```
V/SDL: page_ptr=1965359104 ptr=0
2022-06-30 06:51:30.315 24219-24255/com.example.heapsandroid.helloworld V/SDL: page_ptr=1969422336 ptr=0
2022-06-30 06:51:30.315 24219-24255/com.example.heapsandroid.helloworld V/SDL: page_ptr=1969881088 ptr=0
2022-06-30 06:51:30.315 24219-24255/com.example.heapsandroid.helloworld V/SDL: page_ptr=1970536448 ptr=0
2022-06-30 06:51:30.315 24219-24255/com.example.heapsandroid.helloworld V/SDL: page_ptr=1971322880 ptr=0
2022-06-30 06:51:30.315 24219-24255/com.example.heapsandroid.helloworld V/SDL: page_ptr=2070740992 ptr=0
2022-06-30 06:51:30.315 24219-24255/com.example.heapsandroid.helloworld V/SDL: page_ptr=2071134208 ptr=0
2022-06-30 06:51:30.315 24219-24255/com.example.heapsandroid.helloworld V/SDL: page_ptr=2073100288 ptr=0
2022-06-30 06:51:30.315 24219-24255/com.example.heapsandroid.helloworld V/SDL: page_ptr=2100232192 ptr=0
2022-06-30 06:51:30.315 24219-24255/com.example.heapsandroid.helloworld V/SDL: page_ptr=2101739520 ptr=0
2022-06-30 06:51:30.315 24219-24255/com.example.heapsandroid.helloworld V/SDL: page_ptr=2107703296 ptr=0
2022-06-30 06:51:30.315 24219-24255/com.example.heapsandroid.helloworld V/SDL: page_ptr=-37945344 ptr=0
2022-06-30 06:51:30.315 24219-24255/com.example.heapsandroid.helloworld V/SDL: page_ptr=-37683200 ptr=0
2022-06-30 06:51:30.315 24219-24255/com.example.heapsandroid.helloworld V/SDL: page_ptr=-34406400 ptr=0
2022-06-30 06:51:30.315 24219-24255/com.example.heapsandroid.helloworld V/SDL: page_ptr=-33488896 ptr=0
2022-06-30 06:51:30.315 24219-24255/com.example.heapsandroid.helloworld V/SDL: page_ptr=-33292288 ptr=0
2022-06-30 06:51:30.315 24219-24255/com.example.heapsandroid.helloworld V/SDL: page_ptr=0 ptr=0
2022-06-30 06:51:30.318 24219-24255/com.example.heapsandroid.helloworld V/SDL: page_ptr=1964441600 ptr=2071134208
2022-06-30 06:51:30.318 24219-24255/com.example.heapsandroid.helloworld V/SDL: page_ptr=1965359104 ptr=2071134208
2022-06-30 06:51:30.318 24219-24255/com.example.heapsandroid.helloworld V/SDL: page_ptr=1969422336 ptr=2071134208
2022-06-30 06:51:30.318 24219-24255/com.example.heapsandroid.helloworld V/SDL: page_ptr=1969881088 ptr=2071134208
2022-06-30 06:51:30.318 24219-24255/com.example.heapsandroid.helloworld V/SDL: page_ptr=1970536448 ptr=2071134208
2022-06-30 06:51:30.318 24219-24255/com.example.heapsandroid.helloworld V/SDL: page_ptr=1971322880 ptr=2071134208
2022-06-30 06:51:30.318 24219-24255/com.example.heapsandroid.helloworld V/SDL: page_ptr=2070740992 ptr=2071134208
2022-06-30 06:51:30.318 24219-24255/com.example.heapsandroid.helloworld V/SDL: page_ptr=2071134208 ptr=2071134208
2022-06-30 06:51:30.318 24219-24255/com.example.heapsandroid.helloworld V/SDL: page_ptr=1964441600 ptr=2070740992
2022-06-30 06:51:30.318 24219-24255/com.example.heapsandroid.helloworld V/SDL: page_ptr=1965359104 ptr=2070740992
2022-06-30 06:51:30.318 24219-24255/com.example.heapsandroid.helloworld V/SDL: page_ptr=1969422336 ptr=2070740992
2022-06-30 06:51:30.318 24219-24255/com.example.heapsandroid.helloworld V/SDL: page_ptr=1969881088 ptr=2070740992
2022-06-30 06:51:30.318 24219-24255/com.example.heapsandroid.helloworld V/SDL: page_ptr=1970536448 ptr=2070740992
2022-06-30 06:51:30.318 24219-24255/com.example.heapsandroid.helloworld V/SDL: page_ptr=1971322880 ptr=2070740992
2022-06-30 06:51:30.318 24219-24255/com.example.heapsandroid.helloworld V/SDL: page_ptr=2070740992 ptr=2070740992
2022-06-30 06:51:30.318 24219-24255/com.example.heapsandroid.helloworld V/SDL: page_ptr=1964441600 ptr=1971322880
2022-06-30 06:51:30.318 24219-24255/com.example.heapsandroid.helloworld V/SDL: page_ptr=1965359104 ptr=1971322880
2022-06-30 06:51:30.318 24219-24255/com.example.heapsandroid.helloworld V/SDL: page_ptr=1969422336 ptr=1971322880
2022-06-30 06:51:30.318 24219-24255/com.example.heapsandroid.helloworld V/SDL: page_ptr=1969881088 ptr=1971322880
2022-06-30 06:51:30.318 24219-24255/com.example.heapsandroid.helloworld V/SDL: page_ptr=1970536448 ptr=1971322880
2022-06-30 06:51:30.318 24219-24255/com.example.heapsandroid.helloworld V/SDL: page_ptr=1971322880 ptr=1971322880
2022-06-30 06:51:30.322 24219-24255/com.example.heapsandroid.helloworld D/hl: zygame/core/Start.hx:18: Start.initApp
2022-06-30 06:51:30.322 24219-24255/com.example.heapsandroid.helloworld D/hl:
2022-06-30 06:51:30.349 24219-24219/com.example.heapsandroid.helloworld V/SDL: onWindowFocusChanged(): true
2022-06-30 06:51:30.361 24219-24255/com.example.heapsandroid.helloworld E/libEGL: validate_display:92 error 3008 (EGL_BAD_DISPLAY)
2022-06-30 06:51:30.363 24219-24255/com.example.heapsandroid.helloworld V/SDL: setOrientation() orientation=-1 width=800 height=600 resizable=true hint=
2022-06-30 06:51:30.386 24219-24255/com.example.heapsandroid.helloworld V/SDL: page_ptr=1878355956 ptr=2073100288
2022-06-30 06:51:30.400 24219-24255/com.example.heapsandroid.helloworld A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x6fff6ffe6ffd6ffc in tid 24255 (SDLThread), pid 24219 (roid.helloworld)
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.