Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

百度网盘无法启动 #10

Open
MingcongBai opened this issue Feb 20, 2024 · 6 comments
Open

百度网盘无法启动 #10

MingcongBai opened this issue Feb 20, 2024 · 6 comments
Labels
bug Something isn't working upstream-issue Issue to be addressed by upstream (vendor)

Comments

@MingcongBai
Copy link
Member

使用 libLoL 0.1.3 及 0.1.4~pre4,百度网盘均无法启动,报错如下:

mingcongbai@JellyCambarellus [ baidunetdisk ] $ ./baidunetdisk 
free(): invalid pointer
已放弃(核心已转储)

GDB backtrace (0.1.3)

(gdb) bt
#0  0x00007ffff53c6e44 in __pthread_kill_implementation
    (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0)
    at ./src/glibc/nptl/pthread_kill.c:43
#1  0x00007ffff53c6eb4 in __pthread_kill_internal
    (signo=6, threadid=<optimized out>) at ./src/glibc/nptl/pthread_kill.c:78
#2  0x00007ffff537c35c in __GI_raise (sig=sig@entry=6)
    at ../sysdeps/posix/raise.c:26
#3  0x00007ffff53669f0 in __GI_abort () at ./src/glibc/stdlib/abort.c:79
#4  0x00007ffff53b8c78 in __libc_message (fmt=fmt@entry=0x7ffff54b1a50 "%s\n")
    at ../sysdeps/posix/libc_fatal.c:150
#5  0x00007ffff53d3614 in malloc_printerr
    (str=str@entry=0x7ffff54acd60 "free(): invalid pointer")
    at ./src/glibc/malloc/malloc.c:5879
#6  0x00007ffff53d5670 in _int_free
    (av=<optimized out>, p=<optimized out>, have_lock=have_lock@entry=0)
    at ./src/glibc/malloc/malloc.c:4501
#7  0x00007ffff53d8494 in __GI___libc_free (mem=<optimized out>)
    at ./src/glibc/malloc/malloc.c:3386
#8  0x0000555558a5c0ec in ??? ()
@MingcongBai MingcongBai added the bug Something isn't working label Feb 20, 2024
@MingcongBai
Copy link
Member Author

另附百度网盘一处疑似发行质量问题:/opt/baidunetdisk/chrome-sandbox 应为 root:root 所有并带有 4755 权限位,但安装软件包后发现是 755;他们在 /usr/share/applications/baidunetdisk.desktop 中使用 --no-sandbox 绕过了这一问题,不开沙箱功能的原因不详,但最好报告反馈一下

@shankerwangmiao
Copy link
Collaborator

shankerwangmiao commented Feb 20, 2024

该错误现象疑似因为载入了不正确的 so,建议以此为入口开始排查。

@MingcongBai
Copy link
Member Author

该错误疑似因为载入了不正确的 so,建议以此为入口开始排查。

经查,baidunetdisk 中只有 libEGL.solibGLES.so 两个库可以删除,其余都是应用必须的 CEF 库,不能删;删除后症状依旧

@shankerwangmiao shankerwangmiao added the upstream-issue Issue to be addressed by upstream (vendor) label Feb 22, 2024
@shankerwangmiao
Copy link
Collaborator

经查,情况和 #8 一致,都是因为没有正确连接 openssl 所致,涉及的 so 有:

  • libbrowserengine.so
  • libkernel.so
  • libminosagent.so
  • libplayer.so

@MingcongBai
Copy link
Member Author

MingcongBai commented Feb 22, 2024

经查,情况和 #8 一致,都是因为没有正确连接 openssl 所致,涉及的 so 有:

* `libbrowserengine.so`
* `libkernel.so`
* `libminosagent.so`
* `libplayer.so`

啧,那就只能报告给厂商了

@shankerwangmiao
Copy link
Collaborator

经查,情况和 #8 一致,都是因为没有正确连接 openssl 所致,涉及的 so 有:

  • libbrowserengine.so
  • libkernel.so
  • libminosagent.so
  • libplayer.so

百度网盘的情况和 #8 不完全一致,在钉钉中,是本应动态链接 libssl 却未能在链接时指定,导致 SSL 相关符号缺少定义。在百度网盘中,情况时上述四个动态链接库静态链接了 libssl,却误将静态连接进来的 libssl 的符号又作为动态符号导出了。上述行为致使在启动后,这四个动态链接库用到的 SSL 相关符号被指向了系统提供的 openssl 3.0 的同名符号。

该问题的解决办法为:增加 -Wl,--version-script=version-script 选项,并在 version-script 中使用形如 {global: foo; bar; local: *;} 的指令显式指定要导出的符号。

同时,上述动态链接库也存在未能连接系统库,致使出现符号缺少定义的情况:

  • libbrowserengine.so:缺少 -lpthread -ldl
  • libkernel.so:缺少 -lpthread -ldl -lrt
  • libminosagent.so:缺少 -lpthread -ldl
  • libplayer.so:缺少 -lpthread -ldl -lrt -lz

因此可以推知,这些 so 文件在链接时也未能使用 -Wl,-z,defs 避免缺少链接必要的动态链接库。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working upstream-issue Issue to be addressed by upstream (vendor)
Projects
None yet
Development

No branches or pull requests

2 participants