Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

OOM handling in C

オープン
#10 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
c, java
領域
api, backend

調査の方向性

src/main/c/h3-java/src/jniapi.c#L44 に記載されている JNI バインディングのエントリーポイントから始め、次に、それが呼び出す H3 の C 関数と、それらにおける malloc/calloc/realloc の処理を追跡します。完了条件は、メモリ不足エラーが、assertions や NULL ポインターによる未定義動作を引き起こすのではなく、関連する C および Java バインディング層を通じて伝播されることです。

索引モデルが issue の本文から書いたものです。

説明

The h3 C library does not handle the case of malloc/calloc/realloc returning NULL in a robust manner. If assertions are enabled, the library crashes, otherwise it will use the NULL pointer leading to undefined behavior. While I understand the convenience of this design in the C library, not propagating OOM errors up the stack means binding code like this is not reliable: https://github.com/uber/h3-java/blob/ed818d3d07c005576c0f96490015f388992b6df8/src/main/c/h3-java/src/jniapi.c#L44 Users are likely to see a sudden fatal crash in the Java process and may not see any hint to the C assertion. Practically, consider using return codes to handle OOM up the stack for your C functions so you can handle them probably here.

主要言語
Java
スター
333
フォーク
68
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

uber/h3-java のほかの issue

uber/h3-java の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。