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

Crash when processing certain PNGs in ARM64 #8605

Closed
mei23 opened this issue May 3, 2022 · 11 comments
Closed

Crash when processing certain PNGs in ARM64 #8605

mei23 opened this issue May 3, 2022 · 11 comments
Assignees
Labels
🐛Bug Unexpected behavior 🔥high priority packages/backend Server side specific issue/PR

Comments

@mei23
Copy link
Contributor

mei23 commented May 3, 2022

💡 Summary

ARM64上で稼働しているインスタンスで特定のPNGを処理しようとするとクラッシュします。

malloc(): corrupted top size
ERR  *        [core cluster]        [1] died :(

特定のPNGとして Pixelfed のデフォルト favicon.png などが該当するため、URLプレビューで Pixelfed インスタンスを表示しようとした時などにクラッシュします。

起きる環境の例

Ubuntu 20.04.4 on AWS t4g
Linux hostname 5.13.0-1022-aws #24~20.04.1-Ubuntu SMP Thu Apr 7 22:14:11 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux

Ubuntu 20.04.4 on OCI A1
Linux hostname 5.13.0-1027-oracle #32~20.04.1-Ubuntu SMP Fri Apr 15 06:01:57 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux

sharpが0.30.0以降だと起きる

OK sharp 0.29.3
NG sharp 0.30.0 - 0.30.4 

🥰 Expected Behavior

クラッシュしない

🤬 Actual Behavior

クラッシュする

📝 Steps to Reproduce

  1. ARM64上でMisskeyインスタンスを構築する
  2. PixelfedインスタンスのURLを投稿してURLプレビューを表示させようとする

📌 Environment

Misskey version: 12.110.1
Summary を参照

@mei23 mei23 added the ⚠️bug? This might be a bug label May 3, 2022
@syuilo syuilo added 🐛Bug Unexpected behavior packages/backend Server side specific issue/PR 🔥high priority and removed ⚠️bug? This might be a bug labels May 3, 2022
@acid-chicken
Copy link
Member

acid-chicken commented May 3, 2022

@mei23
Copy link
Contributor Author

mei23 commented May 3, 2022

await sharp('favicon.png').toBuffer() だけで落ちる
jemallocを使うようにすると起きないらしい

@4ioskd
Copy link

4ioskd commented May 14, 2022

@syuilo PRの消化等で忙しくてお忘れかもしれませんが、high priorityのラベルが貼られてますので、対応頂けたら幸いです。私の知っている限りでは複数のARM64インスタンスでクラッシュしてるのを観測しています。
FYI( めいめい先生のめいすきーでの対応策 ): mei23@32e4ef4

@tamaina
Copy link
Contributor

tamaina commented May 14, 2022

これじゃだめなんだっけ
(どちらにしろ面倒か)

https://misskey.xianon.net/notes/8zrrs9qm9c

@tamaina
Copy link
Contributor

tamaina commented May 14, 2022

とりあえず mei23@32e4ef4 と同じ対応でいいかしらね

sharp.jsのGitHubにはこれに関係するIssueはない?

@mei23
Copy link
Contributor Author

mei23 commented May 14, 2022

0.30.x に依存する機能は使ってないので 0.29.x にすればいいと思うのだわ。
sharp.js にIssueはないけど結局 libvips 依存だとは思うのだわ。

@syuilo
Copy link
Member

syuilo commented May 14, 2022

とりあえず戻そう

@tamaina
Copy link
Contributor

tamaina commented May 14, 2022

Issue書いた
lovell/sharp#3225

@syuilo syuilo closed this as completed in 6de40cf May 14, 2022
@tamaina
Copy link
Contributor

tamaina commented May 24, 2022

Sharp v0.30.1 以降で直るらしい

@mei23
Copy link
Contributor Author

mei23 commented May 24, 2022

v0.31.x 以降だわね

@mei23
Copy link
Contributor Author

mei23 commented May 24, 2022

いや、v0.30.1以下か v0.31.x以降なら起きない と言ってる?!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛Bug Unexpected behavior 🔥high priority packages/backend Server side specific issue/PR
Projects
None yet
Development

No branches or pull requests

5 participants