Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Dec 20, 2025. It is now read-only.
This repository was archived by the owner on Dec 20, 2025. It is now read-only.

php7.4.33 ubuntu 22.04 amd64 reproducible segfault in stripslashes #1894

@martymcguire

Description

@martymcguire

Frequently asked questions

  • I have read Frequently Asked Questions
  • I have looked at the list of the existing issues (including closed issues) and searched if my issue has been already reported

Describe the bug

On Ubuntu 22.04 on ARM systems using php7.4 installed via ppa:ondrej/php, stripslashes hangs and segfaults on 16-character strings that end in a \ character.

To Reproduce
Steps to reproduce the behavior:

Call stripslashes on any 16-character string ending in \. For example stripslashes("1234567890abcde\\");

Expected behavior: returns the string 1234567890abcde.

Actual behavior: Segmentation Fault.

For example:

$ php --version
PHP 7.4.33 (cli) (built: Nov  8 2022 11:33:53) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.33, Copyright (c), by Zend Technologies

$ php -a
Interactive mode enabled

php > stripslashes("1234567890abcde\\");
Segmentation fault (core dumped)

This occurs on Ubuntu 22.04 on arm64 systems using php7.4 installed via ppa:ondrej/php.

The same does not occur on amd64 based systems, same versions of Ubuntu and PHP:

$ php --version
PHP 7.4.33 (cli) (built: Nov  8 2022 11:33:17) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.33, Copyright (c), by Zend Technologies

$ php -a
Interactive mode enabled

php > stripslashes("1234567890abcde\\");
php >

Your understanding of what is happening

I'm not sure. Some kind of bad memory access in string handling?

Distribution (please complete the following information):

  • OS: Ubuntu
  • Architecture: arm64
  • Repository: Ubuntu PPA

Package(s) (please complete the following information):

$ apt-cache policy php7.4-cli
php7.4-cli:
  Installed: 1:7.4.33-1+ubuntu22.04.1+deb.sury.org+1
  Candidate: 1:7.4.33-1+ubuntu22.04.1+deb.sury.org+1
  Version table:
 *** 1:7.4.33-1+ubuntu22.04.1+deb.sury.org+1 500
        500 http://ppa.launchpad.net/ondrej/php/ubuntu jammy/main arm64 Packages
        100 /var/lib/dpkg/status

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions