wang-bin / fvp

Flutter video player plugin for all desktop+mobile platforms. download prebuilt examples from github actions. https://pub.dev/packages/fvp
BSD 3-Clause "New" or "Revised" License
197 stars 31 forks source link

Debug模式没问题,真机Release模式崩溃,mdk.demux@0x16aef3000 (37): EXC_BREAKPOINT (code=1, subcode=0x1ae529df0) #91

Closed yemin82 closed 1 week ago

yemin82 commented 6 months ago
0.27.0 (git b1028bf) - Multimedia Development Kit. Copyright (c) 2016-2024 WangBin(QtAV author) <wbsecg1 at gmail.com>
Build for: iOS80000/17.4.0 ARMv8 AArch64; AppleClang15.0.0 (clang-1500.3.9.4)GCC4.2.1; libc++170006; 08:50:06 May 20 2024
flutter: fvp.FINE: 07:58:56.404: registerVideoPlayerPlatformsWith: null
flutter: mdk.INFO: 07:58:56.410: 0.27.0 (git b1028bf) - Multimedia Development Kit. Copyright (c) 2016-2024 WangBin(QtAV author) <wbsecg1 at gmail.com>
Build for: iOS80000/17.4.0 ARMv8 AArch64; AppleClang15.0.0 (clang-1500.3.9.4)GCC4.2.1; libc++170006; 08:50:06 May 20 2024
flutter: mdk.INFO: 07:58:56.410: global option: d3d11.sync.cpu = 1
flutter: fvp.FINE: 07:59:05.874: 348252135 player4399227712 create(https://leshiyuncdn.36s.top/20240523/EcssfmC5/2000kb/hls/index.m3u8)
flutter: mdk.INFO: 07:59:05.887: default 0x1063a8320 new FrameReader...
flutter: mdk.INFO: 07:59:05.887: Registered audio backends: AudioQueue OpenAL null
flutter: mdk.INFO: 07:59:05.887: default 0x1063a8990 new FrameReader...
flutter: mdk.INFO: 07:59:05.887: Registered audio backends: AudioQueue OpenAL null
flutter: mdk.INFO: 07:59:05.887: 0x10636e570 mdk::Player::Player()
flutter: mdk.INFO: 07:59:05.887: player property: video.decoder = shader_resource=0
flutter: mdk.INFO: 07:59:05.887: player property: avformat.strict = experimental
flutter: mdk.INFO: 07:59:05.887: player property: avio.protocol_whitelist = file,rtmp,http,https,tls,rtp,tcp,udp,crypto,httpproxy,data,concatf,concat,subfile
flutter: mdk.INFO: 07:59:05.888: player property: avformat.rtsp_transport = tcp
flutter: mdk.INFO: 07:59:05.888: video decoders: "VT", "FFmpeg"
flutter: mdk.INFO: 07:59:05.888: video decoders: "VT", "FFmpeg"
flutter: mdk.INFO: 07:59:05.888: default FrameReader0x1063a8320 state: 0=>0=>0, 0
flutter: mdk.INFO: 07:59:05.888: default0x1063a8320 virtual void mdk::FrameReader::stop(), current state: 0
flutter: mdk.INFO: 07:59:05.888: default FrameReader0x1063a8320 state: 0=>0=>0, 0
flutter: mdk.INFO: 07:59:05.888: default0x1063a8320 virtual void mdk::FrameReader::stop(), current state: 0
flutter: mdk.INFO: 07:59:05.888: AudioQueueStart ERROR: 0
flutter: mdk.INFO: 07:59:05.888: 0x109a54800 MediaControl.prepare(0, ...) https://leshiyuncdn.36s.top/20240523/EcssfmC5/2000kb/hls/index.m3u8
flutter: mdk.INFO: 07:59:05.888: default 0x1063a8320 FrameReader.start(0, ...)
flutter: mdk.INFO: 07:59:05.888: default 0x1063a8320 FrameReader::update MediaStatus 0=>0X2
flutter: fvp.FINE: 07:59:05.888: 973988420 player4399227712 onMediaStatus: MediaStatus(noMedia) => MediaStatus(+loading)
flutter: mdk.INFO: 07:59:05.889: default FrameReader0x1063a8320 state: 0=>0=>1, 0
flutter: mdk.INFO: 07:59:05.889: default FrameReader0x1063a8320 state: 0=>1=>1, 0
flutter: mdk.INFO: 07:59:05.889: default FrameReader0x1063a8320 request to pause 1, loaded: 0.
flutter: mdk.INFO: 07:59:05.889: default FrameReader0x1063a8320 state: 0=>1=>2, 0
flutter: mdk.INFO: 07:59:05.889: default FrameReader0x1063a8320 state requested: 2, current: 0
flutter: mdk.INFO: 07:59:05.889: virtual void mdk::AudioBackendAudioQueue::pause(bool)138 ERROR>>> AudioQueuePause(queue_): -50
flutter: mdk.INFO: 07:59:05.889:
flutter: mdk.INFO: 07:59:05.889: start frame reader thread: 0x16aef3000
flutter: mdk.INFO: 07:59:05.889: FFmpeg/Libav runtime git-2024-05-11-0d95918-avbuild
flutter: mdk.INFO: 07:59:05.889: Selected avutil runtime version: 59.17.100 (build: 59.17.100), license: LGPL version 2.1 or later
flutter: mdk.INFO: 07:59:05.889: Selected avutil runtime configuration: --extra-version=avbuild --disable-doc --disable-debug --enable-shared --enable-runtime-cpudetect --disable-iamf --disable-programs --disable-vulkan --disable-avdevice --enable-libxml2 --disable-postproc --install_name_dir='@rpath' --enable-cross-compile --arch=arm64 --target-os=darwin --cc=clang --sysroot=/Applications/Xcode_15.2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.2.sdk --enable-lto --enable-pic --extra-cflags='-I=/usr/include/libxml2 -arch arm64 -miphoneos-version-min=8.0' --extra-ldflags='-arch arm64 -miphoneos-version-min=8.0 -Wl,-dead_strip' --enable-small --disable-outdevs --disable-filters --disable-muxers --disable-encoders --disable-decoders --disable-demuxers --disable-protocols --enable-wolfssl --disable-avdevice --enable-decoder='*sub*,movtext,*web*,aac*,ac3*,eac3*,alac*,ape,ass,ccaption,cfhd,cook,dca,dnxhd,exr,truehd,*yuv*,flv,flac,gif,h26[3-4]*,hevc*,hap,mp[1-3]*,prores,*[mj]peg*,mlp,mpl2,nellymoser,opus,pcm*,qtrle,*png*,tiff,rawvideo,rv*,sami,srt,ssa,v210*,vc1*,vorbis,vp[6-9]*,wm*,wrapped_avframe' --enable-demuxer='*sub*,*ac3,*ac,*[mj]peg*,*web*,au,ape,ass,avi,concat,dnxhd,dts*,*dash*,*flv,gif,hls,h264,hevc,kux,matroska,mov,mp3,mxf,ogg,pcm*,rawvideo,rt*p,spdif,srt,vc1,v210*,wav,*pipe,image2' --enable-encoder='aac,gif,h26[3-4]*,av1*,hevc*,mjpeg*,*png,opus,pcm*,prores*,rawvideo,spdif,speedhq,*jpeg,*png,vp[8-9]*,wrapped_avframe' --enable-muxer='*jpeg,fifo,flv,gif,hls,h264,hevc,image2,mov,mp4,mpegts,matroska,null,pcm*,rawvideo,spdif,*pipe,*segment,webm,wav' --enable-filter='*null*,afade,*fifo,*format,*resample,aeval,atempo,pan,crop,eq*,framerate,hw*,scale,volume' --enable-protocol='cache,concat*,crypto*,data,fd,*file,ftp,h*,i*,pipe,rt*,s*,t*,u*'
flutter: mdk.INFO: 07:59:05.890: global option: ffmpeg.configuration = --extra-version=avbuild --disable-doc --disable-debug --enable-shared --enable-runtime-cpudetect --disable-iamf --disable-programs --disable-vulkan --disable-avdevice --enable-libxml2 --disable-postproc --install_name_dir='@rpath' --enable-cross-compile --arch=arm64 --target-os=darwin --cc=clang --sysroot=/Applications/Xcode_15.2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.2.sdk --enable-lto --enable-pic --extra-cflags='-I=/usr/include/libxml2 -arch arm64 -miphoneos-version-min=8.0' --extra-ldflags='-arch arm64 -miphoneos-version-min=8.0 -Wl,-dead_strip' --enable-small --disable-outdevs --disable-filters --disable-muxers --disable-encoders --disable-decoders --disable-demuxers --disable-protocols --enable-wolfssl --disable-avdevice --enable-decoder='*sub*,movtext,*web*,aac*,ac3*,eac3*,alac*,ape,ass,ccaption,cfhd,cook,dca,dnxhd,exr,truehd,*yuv*,flv,flac,gif,h26[3-4]*,hevc*,hap,mp[1-3]*,prores,*[mj]peg*,mlp,mpl2,nellymoser,opus,pcm*,qtrle,*png*,tiff,rawvideo,rv*,sami,srt,ssa,v210*,vc1*,vorbis,vp[6-9]*,wm*,wrapped_avframe' --enable-demuxer='*sub*,*ac3,*ac,*[mj]peg*,*web*,au,ape,ass,avi,concat,dnxhd,dts*,*dash*,*flv,gif,hls,h264,hevc,kux,matroska,mov,mp3,mxf,ogg,pcm*,rawvideo,rt*p,spdif,srt,vc1,v210*,wav,*pipe,image2' --enable-encoder='aac,gif,h26[3-4]*,av1*,hevc*,mjpeg*,*png,opus,pcm*,prores*,rawvideo,spdif,speedhq,*jpeg,*png,vp[8-9]*,wrapped_avframe' --enable-muxer='*jpeg,fifo,flv,gif,hls,h264,hevc,image2,mov,mp4,mpegts,matroska,null,pcm*,rawvideo,spdif,*pipe,*segment,webm,wav' --enable-filter='*null*,afade,*fifo,*format,*resample,aeval,atempo,pan,crop,eq*,framerate,hw*,scale,volume' --enable-protocol='cache,concat*,crypto*,data,fd,*file,ftp,h*,i*,pipe,rt*,s*,t*,u*'
flutter: mdk.INFO: 07:59:05.890: global option: ffmpeg.version = 7
flutter: mdk.INFO: 07:59:05.890: av_dict_set0x106933e20
flutter: mdk.WARNING: 07:59:05.890: Failed to create io for url. io: 0x0, open: 0
flutter: mdk.INFO: 07:59:05.890: Selected avformat runtime version: 61.3.103 (build: 61.3.103), license: LGPL version 2.1 or later
flutter: mdk.INFO: 07:59:05.890: av_muxer_iterate0x1065dcc14
flutter: mdk.INFO: 07:59:05.890: Selected avcodec runtime version: 61.5.103 (build: 61.5.103), license: LGPL version 2.1 or later
flutter: mdk.INFO: 07:59:05.890: avcodec_descriptor_next0x1067174bc
flutter: mdk.INFO: 07:59:05.890: default 0x1063a8320 FrameReader::update MediaStatus 0X2=>0X2
flutter: mdk.INFO: 07:59:05.890: before avformat_open_input. io: 0x0()/pb: 0x0, url: https://leshiyuncdn.36s.top/20240523/EcssfmC5/2000kb/hls/index.m3u8
flutter: mdk.INFO: 07:59:05.890: FFmpeg/Libav runtime git-2024-05-11-0d95918-avbuild
flutter: mdk.INFO: 07:59:05.968: [FFmpeg:hls] Skip ('#EXT-X-VERSION:3')
flutter: mdk.INFO: 07:59:05.982: [FFmpeg:hls] Skip ('#EXT-X-DISCONTINUITY')
flutter: mdk.INFO: 07:59:05.982: [FFmpeg:hls] Skip ('#EXT-X-DISCONTINUITY')
flutter: mdk.INFO: 07:59:05.983: [FFmpeg:hls] Opening 'https://tscdn.tdweilai.top/20240523/EcssfmC5/2000kb/hls/X6IO4fUg.ts' for reading

xcode到这里就卡住了,mdk.demux@0x16aef3000 (37): EXC_BREAKPOINT (code=1, subcode=0x1ae529df0) 如果不是用xcode点run,这里就崩溃闪退了

wang-bin commented 6 months ago

真机测了,没发复现。

yemin82 commented 6 months ago

我这里100%复现, 要真机release模式,iphonese2/ipadair5 ,ios17.4 2个设备都一样

wang-bin commented 6 months ago

我iphone xr(ios 16)、ipad mini5(17.5)上测了都没问题。我是 xcode->Product->Scheme->Edit Scheme->Run->Build Configuration设置为Release 编译运行的

yemin82 commented 6 months ago

我iphone xr(ios 16)、ipad mini5(17.5)上测了都没问题。我是 xcode->Product->Scheme->Edit Scheme->Run->Build Configuration设置为Release 编译运行的

我也是这样操作的,https://leshiyuncdn.36s.top/20240523/EcssfmC5/2000kb/hls/index.m3u8就是这个视频,100%崩溃。。debug没问题,好奇怪,不过debug播放也很卡

wang-bin commented 6 months ago

xcode里的崩溃详细信息截图一下

yemin82 commented 6 months ago
截屏2024-05-25 21 45 41
yemin82 commented 6 months ago
截屏2024-05-25 21 47 40
yemin82 commented 6 months ago

mdk.vdec0@0x70001160d000 (72): EXC_BAD_ACCESS (code=1, address=0x0) 又发现新的崩溃情况,概率相当大,视频页返回上一页的时候。

wang-bin commented 6 months ago

你试下这个例子能不能复现 https://github.com/wang-bin/mdk-examples/tree/master/flutter%2Fsimple

我应这个测的

yemin82 commented 6 months ago

mdk.demux@0x16b797000 (32): EXC_BREAKPOINT (code=1, subcode=0x1ae529df0) 用这个例子一样的崩溃

yemin82 commented 6 months ago

6101716713731_ pic 有时候可以看到第一帧,有时候直接不显示了

yemin82 commented 6 months ago

6111716713792_ pic

wang-bin commented 5 months ago

EXC_BREAKPOINT看名字是设了断点的意思, 根据文档 https://developer.apple.com/documentation/xcode/sigtrap_sigill 判断是非法指令,根据你截图里的__chk_fail_overflow判断是buffer overflow。感觉得搞个debug版本的ffmpeg看看。你先点击 截图里的av_read_frame 再截图看看

xcode是什么版本?

yemin82 commented 5 months ago

xcode 15.2

yemin82 commented 5 months ago

6121716807590_ pic 这个是真机的debug也是有问题,模拟器没问题,但是卡的很

yemin82 commented 5 months ago
0x102263260 <+3532>: add    x1, x1, #0xb2f            ; "avformat_open_input"
    0x102263264 <+3536>: bl     0x1021dda1c               ; std::__1::basic_ostream<char, std::__1::char_traits<char>>& std::__1::operator<<[abi:un170006]<std::__1::char_traits<char>>(std::__1::basic_ostream<char, std::__1::char_traits<char>>&, char const*) at ostream:908
    0x102263268 <+3540>: bl     0x102604188               ; _OUTLINED_FUNCTION_2689
    0x10226326c <+3544>: bl     0x1021dabd4               ; std::__1::endl[abi:un170006]<char, std::__1::char_traits<char>> at ostream:1045
    0x102263270 <+3548>: ldr    x8, [x24]
    0x102263274 <+3552>: sub    x3, x29, #0x90
    0x102263278 <+3556>: mov    x0, x20
    0x10226327c <+3560>: bl     0x1025fcd24               ; _OUTLINED_FUNCTION_1504
    0x102263280 <+3564>: blr    x8
->  0x102263284 <+3568>: mov    x26, x27
    0x102263288 <+3572>: tbnz   w0, #0x1f, 0x1022632c0    ; <+3628> [inlined] mdk::abi::FFmpegPacketIO::openInput() + 840 at FFmpegPacketIO.cpp
    0x10226328c <+3576>: ldr    x22, [x20]
    0x102263290 <+3580>: ldr    x19, [x22, #0x20]
    0x102263294 <+3584>: ldr    x23, [x22, #0x8]
    0x102263298 <+3588>: bl     0x102254848               ; ffmpeg::runtime::version at AVRuntime.cpp:58
    0x10226329c <+3592>: cmp    w0, #0x6
    0x1022632a0 <+3596>: b.eq   0x1022632e4               ; <+3664> [inlined] mdk::abi::FFmpegPacketIO::openInput() + 876 at FFmpegPacketIO.cpp
    0x1022632a4 <+3600>: cmp    w0, #0x5
    0x1022632a8 <+3604>: b.eq   0x1022632e4               ; <+3664> [inlined] mdk::abi::FFmpegPacketIO::openInput() + 876 at FFmpegPacketIO.cpp
    0x1022632ac <+3608>: mov    x27, x26
    0x1022632b0 <+3612>: cmp    w0, #0x4
    0x1022632b4 <+3616>: b.ne   0x10226338c               ; <+3832> [inlined] auto mdk::abi::FFmpegPacketIO::openInput()::$_5::operator()<AVFormatContext*>(AVFormatContext*) const at FFmpegPacketIO.cpp:377:152
    0x1022632b8 <+3620>: add    x8, x22, #0x460
    0x1022632bc <+3624>: b      0x102263390               ; <+3836> [inlined] mdk::abi::FFmpegPacketIO::openInput() + 1048 at FFmpegPacketIO.cpp:377:175
    0x1022632c0 <+3628>: mov    x3, x0
    0x1022632c4 <+3632>: adrp   x0, 1252
    0x1022632c8 <+3636>: add    x0, x0, #0x2f1            ; "avrt::avformat_open_input(&fmtctx_, ffmpeg::from_file_uri(in.c_str()), fmt, &dict)"
    0x1022632cc <+3640>: adrp   x1, 1252
    0x1022632d0 <+3644>: add    x1, x1, #0x218            ; "/Users/runner/work/mdk-sdk/mdk-sdk/mdk/ffmpeg/plugin/FFmpegPacketIO.cpp"
    0x1022632d4 <+3648>: mov    w2, #0x176
    0x1022632d8 <+3652>: bl     0x1022541bc               ; ffmpeg_error_log at AVCompat.cpp:38
    0x1022632dc <+3656>: mov    w19, #0x0
    0x1022632e0 <+3660>: b      0x102263478               ; <+4068> [inlined] mdk::abi::FFmpegPacketIO::openInput()::$_16::operator()() const at FFmpegPacketIO.cpp:328:48
    0x1022632e4 <+3664>: mov    x27, x26
    0x1022632e8 <+3668>: add    x8, x22, #0x60
    0x1022632ec <+3672>: b      0x102263390               ; <+3836> [inlined] mdk::abi::FFmpegPacketIO::openInput() + 1048 at FFmpegPacketIO.cpp:377:175
    0x1022632f0 <+3676>: adrp   x0, 1252
    0x1022632f4 <+3680>: add    x0, x0, #0x295            ; "Unknown input format: "
    0x1022632f8 <+3684>: bl     0x10262a94c               ; _OUTLINED_FUNCTION_11062
    0x1022632fc <+3688>: adrp   x23, 1449
    0x102263300 <+3692>: ldr    x23, [x23, #0x48]
    0x102263304 <+3696>: sub    x1, x29, #0x70
wang-bin commented 5 months ago

你点到ffmpeg的函数再截图,也就是最靠近__chk_fail_overflow的那个,比如av_read_frame, avformat_open_input

yemin82 commented 5 months ago

这次没看见,就是open_input报错了

wang-bin commented 5 months ago

我这边还是没复现,用fvp/example的例子,还把例子里列表视频个数增加了。我编译了带ffmpeg调试符号的mdk.xcframework.tar.gz,你方便的话可以测下崩溃在ffmpeg的什么地方。解压后直接替换 ios/Pods/mdk/mdk-sdk/lib/mdk.xcframework

yemin82 commented 5 months ago

mdk`tls_open: 0x1060aba18 <+0>: sub sp, sp, #0xa0 0x1060aba1c <+4>: stp x22, x21, [sp, #0x70] 0x1060aba20 <+8>: stp x20, x19, [sp, #0x80] 0x1060aba24 <+12>: stp x29, x30, [sp, #0x90] 0x1060aba28 <+16>: mov x2, x1 0x1060aba2c <+20>: mov x19, x0 0x1060aba30 <+24>: adrp x8, 1625 0x1060aba34 <+28>: ldr x8, [x8, #0x98] 0x1060aba38 <+32>: ldr x8, [x8] 0x1060aba3c <+36>: str x8, [sp, #0x68] 0x1060aba40 <+40>: ldr x22, [x0, #0x10] 0x1060aba44 <+44>: add x0, x22, #0x8 0x1060aba48 <+48>: mov x1, x19 0x1060aba4c <+52>: bl 0x1060ab6b4 ; ff_tls_open_underlying at tls.c:68 0x1060aba50 <+56>: tbnz w0, #0x1f, 0x1060abb40 ; <+296> at tls_wolfssl.c 0x1060aba54 <+60>: bl 0x1060eea98 ; wolfSSLv23_client_method 0x1060aba58 <+64>: bl 0x1060ea9f4 ; wolfSSL_CTX_new 0x1060aba5c <+68>: str x0, [x22, #0x118] 0x1060aba60 <+72>: ldr w8, [x22, #0x10] 0x1060aba64 <+76>: cmp w8, #0x0 0x1060aba68 <+80>: mov w8, #0x3 0x1060aba6c <+84>: csel w1, wzr, w8, eq 0x1060aba70 <+88>: mov x2, #0x0 0x1060aba74 <+92>: bl 0x1060ee054 ; wolfSSL_CTX_set_verify 0x1060aba78 <+96>: ldr w8, [x22, #0x28] 0x1060aba7c <+100>: cbnz w8, 0x1060abae4 ; <+204> at tls_wolfssl.c:164:30 0x1060aba80 <+104>: ldr w8, [x22, #0x108] 0x1060aba84 <+108>: cbnz w8, 0x1060abae4 ; <+204> at tls_wolfssl.c:164:30 0x1060aba88 <+112>: ldr x20, [x22, #0x118] 0x1060aba8c <+116>: ldr x21, [x22, #0x30] 0x1060aba90 <+120>: mov x0, x21 0x1060aba94 <+124>: bl 0x10654a304 ; symbol stub for: strlen 0x1060aba98 <+128>: and w3, w0, #0xffff 0x1060aba9c <+132>: mov x0, x20 0x1060abaa0 <+136>: mov w1, #0x0 0x1060abaa4 <+140>: mov x2, x21 0x1060abaa8 <+144>: bl 0x1060ebd3c ; wolfSSL_CTX_UseSNI 0x1060abaac <+148>: cbnz w0, 0x1060abae4 ; <+204> at tls_wolfssl.c:164:30 0x1060abab0 <+152>: ldr x21, [x22, #0x30] 0x1060abab4 <+156>: ldr x0, [x22, #0x120] 0x1060abab8 <+160>: bl 0x1060abd90 ; _OUTLINED_FUNCTION_1 at tls_wolfssl.c 0x1060ababc <+164>: mov x20, x0 0x1060abac0 <+168>: ldr x0, [x22, #0x120] 0x1060abac4 <+172>: bl 0x1060abd90 ; _OUTLINED_FUNCTION_1 at tls_wolfssl.c 0x1060abac8 <+176>: bl 0x1060abd84 ; _OUTLINED_FUNCTION_0 at tls_wolfssl.c 0x1060abacc <+180>: stp x20, x0, [sp, #0x8] 0x1060abad0 <+184>: str x21, [sp] 0x1060abad4 <+188>: adrp x2, 1428 0x1060abad8 <+192>: add x2, x2, #0xbcd ; "failed to configure server name indication (SNI) %s: %d -> %s\n" 0x1060abadc <+196>: mov x0, x19 0x1060abae0 <+200>: bl 0x1060abdac ; _OUTLINED_FUNCTION_4 at tls_wolfssl.c 0x1060abae4 <+204>: ldr x0, [x22, #0x118] 0x1060abae8 <+208>: adrp x1, 0 0x1060abaec <+212>: add x1, x1, #0xc90 ; wolfssl_recv_callback at tls_wolfssl.c:90 0x1060abaf0 <+216>: bl 0x1060e9808 ; wolfSSL_CTX_SetIORecv 0x1060abaf4 <+220>: ldr x0, [x22, #0x118] 0x1060abaf8 <+224>: adrp x1, 0 0x1060abafc <+228>: add x1, x1, #0xcc8 ; wolfssl_send_callback at tls_wolfssl.c:102 0x1060abb00 <+232>: bl 0x1060e9814 ; wolfSSL_CTX_SetIOSend 0x1060abb04 <+236>: ldr x0, [x22, #0x118] 0x1060abb08 <+240>: bl 0x1060eaa68 ; wolfSSL_new 0x1060abb0c <+244>: str x0, [x22, #0x120] 0x1060abb10 <+248>: cbz x0, 0x1060abb48 ; <+304> at tls_wolfssl.c 0x1060abb14 <+252>: ldr x1, [x22, #0x110] 0x1060abb18 <+256>: bl 0x1060e9838 ; wolfSSL_SetIOReadCtx 0x1060abb1c <+260>: ldr x0, [x22, #0x120] 0x1060abb20 <+264>: ldr x1, [x22, #0x110] 0x1060abb24 <+268>: bl 0x1060e9844 ; wolfSSL_SetIOWriteCtx 0x1060abb28 <+272>: ldr x0, [x22, #0x120] 0x1060abb2c <+276>: bl 0x1060eb2a0 ; wolfSSL_connect -> 0x1060abb30 <+280>: cbz w0, 0x1060abb60 ; <+328> at tls_wolfssl.c:181:9 0x1060abb34 <+284>: tbnz w0, #0x1f, 0x1060abbac ; <+404> at tls_wolfssl.c:185:42 0x1060abb38 <+288>: mov w20, #0x0 0x1060abb3c <+292>: b 0x1060abb7c ; <+356> at tls_wolfssl.c 0x1060abb40 <+296>: mov x20, x0 0x1060abb44 <+300>: b 0x1060abb74 ; <+348> at tls_wolfssl.c:191:5 0x1060abb48 <+304>: bl 0x1060abd90 ; _OUTLINED_FUNCTION_1 at tls_wolfssl.c 0x1060abb4c <+308>: bl 0x1060abd84 ; _OUTLINED_FUNCTION_0 at tls_wolfssl.c 0x1060abb50 <+312>: str x0, [sp] 0x1060abb54 <+316>: adrp x2, 1401 0x1060abb58 <+320>: add x2, x2, #0xcd7 ; "%s\n" 0x1060abb5c <+324>: b 0x1060abb68 ; <+336> at tls_wolfssl.c 0x1060abb60 <+328>: adrp x2, 1428 0x1060abb64 <+332>: add x2, x2, #0xc0c ; "Unable to negotiate TLS/SSL session\n" 0x1060abb68 <+336>: mov x0, x19 0x1060abb6c <+340>: bl 0x1060abdac ; _OUTLINED_FUNCTION_4 at tls_wolfssl.c 0x1060abb70 <+344>: mov w20, #-0x5 0x1060abb74 <+348>: mov x0, x19 0x1060abb78 <+352>: bl 0x1060abc40 ; tls_close at tls_wolfssl.c:75 0x1060abb7c <+356>: ldr x8, [sp, #0x68] 0x1060abb80 <+360>: adrp x9, 1625 0x1060abb84 <+364>: ldr x9, [x9, #0x98] 0x1060abb88 <+368>: ldr x9, [x9] 0x1060abb8c <+372>: cmp x9, x8 0x1060abb90 <+376>: b.ne 0x1060abbbc ; <+420> at tls_wolfssl.c 0x1060abb94 <+380>: mov x0, x20 0x1060abb98 <+384>: ldp x29, x30, [sp, #0x90] 0x1060abb9c <+388>: ldp x20, x19, [sp, #0x80] 0x1060abba0 <+392>: ldp x22, x21, [sp, #0x70] 0x1060abba4 <+396>: add sp, sp, #0xa0 0x1060abba8 <+400>: ret
0x1060abbac <+404>: ldr x1, [x22, #0x120] 0x1060abbb0 <+408>: mov x0, x19 0x1060abbb4 <+412>: bl 0x1060abd00 ; print_tls_error at tls_wolfssl.c:68 0x1060abbb8 <+416>: b 0x1060abb70 ; <+344> at tls_wolfssl.c 0x1060abbbc <+420>: bl 0x106549a40 ; symbol stub for: __stack_chk_fail

yemin82 commented 5 months ago

0x1060abb30 <+280>: cbz w0, 0x1060abb60 ; <+328> at tls_wolfssl.c:181:9 这个位置卡住

yemin82 commented 5 months ago

https://tscdn.tdweilai.top/20240523/EcssfmC5/2000kb/hls/X6IO4fUg.ts 读取这个ts的时候

yemin82 commented 5 months ago

是不是https证书过期了或没有https证书导致无法读取文件了

yemin82 commented 5 months ago

// 忽略SSL证书验证 curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, false); curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, false);

wang-bin commented 5 months ago

你直接截图。ffmpeg里没用curl

yemin82 commented 5 months ago

image

yemin82 commented 5 months ago

我试了下确实https问题,我直接播放ts把https改成http就可以了,用https就崩溃

wang-bin commented 5 months ago

我把ssl依赖库升级了下到最新稳定版,加了调试符号,你试试 mdk.xcframework.tar.gz

如果奔溃的话点击最靠近__chk_fail_overflow的wolfSSL_connect截图看看

yemin82 commented 5 months ago

libsystem_c.dylib`: 0x1ae529dd8 <+0>: pacibsp 0x1ae529ddc <+4>: stp x29, x30, [sp, #-0x10]! 0x1ae529de0 <+8>: mov x29, sp 0x1ae529de4 <+12>: adrp x0, 9 0x1ae529de8 <+16>: add x0, x0, #0xbb9 ; "detected buffer overflow" 0x1ae529dec <+20>: bl 0x1ae52a7ec ; _os_crash -> 0x1ae529df0 <+24>: brk #0x1

这个地方不用截图就这么点

wang-bin commented 5 months ago

这是哪个函数?你还是截图吧

wang-bin commented 5 months ago

截图可能可以判断其他信息

yemin82 commented 5 months ago

image

yemin82 commented 5 months ago

image

wang-bin commented 5 months ago

RsaFunctionSync, wc_RsaFunctionSync点击截图看看。chk_fail_overflow和memset_chk是编译器插的代码,不用看

yemin82 commented 5 months ago

image

yemin82 commented 5 months ago

image

yemin82 commented 5 months ago

image

wang-bin commented 5 months ago

xcode底部应该有个(lldb)的输入区域,你输入 bt all然后把tls_open开始到最顶上的复制到这里看看。

这个感觉是wolfssl已知问题,感觉他们开发者自己也没法复现,我只能按那个issue里的方法编译试试,可以不崩溃但是会有其他错误 https://github.com/wolfSSL/wolfssl/issues/6524

wang-bin commented 5 months ago

mdk.xcframework.tar.gz

这个是按那个issue里的编译方式编的,说是不会崩溃

yemin82 commented 5 months ago

现在之前那个资源人家已经把https证书续上了,所以暂时没办法测试了,我留意下看看能不能找到非https资源或证书过期的再测试,我网上搜了下wolfssl也是可以跳过验证的: 在wolfSSL中,如果你想要跳过证书验证,你可以使用wolfSSL_SetTLSv12函数,并设置WOLFSSL_ALLOW_SVR_EMPTY_CA_LIST标志。这样做将允许客户端接受一个空的CA列表,并允许服务器在没有提供任何证书的情况下进行握手。

以下是一个简单的示例代码,展示如何设置wolfSSL以跳过验证:

include <wolfssl/options.h>

include <wolfssl/wolfcrypt/types.h>

// 在调用任何wolfSSL函数之前调用此函数 void skip_cert_verification() { wolfSSL_SetTLSv12(true);

ifdef WOLFSSL_ALLOW_SVR_EMPTY_CA_LIST

wolfSSL_SetAllowSVCEmpty(true);

endif

}

// 你的其他wolfSSL初始化和使用代码

yemin82 commented 5 months ago

我没有用你新编译的framwork,用我自己的服务器测试了下 1.如果不配置https确用https访问,结果不崩溃,但是无法播放 2.如果配置一个和域名不匹配的证书,可以正常播放 3.如果配置一个过期的证书,刚好手上有过期证书和对应域名,可以正常播放

这个崩溃场景目前无法测试了。。。后面再留意下吧