ptitSeb / box86

Box86 - Linux Userspace x86 Emulator with a twist, targeted at ARM Linux devices
https://box86.org
MIT License
3.33k stars 228 forks source link

Software crashes when sending pictures and videos. #271

Closed Mr-HappyLI closed 2 years ago

Mr-HappyLI commented 3 years ago

Now,I have a problem. Software crashes when sending pictures and videos. There are some logs: 0009:fixme:wincodecs:JpegDecoder_Frame_CopyPalette (0x581afebc,0x73a72090): stub 29107|SIGILL @0x76a585a8 (???(0x76a585a8)) (x86pc=0x725a808b/???:"???", esp=0x7fb9b2ec), for accessing 0x76a585a8 (code=1), db=(nil)((nil):(nil)/(nil):(nil)/???) opcode=00 00 00 F6 05 90 B6 AE

And use gdb:

Breakpoint 1 at 0x75f17f58
(gdb) x/30i 0x75f17f00
   0x75f17f00:  strhi   r0, [pc], #-1192    ; 0x75f17f08
   0x75f17f04:          ; <UNDEFINED> instruction: 0xffffff08
   0x75f17f08:  cfstr32hi   mvfx4, [r8, #-556]  ; 0xfffffdd4
   0x75f17f0c:          ; <UNDEFINED> instruction: 0xffff309d
   0x75f17f10:  stmiaeq r12!, {r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, pc}^
   0x75f17f14:          ; <UNDEFINED> instruction: 0xff53008b
   0x75f17f18:  rscspl  r0, pc, r5, ror r8  ; <UNPREDICTABLE>
   0x75f17f1c:  sbcne   r8, r4, r12, lsl #6
   0x75f17f20:  addspl  r0, r8, #1031798784 ; 0x3d800000
   0x75f17f24:  svceq   0x000475f2
   0x75f17f28:          ; <UNDEFINED> instruction: 0xfffee384
   0x75f17f2c:  stcleq  3, cr8, [r12], #1020    ; 0x3fc
   0x75f17f30:  bl  0x74cb2084
   0x75f17f34:  strbtcs r7, [r8], #-1521    ; 0xfffffa0f
   0x75f17f38:  ldmdavs r5!, {r0, r1, r2, r5, r6, r7, r8, r12, sp, lr, pc}^
   0x75f17f3c:  ldrbvc  r5, [r2, #664]! ; 0x298
   0x75f17f40:  stmibls r8!, {r1, r3, r5, r6, r9}^
   0x75f17f44:  mvnshi  pc, #248, 30    ; 0x3e0
   0x75f17f48:  mvngt   r2, r4, asr #1
   0x75f17f4c:  ldrshtls    pc, [pc], #254  ; <UNPREDICTABLE>
   0x75f17f50:  usatpl  r8, #5, r5, asr #18
   0x75f17f54:  rscle   r8, r12, r3, asr r1
=> 0x75f17f58:          ; <UNDEFINED> instruction: 0xf6000000
   0x75f17f5c:  vadd.i16    d25, d2, d5
   0x75f17f60:  sfmpl   f0, 4, [r11, #468]  ; 0x1d4
   0x75f17f64:  movwhi  r7, #54536  ; 0xd508
   0x75f17f68:  smultteq    r10, r12, r8
   0x75f17f6c:  
    stmda   r12, {r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r12, sp, lr}
   0x75f17f70:  stc 8, cr0, [sp, #-720]!    ; 0xfffffd30
   0x75f17f74:  stmdavs r12, {r0, r1, r7, r10, r11, sp, lr, pc}

I don't know if dynarec has a problem or something Can you provide some solutions?Thank you!

ptitSeb commented 3 years ago

What software are you using? Seems it's running under wine but I need more detail.

Mr-HappyLI commented 3 years ago

Hi,I use WeChat and I want to use WeChat under windows in raspberry.

0024:trace:wincodecs:ImagingFactory_CreateInstance ({ec5ec8a9-c395-4314-9c77-54d7a935ff70},7FA0D30C)
0024:trace:wincodecs:ImagingFactory_QueryInterface (58A2D8A0,{ec5ec8a9-c395-4314-9c77-54d7a935ff70},7FA0D30C)
0024:trace:wincodecs:ImagingFactory_AddRef (58A2D8A0) refcount=2
0024:trace:wincodecs:ImagingFactory_Release (58A2D8A0) refcount=1
0024:trace:wincodecs:ImagingFactory_CreateEncoder (58A2D8A0,{19e4a5aa-5662-4fc5-a0c0-1758028e1057},(null),58C28654)
0024:trace:wincodecs:BitmapEncoderInfo_AddRef (588ED7E8) refcount=2
0024:trace:wincodecs:BitmapEncoderInfo_AddRef (62415630) refcount=2
0024:trace:wincodecs:BitmapEncoderInfo_AddRef (589D3600) refcount=2
0024:trace:wincodecs:BitmapEncoderInfo_AddRef (58EBA2A8) refcount=2
0024:trace:wincodecs:BitmapEncoderInfo_AddRef (58D12EE8) refcount=2
0024:trace:wincodecs:BitmapEncoderInfo_AddRef (589E4238) refcount=2
0024:trace:wincodecs:ComponentEnum_Reset (588E2538)
0024:trace:wincodecs:ComponentEnum_Next (588E2538,1,7FA0D240,7FA0D24C)
0024:trace:wincodecs:BitmapEncoderInfo_AddRef (588ED7E8) refcount=3
0024:trace:wincodecs:BitmapEncoderInfo_QueryInterface (588ED7E8,{94c9b4ee-a09f-4f92-8a1e-4a9bce7e76fb},7FA0D244)
0024:trace:wincodecs:BitmapEncoderInfo_AddRef (588ED7E8) refcount=4
0024:trace:wincodecs:BitmapEncoderInfo_GetContainerFormat (588ED7E8,7FA0D250)
0024:trace:wincodecs:BitmapEncoderInfo_Release (588ED7E8) refcount=3
0024:trace:wincodecs:BitmapEncoderInfo_Release (588ED7E8) refcount=2
0024:trace:wincodecs:ComponentEnum_Next (588E2538,1,7FA0D240,7FA0D24C)
0024:trace:wincodecs:BitmapEncoderInfo_AddRef (62415630) refcount=3
0024:trace:wincodecs:BitmapEncoderInfo_QueryInterface (62415630,{94c9b4ee-a09f-4f92-8a1e-4a9bce7e76fb},7FA0D244)
0024:trace:wincodecs:BitmapEncoderInfo_AddRef (62415630) refcount=4
0024:trace:wincodecs:BitmapEncoderInfo_GetContainerFormat (62415630,7FA0D250)
0024:trace:wincodecs:BitmapEncoderInfo_Release (62415630) refcount=3
0024:trace:wincodecs:BitmapEncoderInfo_Release (62415630) refcount=2
0024:trace:wincodecs:ComponentEnum_Next (588E2538,1,7FA0D240,7FA0D24C)
0024:trace:wincodecs:BitmapEncoderInfo_AddRef (589D3600) refcount=3
0024:trace:wincodecs:BitmapEncoderInfo_QueryInterface (589D3600,{94c9b4ee-a09f-4f92-8a1e-4a9bce7e76fb},7FA0D244)
0024:trace:wincodecs:BitmapEncoderInfo_AddRef (589D3600) refcount=4
0024:trace:wincodecs:BitmapEncoderInfo_GetContainerFormat (589D3600,7FA0D250)
0024:trace:wincodecs:BitmapEncoderInfo_CreateInstance (589D3600,7FA0D248)
0024:trace:wincodecs:CommonEncoder_CreateInstance ({00000103-a8f2-4877-ba0a-fd2b6645fb94},7FA0D248)
0024:trace:wincodecs:CommonEncoder_QueryInterface (58DA14F8,{00000103-a8f2-4877-ba0a-fd2b6645fb94},7FA0D248)
0024:trace:wincodecs:CommonEncoder_AddRef (58DA14F8) refcount=2
0024:trace:wincodecs:CommonEncoder_Release (58DA14F8) refcount=1
0024:trace:wincodecs:BitmapEncoderInfo_Release (589D3600) refcount=3
0024:trace:wincodecs:BitmapEncoderInfo_Release (589D3600) refcount=2
0024:trace:wincodecs:ComponentEnum_Release (588E2538) refcount=0
0024:trace:wincodecs:BitmapEncoderInfo_Release (588ED7E8) refcount=1
0024:trace:wincodecs:BitmapEncoderInfo_Release (62415630) refcount=1
0024:trace:wincodecs:BitmapEncoderInfo_Release (589D3600) refcount=1
0024:trace:wincodecs:BitmapEncoderInfo_Release (58EBA2A8) refcount=1
0024:trace:wincodecs:BitmapEncoderInfo_Release (58D12EE8) refcount=1
0024:trace:wincodecs:BitmapEncoderInfo_Release (589E4238) refcount=1
0024:trace:wincodecs:ImagingFactory_Release (58A2D8A0) refcount=0
0024:trace:wincodecs:CommonEncoder_Initialize (58DA14F8,58CFC358,2)
5734|SIGILL @0x76317f58 (???(0x76317f58)) (x86pc=0x5625bf4c/???:"???", esp=0x7fa0d11c), for accessing 0x76317f58 (code=1), db=(nil)((nil):(nil)/(nil):(nil)/???) opcode=00 00 00 F6 05 98 52 32
Free Dynarec block for /opt/wine-6.0/bin/wine
Free Dynarec block for /opt/wine-6.0/lib/wine/ntdll.so
Free Dynarec block for /opt/wine-6.0/lib/libwine.so.1.0
Free Dynarec block for /opt/wine-6.0/lib/wine/ucrtbase.so
Free Dynarec block for /opt/wine-6.0/lib/wine/gdi32.so
Free Dynarec block for /opt/wine-6.0/lib/wine/user32.so
Mr-HappyLI commented 3 years ago

And I use wine6.0.

ptitSeb commented 3 years ago

The error seems to be that an x86 callback is execute as ARM code. It's probably a wrapped function where I missed the callback in the Wrapping. It can be quite difficult to track, especially with wine. It seems to be on some jpeg functions, but not sure.

First step is: using gdb, does bt gives interesting informations?

Mr-HappyLI commented 3 years ago
received signal SIGILL, Illegal instruction.
0x76917f58 in ?? ()
(gdb) bt
#-1 0x76917f58 in ?? ()
Backtrace stopped: Cannot access memory at address 0x4fb5f820

Breakpoint 1 at 0x75f17f58
(gdb) x/30i 0x75f17f00
   0x75f17f00:  strhi   r0, [pc], #-1192    ; 0x75f17f08
   0x75f17f04:          ; <UNDEFINED> instruction: 0xffffff08
   0x75f17f08:  cfstr32hi   mvfx4, [r8, #-556]  ; 0xfffffdd4
   0x75f17f0c:          ; <UNDEFINED> instruction: 0xffff309d
   0x75f17f10:  stmiaeq r12!, {r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, pc}^
   0x75f17f14:          ; <UNDEFINED> instruction: 0xff53008b
   0x75f17f18:  rscspl  r0, pc, r5, ror r8  ; <UNPREDICTABLE>
   0x75f17f1c:  sbcne   r8, r4, r12, lsl #6
   0x75f17f20:  addspl  r0, r8, #1031798784 ; 0x3d800000
   0x75f17f24:  svceq   0x000475f2
   0x75f17f28:          ; <UNDEFINED> instruction: 0xfffee384
   0x75f17f2c:  stcleq  3, cr8, [r12], #1020    ; 0x3fc
   0x75f17f30:  bl  0x74cb2084
   0x75f17f34:  strbtcs r7, [r8], #-1521    ; 0xfffffa0f
   0x75f17f38:  ldmdavs r5!, {r0, r1, r2, r5, r6, r7, r8, r12, sp, lr, pc}^
   0x75f17f3c:  ldrbvc  r5, [r2, #664]! ; 0x298
   0x75f17f40:  stmibls r8!, {r1, r3, r5, r6, r9}^
   0x75f17f44:  mvnshi  pc, #248, 30    ; 0x3e0
   0x75f17f48:  mvngt   r2, r4, asr #1
   0x75f17f4c:  ldrshtls    pc, [pc], #254  ; <UNPREDICTABLE>
   0x75f17f50:  usatpl  r8, #5, r5, asr #18
   0x75f17f54:  rscle   r8, r12, r3, asr r1
=> 0x75f17f58:          ; <UNDEFINED> instruction: 0xf6000000
   0x75f17f5c:  vadd.i16    d25, d2, d5
   0x75f17f60:  sfmpl   f0, 4, [r11, #468]  ; 0x1d4
   0x75f17f64:  movwhi  r7, #54536  ; 0xd508
   0x75f17f68:  smultteq    r10, r12, r8
   0x75f17f6c:  
    stmda   r12, {r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r12, sp, lr}
   0x75f17f70:  stc 8, cr0, [sp, #-720]!    ; 0xfffffd30
   0x75f17f74:  stmdavs r12, {r0, r1, r7, r10, r11, sp, lr, pc}

Do you want me to compile libjpeg.so? There doesn't seem to be much useful information

ptitSeb commented 3 years ago

No, the stack is already corrupted, so it's useless.

You'll need to start the program with BOX86_LOG=2 to get what calls are used. But that will generate à big log. You can send the log in a single file using BOX86_TRACE_FILE=trace.txt Also, because wine is used, it will start a lot of process, generating more (useless here) log, and also potentially overwriting the log file. You can have different log per process, but then I suggest you use an absolute file path. Use: BOX86_TRACE_FILE=/home/pi/trace-%pid.txt.

Once log is/are generated, find the fisrt occurance of SIGILL, then I need the few function call before that.

Mr-HappyLI commented 3 years ago
2716|0x76117ff0: Calling my_dlopen (7611E430, 00000002, 7FA0D0D8...) =>Call to dlopen("libjpeg.so.62"/0x7611e430, 2)
dlopen: Recycling libjpeg.so.62/0x21 count=14 (dlopened=1, elf_index=-1)
 return 0x00000021
2716|0x76118010: Calling my_dlsym (00000021, 7611E43E, 7FA0D182...) =>Call to dlsym(0x21, "jpeg_CreateCompress")
 return 0x565BB159
2716|0x7611802e: Calling my_dlsym (00000021, 7611E46C, 7FA0D182...) =>Call to dlsym(0x21, "jpeg_CreateDecompress")
 return 0x565BB16A
2716|0x7611804c: Calling my_dlsym (00000021, 7611E482, 7FA0D182...) =>Call to dlsym(0x21, "jpeg_destroy_compress")
 return 0x565BB17B
2716|0x7611806a: Calling my_dlsym (00000021, 7611E498, 7FA0D182...) =>Call to dlsym(0x21, "jpeg_destroy_decompress")
 return 0x565BB18C
2716|0x76118088: Calling my_dlsym (00000021, 7611E4B0, 7FA0D182...) =>Call to dlsym(0x21, "jpeg_finish_compress")
 return 0x565BB19D
2716|0x761180a6: Calling my_dlsym (00000021, 7611E4C5, 7FA0D182...) =>Call to dlsym(0x21, "jpeg_read_header")
 return 0x565BB1AE
2716|0x761180c4: Calling my_dlsym (00000021, 7611E4D6, 7FA0D182...) =>Call to dlsym(0x21, "jpeg_read_scanlines")
 return 0x565BB1BF
2716|0x761180e2: Calling my_dlsym (00000021, 7611E4EA, 7FA0D182...) =>Call to dlsym(0x21, "jpeg_resync_to_restart")
 return 0x54EB8B78
2716|0x76118100: Calling my_dlsym (00000021, 7611E501, 7FA0D182...) =>Call to dlsym(0x21, "jpeg_set_defaults")
 return 0x54EB8B89
2716|0x7611811e: Calling my_dlsym (00000021, 7611E513, 7FA0D182...) =>Call to dlsym(0x21, "jpeg_start_compress")
 return 0x54EB8B9A
2716|0x7611813c: Calling my_dlsym (00000021, 7611E527, 7FA0D182...) =>Call to dlsym(0x21, "jpeg_start_decompress")
 return 0x54EB8BAB
2716|0x7611815a: Calling my_dlsym (00000021, 7611E53D, 7FA0D182...) =>Call to dlsym(0x21, "jpeg_std_error")
 return 0x54EB8BBC
2716|0x76118174: Calling my_dlsym (00000021, 7611E54C, 7FA0D182...) =>Call to dlsym(0x21, "jpeg_write_scanlines")
 return 0x54EB8BCD
2716|0xf6b79e6b: Calling strlen(0x7fa0d028("{00000103-a8f2-4877-ba0a-fd2b6645fb94}")) => return 0x00000026
2716|0xf6b79e98: Calling ???(/lib/arm-linux-gnueabihf/libc.so.6/0xf7098340) (F6BD2C64, 7FA0D028, 00000027...) => return 0xF6BD2C64
2716|0x761175f0: Calling my62_jpeg_std_error (56E5BE50, 00000045, 000000FB...) => return 0x56E5BE50
2716|0x7611761e: Calling my___sigsetjmp (7FA0D144, 00000045, 000000FB...) => return 0x00000000
2716|0x7611763f: Calling jpeg_CreateCompress (56E5BCDC, 0000003E, 00000174...) =>2716|SIGILL @0x76117f58 (???(0x76117f58)) (x86pc=0x565bb164/???:"???", esp=0x7fa0d11c), for accessing 0x76117f58 (code=1), db=(nil)((nil):(nil)/(nil):(nil)/???) opcode=00 00 00 F6 05 98 52 12
Sigactionhanlder for signal #4 called (jump to 0xf6b9ec00/???(0xf6b9ec00))
2716|signal function handler 0xf6b9ec00 called, ESP=0x7ffcfcb0
Run X86 (0x62e9fd58), EIP=0xf6b9ec00, Stack=0xf6237020
Context has been changed in Sigactionhanlder, doing longjmp to resume emu
Setjmp DynaRun, fs=0x3b
2716|0xf6b9c61b: Calling pthread_sigmask (00000000, F6BE4060, 7FA0C800...) => return 0x00000000
2716|0xf6b9c539: Calling writev (00000006, 7FA0C7A0, 00000003...) => return 0x0000005E

Are these?

ptitSeb commented 3 years ago

Yes, exactly!

The issue is with jpeg_CreateCompress that needs wrapped similar to jpeg_CreateDecompress.

I'll work on that.

Mr-HappyLI commented 3 years ago

@ptitSeb Thank you!

ptitSeb commented 3 years ago

Ok, this commit should have improved things (even completly fixed them hopefully).

Mr-HappyLI commented 3 years ago

@ptitSeb

Now,the problem of software crash is solved.But,There are still some problems.

0024:err:jpeg:error_exit_fn JPEG parameter struct mismatch: library thinks size is 376, caller expects 372
0024:fixme:wincodecs:jpeg_decoder_get_metadata_blocks stub
0024:fixme:ole:DefaultHandler_SetContainedObject ()
0024:fixme:ole:DefaultHandler_SetContainedObject ()
0024:fixme:wincodecs:jpeg_decoder_get_metadata_blocks stub
0024:err:jpeg:error_exit_fn JPEG parameter struct mismatch: library thinks size is 376, caller expects 372
ptitSeb commented 3 years ago

Mmm, that's a libjpeg error. It seems I'll have to do even more wrapping unfortunatly.

Mr-HappyLI commented 3 years ago

OK.Do you want me to provide more detailed logs.

ptitSeb commented 3 years ago

No it's ok, I have all I need

Mr-HappyLI commented 3 years ago

@ptitSeb Things got worse.Can you take a look at it for me? Thank you!

0024:fixme:win:UnregisterTouchWindow (00080100): stub
0024:fixme:ole:DefaultHandler_SetContainedObject ()
0024:fixme:ole:DefaultHandler_SetContainedObject ()
Warning: Cannot dlopen("/opt/wine-stable/lib/wine/api-ms-win-core-file-l2-1-1.so"/0x4b4fd1f8, 2)
Warning, invalid jpeg62 structuresize for compress (372/371)9529|SIGSEGV @0x74e18dbe (jpeg_start_compress (/usr/lib/arm-linux-gnueabihf/libjpeg.so.62)) (x86pc=0x4cc485d0/???:"???", esp=0x7fa0bb4c), for accessing 0x10 (code=1/prot=0), db=(nil)((nil):(nil)/(nil):(nil)/???)
Segmentation fault (core dumped)
ptitSeb commented 3 years ago

Should be better now, can you try again?

Mr-HappyLI commented 3 years ago

@ptitSeb There are still problems:

0024:fixme:wincodecs:jpeg_decoder_get_metadata_blocks stub
15907|SIGSEGV @0x74888dbe (jpeg_start_compress (/usr/lib/arm-linux-gnueabihf/libjpeg.so.62)) (x86pc=0x62e7a51d/???:"???", esp=0x7fa1b17c), for accessing 0x10 (code=1/prot=0), db=(nil)((nil):(nil)/(nil):(nil)/???)
ptitSeb commented 3 years ago

I need to create a sample on my side to debug that, or that tha weechat app.

ptitSeb commented 3 years ago

I wrapped a few more stuff, based on a linux sample that does work now. Not sure how it helps Wine (it should). Please try again. If it's still not working, I'll have to try WeeChat on my side (but I'm sure you need some login at stuff to get to the crash).

Mr-HappyLI commented 3 years ago

@ptitSeb Hi.Sorry, there are still some mistakes. Wechat may not be available on your side.I don't know what you can use for debugging. Recently, I am studying video and picture codec in order to write a test program. Here are some logs that might be useful to you.

6795|0x76818174: Calling my_dlsym (00000021, 7681E54C, 7FA0D182...) =>Call to dlsym(0x21, "jpeg_write_scanlines")
 return 0x626B5E7A
6795|0xf6651e6b: Calling strlen(0x7fa0d028("{00000103-a8f2-4877-ba0a-fd2b6645fb94}")) => return 0x00000026
6795|0xf6651e98: Calling ???(/lib/arm-linux-gnueabihf/libc.so.6/0xf6f71340) (F66AAC66, 7FA0D028, 00000027...) => return 0xF66AAC66
6795|0x768175f0: Calling my62_jpeg_std_error (552CFC08, 00000045, 000000FB...) => return 0x552CFC08
6795|0x7681761e: Calling my___sigsetjmp (7FA0D144, 00000045, 000000FB...) => return 0x00000000
6795|0x7681763f: Calling my62_jpeg_CreateCompress (552CFA94, 0000003E, 00000174...) => return 0x552CFA94
6795|0x768184d0: Calling memcmp (76820CDC, 7FA0D1E0, 00000010...) => return 0xFFFFFFFD
6795|0x768184d0: Calling memcmp (76820B4C, 7FA0D1E0, 00000010...) => return 0x0000000D
6795|0x768184d0: Calling memcmp (76820D3C, 7FA0D1E0, 00000010...) => return 0xFFFFFFF9
6795|0xf6674659: Calling pthread_sigmask (00000000, F66BC060, 7FA0CFD0...) => return 0x00000000
6795|0xf6690587: Calling pthread_mutex_lock(0xf66bc024) => return 0x00000000
6795|0xf668e4ba: Calling my_mmap64 (00000000, 00170000, 00000003...) => return 0x529AA000
6795|0xf668e8a5: Calling my_munmap (529AA000, 00006000, 00000000...) => return 0x00000000
6795|0xf668e5d2: Calling my_munmap (52B10000, 0000A000, 00000000...) => return 0x00000000
6795|0xf668dc7e: Calling memset (FFDF29B0, 00000023, 00000160...) => return 0xFFDF29B0
6795|0xf668e0d2: Calling my_mprotect (529B0000, 00160000, 00000007...) => return 0x00000000
6795|0xf667469a: Calling pthread_mutex_unlock (F66BC024, F66BC060, 7FA0CFD0...) => return 0x00000000
6795|0xf66746ac: Calling pthread_sigmask (00000002, 7FA0CFD0, 00000000...) => return 0x00000000
6795|0x76818571: Calling my___sigsetjmp (7FA0D074, 00000000, 7FA0D080...) => return 0x00000000
6795|0x768185b8: Calling memcmp (76820CDC, 54A26640, 00000010...) => return 0x00000000
6795|0x76818600: Calling my62_jpeg_set_defaults (552CFA94, 54A26640, 00000010...) => return 0x00000002
6795|0x768186a4: Calling my62_jpeg_start_compress (552CFA94, 00000001, 00000010...) => return 0xFFFC78F8
6795|0x76818716: Calling my___sigsetjmp (7FA0D074, 00000000, 00000000...) => return 0x00000000
6795|0x768188ed: Calling my_malloc (00000960, 00000000, 00000000...) => return 0x526F59C0
6795|0x7681881c: Calling ???(/lib/arm-linux-gnueabihf/libc.so.6/0xf6f71340) (526F59C0, 529B0020, 00000960...) => return 0x526F59C0
6795|0x768187c4: Calling my62_jpeg_write_scanlines (552CFA94, 7FA0D070, 00000001...) => return 0x00000001
6795|0x76818886: Calling cfree (526F59C0, 7FA0D070, 00000001...) => return 0x00000001
6795|0x76818716: Calling my___sigsetjmp (7FA0D074, 7FA0D070, 00000001...) => return 0x00000000
6795|0x768188ed: Calling my_malloc (00000960, 7FA0D070, 00000001...) => return 0x526F6710
6795|0x7681881c: Calling ???(/lib/arm-linux-gnueabihf/libc.so.6/0xf6f71340) (526F6710, 529B0980, 00000960...) => return 0x526F6710
6795|0x768187c4: Calling my62_jpeg_write_scanlines (552CFA94, 7FA0D070, 00000001...) => return 0x00000001
6795|0x76818886: Calling cfree (526F6710, 7FA0D070, 00000001...) => return 0x00000001
6795|0x76818716: Calling my___sigsetjmp (7FA0D074, 7FA0D070, 00000001...) => return 0x00000000
6795|0x768188ed: Calling my_malloc (00000960, 7FA0D070, 00000001...) => return 0x526F6710
6795|0x7681881c: Calling ???(/lib/arm-linux-gnueabihf/libc.so.6/0xf6f71340) (526F6710, 529B12E0, 00000960...) => return 0x526F6710
6795|0x768187c4: Calling my62_jpeg_write_scanlines (552CFA94, 7FA0D070, 00000001...) => return 0x00000001
6795|0x76818886: Calling cfree (526F6710, 7FA0D070, 00000001...) => return 0x00000001
6795|0x76818716: Calling my___sigsetjmp (7FA0D074, 7FA0D070, 00000001...) => return 0x00000000
6795|0x768188ed: Calling my_malloc (00000960, 7FA0D070, 00000001...) => return 0x526F6710
6795|0x7681881c: Calling ???(/lib/arm-linux-gnueabihf/libc.so.6/0xf6f71340) (526F6710, 529B1C40, 00000960...) => return 0x526F6710
6795|0x768187c4: Calling my62_jpeg_write_scanlines (552CFA94, 7FA0D070, 00000001...) => return 0x00000001
...
6795|0x768187c4: Calling my62_jpeg_write_scanlines (552CFA94, 7FA0D070, 00000001...) => return 0x00000001
6795|0x76818886: Calling cfree (526F6710, 7FA0D070, 00000001...) => return 0x00000001
6795|0x76818716: Calling my___sigsetjmp (7FA0D074, 7FA0D070, 00000001...) => return 0x00000000
6795|0x768188ed: Calling my_malloc (00000960, 7FA0D070, 00000001...) => return 0x526F6710
6795|0x7681881c: Calling ???(/lib/arm-linux-gnueabihf/libc.so.6/0xf6f71340) (526F6710, 529B7A00, 00000960...) => return 0x526F6710
6795|0x768187c4: Calling my62_jpeg_write_scanlines (552CFA94, 7FA0D070, 00000001...) => return 0x00000001
6795|0x76818886: Calling cfree (526F6710, 7FA0D070, 00000001...) => return 0x00000001
6795|0x76818716: Calling my___sigsetjmp (7FA0D074, 7FA0D070, 00000001...) => return 0x00000000
6795|0x768188ed: Calling my_malloc (00000960, 7FA0D070, 00000001...) => return 0x526F6710
6795|0x7681881c: Calling ???(/lib/arm-linux-gnueabihf/libc.so.6/0xf6f71340) (526F6710, 529B8360, 00000960...) => return 0x526F6710
6795|0x768187c4: Calling my62_jpeg_write_scanlines (552CFA94, 7FA0D070, 00000001...) => return 0x00000001
6795|0x76818886: Calling cfree (526F6710, 7FA0D070, 00000001...) => return 0x00000001
6795|0x76818716: Calling my___sigsetjmp (7FA0D074, 7FA0D070, 00000001...) => return 0x00000000
6795|0x768188ed: Calling my_malloc (00000960, 7FA0D070, 00000001...) => return 0x526F6710
6795|0x7681881c: Calling ???(/lib/arm-linux-gnueabihf/libc.so.6/0xf6f71340) (526F6710, 529B8CC0, 00000960...) => return 0x526F6710
6795|0x768187c4: Calling my62_jpeg_write_scanlines (552CFA94, 7FA0D070, 00000001...) =>Run X86 (0x631d9048), EIP=0x807b817d, Stack=0xf5d0f020
6795|SIGSEGV @0x628d68f4 (???(/home/greatwall/BOX86_SRC/box86/build/box86/0x628d68f4)) (x86pc=0x807b817d/???:"???", esp=0x7fa0cf8c), for accessing 0x807b817d (code=2/prot=0), d       b=(nil)((nil):(nil)/(nil):(nil)/???)
Sigactionhanlder for signal #11 called (jump to 0xf6676c00/???(0xf6676c00))
6795|signal function handler 0xf6676c00 called, ESP=0x7ffcfcb0
....
8327|0xf678c632: Calling pthread_sigmask (00000002, E1BEFDE0, 00000000...) => return 0x00000000
8327|SIGSEGV @(nil) (???((nil))) (x86pc=0x7bc58353/???:"???", esp=0xe1beff6c), for accessing (nil) (code=1/prot=0), db=(nil)((nil):(nil)/(nil):(nil)/???)
Sigactionhanlder for signal #11 called (jump to 0xf678ec00/???(0xf678ec00))
8327|signal function handler 0xf678ec00 called, ESP=0xe354f270
ptitSeb commented 3 years ago

Mmm, that's something different now. I think I have an issue with Virtual memory management with Wine, but I'm still unsure. Can you do addr2line -e /home/greatwall/BOX86_SRC/box86/build/box86 -a 0x628d68f4

Mr-HappyLI commented 3 years ago

OK. addr2line -e /home/greatwall/BOX86_SRC/box86/build/box86 -a 0x628d68f4 0x628d68f4 /home/greatwall/BOX86_SRC/box86/src/emu/x86run.c:192

PeterPablo commented 3 years ago

@ptitSeb, I just took a random look at one of your commits, relating to this issue. Could it be that c should actually read C here?

ptitSeb commented 3 years ago

Yes, it's a typo, but it's harmless in that case.

Is WeeChat still crashing on your side (as I fixed a few things in box86 since that last message)

Mr-HappyLI commented 3 years ago

@ptitSeb Recently, you have changed too many things, some software has become very unstable, I am looking at the problem. In addition, in the previous test, the problem is still there, but I did not test the latest version. Do you know Apple MAC M1 and rosetta? I'm testing the performance of some software.I have to say, it runs smoothly.

ptitSeb commented 3 years ago

Yes, I have made some changes, mainly around x86 Flags handling. I haven't notice regression, but if you have a particular software that have one, please tell me so I can analyse the issue.

The objective of the last changes was to improve the performances. After that I have made some more structural changes around memory management, to improve stability, epecialy when handling signals. Again, I haven't found any regression, but maybe there are some.

Yes, I heard of MAC M1 and Rosetta2. The M1 chip seems very powerfull and Rosetta2 quite good too. But I don't own one.

Mr-HappyLI commented 3 years ago

@ptitSeb Do you know Counter Strike (CS1.6) ,VLC and WeChat?They will burst when used.

ptitSeb commented 3 years ago

And they were working before?

ptitSeb commented 3 years ago

The WeChat issue with pictures should be fixed. Can you update box86 and try again?