php5 crashed with SIGSEGV in memcpy()
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
php-imap (Ubuntu) |
Invalid
|
Medium
|
Unassigned |
Bug Description
Binary package hint: php5
$ lsb_release -rd
Description: Ubuntu 10.04.1 LTS
Release: 10.04
$ LC_ALL=C apt-cache policy php5
php5:
Installed: (none)
Candidate: 5.3.2-1ubuntu4.2
Version table:
5.
500 http://
5.3.2-1ubuntu4 0
500 http://
The script seems to crash on imap_fetchbody().
Will try to produce a minimal test case.
ProblemType: Crash
DistroRelease: Ubuntu 10.04
Package: php5-cli 5.3.2-1ubuntu4.2
ProcVersionSign
Uname: Linux 2.6.32-24-server x86_64
NonfreeKernelMo
Architecture: amd64
CrashCounter: 1
Date: Sat Aug 14 17:12:50 2010
ExecutablePath: /usr/bin/php5
ProcCmdline: php parse.php
ProcEnviron:
SHELL=/bin/bash
LANG=ru_RU.UTF-8
LANGUAGE=ru_RU:ru
SegvAnalysis:
Segfault happened at: 0x7f0a2e6ccefa <memcpy+666>: mov 0x30(%rsi),%r13
PC (0x7f0a2e6ccefa) ok
source "0x30(%rsi)" (0x7f0a2b600000) in non-readable VMA region: 0x7f0a2b600000-
destination "%r13" ok
SegvReason: reading VMA /usr/lib/
Signal: 11
SourcePackage: php5
StacktraceTop:
memcpy () at ../sysdeps/
_estrndup (s=0x7f0a2b5f2f4e "", length=676989824) at /usr/include/
zif_imap_fetchbody () from /usr/lib/
zend_do_
execute (op_array=
Title: php5 crashed with SIGSEGV in memcpy()
UserGroups: adm admin cdrom dialout lpadmin plugdev sambashare vboxusers
Related branches
description: | updated |
tags: | added: patch |
affects: | php5 (Ubuntu) → php-imap (Ubuntu) |
The problem seems to be either in php5-imap or libc-client2007 e-dev.
Due to a bug, my script passes invalid $section value to imap_fetchbody(), something like:
imap_fetchbody( $imap_handle, $message_number, "3.1.1. 1.1.1.1. 1.1.1.1. 1.1.1.1. 1.1.1.1. 1.1.1.1. 1.1.1.1. 1.1.1.1. 1.1.1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