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

RegEx.search_all causes 'Condition "p_ptr == nullptr" is true.' error with PCRE2 10.42 (Linux distro packages) #76174

Closed
Selenyhr opened this issue Apr 17, 2023 · 3 comments · Fixed by #70472

Comments

@Selenyhr
Copy link

Godot version

v4.0.2.stable.arch_linux

System information

ArchLinux rolling, Linux 6.2.11-arch1-1. Vulkan Mobile on RX 6900XT

Issue description

When using RegEx.search_all, an error is added to the log:

ERROR: Condition "p_ptr == nullptr" is true.
at: free_static (core/os/memory.cpp:148)

The number of triggered errors seems to be affected by the number of matches the regex makes.

Steps to reproduce

Have any script that does something using RegEx.search_all:

var regex: RegEx = RegEx.new()
regex.compile(".")
regex.search_all("test")

The above example will trigger 5 error messages (1 per match + 1 fixed).

Minimal reproduction project

minimal_project.zip

Script was made for running through CLI:
godot --headless -s new_script.gd

@ronyeh
Copy link
Contributor

ronyeh commented Apr 18, 2023

I know you are on linux, but I'm just adding a data point in case others are checking this bug.

No repro on current master on macOS.

The error is likely triggered when _regex_free is called in regex.cpp.
This calls Memory::free_static(void *p_ptr, bool p_pad_align) which checks for the p_ptr == nullptr.

@skysphr
Copy link
Contributor

skysphr commented May 4, 2023

I get the same error upon calling RegEx.sub.
OS is also Arch Linux.

@cg9999
Copy link
Contributor

cg9999 commented May 6, 2023

arch build is using system pcre2, which is at version 10.42
That version seems at the moment slightly incompatible with godot.
#70472 is in progress to fix compatibility with 10.42

I'm not sure if the only effect of this bug is the error message. I opened arch bug as well, just in case this issue might have other consequences. (https://bugs.archlinux.org/task/78428)

@akien-mga akien-mga changed the title [4.0] RegEx.search_all causes 'Condition "p_ptr == nullptr" is true.' error RegEx.search_all causes 'Condition "p_ptr == nullptr" is true.' error with PCRE2 10.42 (Linux distro packages) Jun 12, 2023
@akien-mga akien-mga added this to the 4.1 milestone Jun 12, 2023
akien-mga added a commit to akien-mga/godot that referenced this issue Jun 12, 2023
akien-mga added a commit to akien-mga/godot that referenced this issue Aug 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants