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

[Bug]: NullPointerException in PythonLocaleData.getLocaleData

クローズ
#1,103 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

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

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
70/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
java, python
領域
backend

調査の方向性

提供された re.search('A', '', 9999) スニペットでクラッシュを再現し、次に 81 行目の PythonLocaleData.java と、スタックトレースで示されている regex のエントリポイントを調査します。この入力に対するリグレッションカバレッジを追加し、NullPointerException なしで完了することを確認します。

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

説明

bug
Describe the bug

GraalPy crashes when running this fuzzed code:

import re
re.search('A', '', 9999)
Operating system

Linux

CPU architecture

x86_64

GraalPy version

GraalPy 3.13.14 (Oracle GraalVM Native 25.3.4.1)

JDK version

No response

Context configuration

No response

Steps to reproduce

Snippet listed above

Expected behavior

No crash

Stack trace
java.lang.NullPointerException: Stack trace is imprecise, the top frames are missing and/or have wrong line numbers. To get precise stack traces, build the image with option -H:-ReduceImplicitExceptionStackTraceInformation
	at com.oracle.truffle.regex/com.oracle.truffle.regex.flavor.python.PythonLocaleData.getLocaleData(PythonLocaleData.java:81)
	at com.oracle.truffle.regex/com.oracle.truffle.regex.flavor.python.PythonRegexLexer.getLocaleData(PythonRegexLexer.java:198)
	at com.oracle.truffle.regex/com.oracle.truffle.regex.flavor.python.PythonRegexLexer.caseFoldUnfold(PythonRegexLexer.java:348)
	at com.oracle.truffle.regex/com.oracle.truffle.regex.flavor.python.PythonRegexParser.literalChar(PythonRegexParser.java:315)
	at com.oracle.truffle.regex/com.oracle.truffle.regex.flavor.python.PythonRegexParser.parse(PythonRegexParser.java:244)
	at com.oracle.truffle.regex/com.oracle.truffle.regex.tregex.TRegexCompilationRequest.parse(TRegexCompilationRequest.java:349)
	at com.oracle.truffle.regex/com.oracle.truffle.regex.tregex.TRegexCompilationRequest.compileInternal(TRegexCompilationRequest.java:159)
	at com.oracle.truffle.regex/com.oracle.truffle.regex.tregex.TRegexCompilationRequest.compile(TRegexCompilationRequest.java:143)
	at com.oracle.truffle.regex/com.oracle.truffle.regex.tregex.TRegexCompiler.doCompile(TRegexCompiler.java:89)
	at com.oracle.truffle.regex/com.oracle.truffle.regex.tregex.TRegexCompiler.compile(TRegexCompiler.java:75)
	at com.oracle.truffle.regex/com.oracle.truffle.regex.RegexLanguage.createRegexObject(RegexLanguage.java:205)
	at com.oracle.truffle.regex/com.oracle.truffle.regex.RegexLanguage.parse(RegexLanguage.java:164)
	at org.graalvm.truffle/com.oracle.truffle.api.TruffleLanguage$ParsingRequest.parse(TruffleLanguage.java:1204)
	at org.graalvm.truffle/com.oracle.truffle.api.TruffleLanguage.parse(TruffleLanguage.java:1618)
	at org.graalvm.truffle/com.oracle.truffle.api.LanguageAccessor$LanguageImpl.parse(LanguageAccessor.java:309)
	at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotSourceCache.parseImpl(PolyglotSourceCache.java:114)
	at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotSourceCache$WeakCache.lookup(PolyglotSourceCache.java:351)
	at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotSourceCache.parseCached(PolyglotSourceCache.java:94)
	at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotLanguageContext.parseCached(PolyglotLanguageContext.java:377)
	at org.graalvm.truffle/com.oracle.truffle.polyglot.EngineAccessor$EngineImpl.parseForLanguage(EngineAccessor.java:332)
	at org.graalvm.truffle/com.oracle.truffle.api.TruffleLanguage$Env.parseInternal(TruffleLanguage.java:2648)
	at org.graalvm.py/com.oracle.graal.python.builtins.modules.re.TRegexCache.compile(TRegexCache.java:307)
	at org.graalvm.py/com.oracle.graal.python.builtins.modules.re.PatternNodes$TRegexCompileNode.getCompiledRegexLocaleNonSensitive(PatternNodes.java:220)
	at org.graalvm.py/com.oracle.graal.python.builtins.modules.re.PatternNodes$TRegexCompileNode.localeNonSensitive(PatternNodes.java:228)
	at org.graalvm.py/com.oracle.graal.python.builtins.modules.re.PatternNodesFactory$TRegexCompileNodeGen.executeAndSpecialize(PatternNodesFactory.java:841)
	at org.graalvm.py/com.oracle.graal.python.builtins.modules.re.PatternNodesFactory$TRegexCompileNodeGen.execute(PatternNodesFactory.java:752)
	at org.graalvm.py/com.oracle.graal.python.builtins.modules.re.PatternBuiltins$NewNode.newPattern(PatternBuiltins.java:188)
	at org.graalvm.py/com.oracle.graal.python.builtins.modules.re.PatternBuiltinsFactory$NewNodeFactory$NewNodeGen.execute(PatternBuiltinsFactory.java:248)
	at org.graalvm.py/com.oracle.graal.python.nodes.function.builtins.BuiltinCallNode$BuiltinAnyCallNode.execute(BuiltinCallNode.java:64)
	at org.graalvm.py/com.oracle.graal.python.nodes.function.BuiltinFunctionRootNode.execute(BuiltinFunctionRootNode.java:337)
[...snip...]
Additional context

No response

主要言語
Python
スター
1.7k
フォーク
156
平均マージ
4時間 56分
マージ済み PR(30日)
54

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

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

oracle/graalpython のほかの issue

oracle/graalpython の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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