|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #73881 A code that makes segmentation fault
Submitted: 2017-01-06 13:28 UTC Modified: 2017-01-06 15:17 UTC
From: eruiz at dataclick dot es Assigned:
Status: Duplicate Package: *General Issues
PHP Version: 7.1.0 OS: Linux Gentoo
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: eruiz at dataclick dot es
New email:
PHP Version: OS:


 [2017-01-06 13:28 UTC] eruiz at dataclick dot es

I notice you about this bug that causes that PHP fails and 'Segmentation Fault' and so you can see "Error Gateway" in browser!!

Only happens with new released version PHP 7.1.0 and without execution code! just reading the file fpdf.php that I use to generate PDF files ( and in function "Image" in main class:

This code in the file and "without execution" causes segmentation fault when PHP only read the file:

		$w = -$info['w']*72/$w/$this->k;
		$h = -$info['h']*72/$h/$this->k;

To solve it... I have changed avoiding /$w and /$h because it's seem that PHP consider value as 0 or whatever

		$w = -$info['w']*72/min($w,1)/$this->k;
		$h = -$info['h']*72/min($h,1)/$this->k;

Thanks and happy new year from Spain ;)

Eduardo Ruiz

Test script:
// Just create a file with these lines and without execution and read it:

		$w = -$info['w']*72/$w/$this->k;
		$h = -$info['h']*72/$h/$this->k;

Expected result:
No segmentation fault!!!

Actual result:
Segmentation Fault and Gateway error


PHP_error_with_multiple_divisions (last revision 2017-01-06 13:31 UTC by eruiz at dataclick dot es)

Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2017-01-06 15:17 UTC]
-Status: Open +Status: Duplicate
 [2017-01-06 15:17 UTC]
Duplicate of bug #73668, which will be fixed in 7.1.1.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Thu Feb 02 12:05:53 2023 UTC