Closed yemin82 closed 1 week ago
真机测了,没发复现。
我这里100%复现, 要真机release模式,iphonese2/ipadair5 ,ios17.4 2个设备都一样
我iphone xr(ios 16)、ipad mini5(17.5)上测了都没问题。我是 xcode->Product->Scheme->Edit Scheme->Run->Build Configuration设置为Release 编译运行的
我iphone xr(ios 16)、ipad mini5(17.5)上测了都没问题。我是 xcode->Product->Scheme->Edit Scheme->Run->Build Configuration设置为Release 编译运行的
xcode里的崩溃详细信息截图一下
mdk.vdec0@0x70001160d000 (72): EXC_BAD_ACCESS (code=1, address=0x0) 又发现新的崩溃情况,概率相当大,视频页返回上一页的时候。
你试下这个例子能不能复现 https://github.com/wang-bin/mdk-examples/tree/master/flutter%2Fsimple
我应这个测的
mdk.demux@0x16b797000 (32): EXC_BREAKPOINT (code=1, subcode=0x1ae529df0) 用这个例子一样的崩溃
有时候可以看到第一帧,有时候直接不显示了
EXC_BREAKPOINT看名字是设了断点的意思, 根据文档 https://developer.apple.com/documentation/xcode/sigtrap_sigill 判断是非法指令,根据你截图里的__chk_fail_overflow
判断是buffer overflow。感觉得搞个debug版本的ffmpeg看看。你先点击 截图里的av_read_frame 再截图看看
xcode是什么版本?
xcode 15.2
这个是真机的debug也是有问题,模拟器没问题,但是卡的很
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
你点到ffmpeg的函数再截图,也就是最靠近__chk_fail_overflow的那个,比如av_read_frame, avformat_open_input
这次没看见,就是open_input报错了
我这边还是没复现,用fvp/example的例子,还把例子里列表视频个数增加了。我编译了带ffmpeg调试符号的mdk.xcframework.tar.gz,你方便的话可以测下崩溃在ffmpeg的什么地方。解压后直接替换 ios/Pods/mdk/mdk-sdk/lib/mdk.xcframework
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
0x1060abb30 <+280>: cbz w0, 0x1060abb60 ; <+328> at tls_wolfssl.c:181:9 这个位置卡住
是不是https证书过期了或没有https证书导致无法读取文件了
// 忽略SSL证书验证 curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, false); curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, false);
你直接截图。ffmpeg里没用curl
我试了下确实https问题,我直接播放ts把https改成http就可以了,用https就崩溃
我把ssl依赖库升级了下到最新稳定版,加了调试符号,你试试 mdk.xcframework.tar.gz
如果奔溃的话点击最靠近__chk_fail_overflow的wolfSSL_connect截图看看
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
这个地方不用截图就这么点
这是哪个函数?你还是截图吧
截图可能可以判断其他信息
RsaFunctionSync, wc_RsaFunctionSync点击截图看看。chk_fail_overflow和memset_chk是编译器插的代码,不用看
xcode底部应该有个(lldb)的输入区域,你输入 bt all
然后把tls_open开始到最顶上的复制到这里看看。
这个感觉是wolfssl已知问题,感觉他们开发者自己也没法复现,我只能按那个issue里的方法编译试试,可以不崩溃但是会有其他错误 https://github.com/wolfSSL/wolfssl/issues/6524
这个是按那个issue里的编译方式编的,说是不会崩溃
现在之前那个资源人家已经把https证书续上了,所以暂时没办法测试了,我留意下看看能不能找到非https资源或证书过期的再测试,我网上搜了下wolfssl也是可以跳过验证的: 在wolfSSL中,如果你想要跳过证书验证,你可以使用wolfSSL_SetTLSv12函数,并设置WOLFSSL_ALLOW_SVR_EMPTY_CA_LIST标志。这样做将允许客户端接受一个空的CA列表,并允许服务器在没有提供任何证书的情况下进行握手。
以下是一个简单的示例代码,展示如何设置wolfSSL以跳过验证:
// 在调用任何wolfSSL函数之前调用此函数 void skip_cert_verification() { wolfSSL_SetTLSv12(true);
wolfSSL_SetAllowSVCEmpty(true);
}
// 你的其他wolfSSL初始化和使用代码
我没有用你新编译的framwork,用我自己的服务器测试了下 1.如果不配置https确用https访问,结果不崩溃,但是无法播放 2.如果配置一个和域名不匹配的证书,可以正常播放 3.如果配置一个过期的证书,刚好手上有过期证书和对应域名,可以正常播放
这个崩溃场景目前无法测试了。。。后面再留意下吧
xcode到这里就卡住了,mdk.demux@0x16aef3000 (37): EXC_BREAKPOINT (code=1, subcode=0x1ae529df0) 如果不是用xcode点run,这里就崩溃闪退了