|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #39673 file_get_contents causes bus error on certain offsets
Submitted: 2006-11-29 02:07 UTC Modified: 2006-11-29 11:13 UTC
From: cstdenis at ctgameinfo dot com Assigned: tony2001
Status: Closed Package: Filesystem function related
PHP Version: 5CVS-2006-11-29 (snap) OS: FreeBSD 6.1-RELEASE
Private report: No CVE-ID:
 [2006-11-29 02:07 UTC] cstdenis at ctgameinfo dot com
Note: this MAY be the same bug as #37866 but it was closed due to lack of CVS testing and I can not add a comment to it.

May also be related to #35886 but its marked fixed in cvs and win32 only.

Example background
karin# ll cache/profiles/c/cstdenis.html
-rw-r--r--  1 www  site5  23177 Nov 28 16:54 cache/profiles/c/cstdenis.html

All tests done via CLI. Not tested under apache

Reproduce code:
echo file_get_contents('cache/profiles/c/cstdenis.html',  false, null, 1399);
outputs contents of file from offset 1399

echo file_get_contents('cache/profiles/c/cstdenis.html',  false, null, 1400);
Bus error

Expected result:
File contents from offset

Actual result:
Bus Error

Backtrace of core
#0  0x28588322 in memcpy () from /lib/
[New LWP 100443]
(gdb) bt
#0  0x28588322 in memcpy () from /lib/
Cannot access memory at address 0xbfbfd29c

Latest CVS snap still has the same problem.

Backtrace of 5.2.1-dev core
#0  0x2869c329 in memcpy () from /lib/
(gdb) bt
#0  0x2869c329 in memcpy () from /lib/
Cannot access memory at address 0xbfbfd25c


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-11-29 11:13 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2015 The PHP Group
All rights reserved.
Last updated: Tue Oct 06 16:01:33 2015 UTC