php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #70933 Abnormal stop when setlocale is called with invalid parameter
Submitted: 2015-11-18 07:01 UTC Modified: 2015-11-29 04:22 UTC
From: piyoyo at users dot noreply dot github dot com Assigned:
Status: No Feedback Package: *General Issues
PHP Version: 7.0.0RC7 OS: Windows10
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:
25 - 14 = ?
Subscribe to this entry?

 
 [2015-11-18 07:01 UTC] piyoyo at users dot noreply dot github dot com
Description:
------------
Abnormal stop 
when setlocale is called with invalid parameter utf8 encoded such as non ascii code.


Test script:
---------------
<?php
  setlocale(LC_TIME, 'en_US.UTF-8');




Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-11-18 07:30 UTC] laruence@php.net
what do you mean by "abnormal stop"?
 [2015-11-18 10:15 UTC] piyoyo at users dot noreply dot github dot com
CLI has stopped working error message

php -nr "setlocale(LC_TIME, chr(130));"
 [2015-11-18 10:30 UTC] ab@php.net
@piyoyo in the description, besides en_US.UTF-8 is not a valid locale on Windows, are you aware that you pass an multi byte string? So in best case you'll just get false, or even a parse error.

With your second snippet I can't reproduce any crash neither, i just got false in that case. Please check the event log and maybe try to get a backtrace https://bugs.php.net/bugs-generating-backtrace-win32.php or memory dump https://msdn.microsoft.com/en-us/library/windows/desktop/bb787181%28v=vs.85%29.aspx

Thanks
 [2015-11-18 10:32 UTC] ab@php.net
-Status: Open +Status: Feedback
 [2015-11-29 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Fri Aug 12 02:05:45 2022 UTC