Blender Hack Blog

オープンソースの総合3DCGソフトウェアのBlenderのコード解析や開発を記録していきます。

Blenderのはじめての不具合改修

はじめに

BlenderXcodeデバッグ実行した時にNull Pointer Exceptionが発生する不具合を発見しました。 軽微な不具合だったので、改修してパッチを送りました。その過程を簡単にメモに残しておきます。

使用したコード

master (af940c68cbed7e840d6ae58f2645ff12ed6abffb) 2.93.0を使用しました。

バグの詳細

環境変数BLENDER_SYSTEM_PYTHONを未設定の状態でBlenderを実行すると、Null Pointer Exceptionが発生します。 こちらに詳細をまとめて、パッチを送りました。 https://developer.blender.org/D10494

git loggit blameでバグが混入したコミットを特定しました。

パッチの作成

このページに書かれている、Arcanistをインストールしました。 https://wiki.blender.org/wiki/Tools/CodeReview

はじめて使用する際には、以下のコマンドを実行して、パッチの送付先のシステム認証を行う必要があります。

% arc install-certificate

以下のコマンドを実行するとコードのコミットとチケットの作成が行われます。

% arc diff

コミッターにレビューを依頼しました。

無事、修正が取り込まれました。 https://developer.blender.org/rB06212759bc7285a131c3ee811aec1ee240841c2c

commit 06212759bc7285a131c3ee811aec1ee240841c2c
Author: Campbell Barton <ideasman42@gmail.com>
Date:   Mon Feb 22 21:20:48 2021 +1100

    Fix missing NULL check on macOS when system-python isn't found
    
    Regression from cafd6b519c5f5c4b67d0dfe3d453cd4223b38716.
    
    D10494 by @ysano with edits.