php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80583 cli readline causes crash
Submitted: 2021-01-04 13:53 UTC Modified: 2021-01-04 14:05 UTC
Votes:3
Avg. Score:4.7 ± 0.5
Reproduced:3 of 3 (100.0%)
Same Version:2 (66.7%)
Same OS:1 (33.3%)
From: jan dot hana at atlas dot cz Assigned:
Status: Verified Package: *Unicode Issues
PHP Version: 8.0.0 OS: Ubuntu 20.04
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
41 + 43 = ?
Subscribe to this entry?

 
 [2021-01-04 13:53 UTC] jan dot hana at atlas dot cz
Description:
------------
When using the Czech diacritics in readline parametter, whole application crashes.

It works in PHP 7.4.

Test script:
---------------
<?php
readline('doména ěščřžýáíé');

Actual result:
--------------
Neoprávněný přístup do paměti (SIGSEGV) (core dumped [obraz paměti uložen])

Translated to EN: Unauthorized Memory Access (SIGSEGV) (core dumped)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-01-04 14:05 UTC] nikic@php.net
-Status: Open +Status: Verified
 [2021-01-04 14:05 UTC] nikic@php.net
This works on 7.4 and 8.0:

var_dump(setlocale(LC_ALL, 'en_US.UTF-8'));
readline('doména ěščřžýáíé');

This crashes on 7.4 and 8.0:

var_dump(setlocale(LC_ALL, 'C'));
readline('doména ěščřžýáíé');

Locale-dependent crashes in libedit, this is horrible.
 [2021-10-27 18:28 UTC] Ernaelsten at gmail dot com
I have the same problem with the local fr_BE , under Mint and Pop!Os (ubuntu 20.04) for php8.0 and php8.1.
On the other hand with php7.4 no problem.
I can't put accented characters in the response of a readline() function either.
 [2022-02-09 04:41 UTC] sebagi8166 at mxclip dot com
< a href="https://www.customersurveys.xyz/>Customer Satisfaction Survey </a>
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 07:01:27 2024 UTC