php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #5084 imap_mail_compose produces a SigSegv
Submitted: 2000-06-16 17:11 UTC Modified: 2001-05-10 09:44 UTC
From: hekker at netway dot at Assigned: sniper (profile)
Status: Closed Package: IMAP related
PHP Version: 4.0 Release Candidate 2 OS: i386-redhat-linux 2.2.13 glibc 2
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: hekker at netway dot at
New email:
PHP Version: OS:

 

 [2000-06-16 17:11 UTC] hekker at netway dot at
<?php

print "bla<br>\n";
$env = array("From: hekker@netway.at");
$body = array("Part 1");

print imap_mail_compose($env,$body);
?>


./configure  --with-apache=../apache_1.3.9 --with-ldap=/opt/ldap
--with-gdbm --with-imap=/opt/apache/apache/src/c-client/imap-4.7b/ --with-zlib --enable-sysvshm

gdb backtrace:
Program received signal SIGSEGV, Segmentation fault.
0x80ae8a6 in php_if_imap_mail_compose (ht=2, return_value=0x839834c, this_ptr=0x0, 
    return_value_used=1) at php_imap.c:3094
3094                            bod->nested.part=mail_newbody_part();
(gdb) bt
#0  0x80ae8a6 in php_if_imap_mail_compose (ht=2, return_value=0x839834c, this_ptr=0x0, 
    return_value_used=1) at php_imap.c:3094
#1  0x81038dc in execute (op_array=0x83971d4) at ./zend_execute.c:1574
#2  0x8087fab in php_execute_script (primary_file=0xbffffbec) at main.c:1200
#3  0x80a2b20 in apache_php_module_main (r=0x837f674, fd=40, display_source_mode=0)
    at sapi_apache.c:93
#4  0x80844db in send_php ()
#5  0x808451c in send_parsed_php ()
#6  0x8150263 in ap_invoke_handler ()
#7  0x81639b9 in process_request_internal ()
#8  0x8163a1c in ap_process_request ()
#9  0x815b34e in child_main ()
#10 0x815b4fc in make_child ()
#11 0x815b659 in startup_children ()
#12 0x815bc86 in standalone_main ()
#13 0x815c419 in main ()
#14 0x400f6cb3 in __libc_start_main (main=0x815c0cc <main>, argc=2, argv=0xbffffda4, 
    init=0x8082928 <_init>, fini=0x822b90c <_fini>, rtld_fini=0x4000a350 <_dl_fini>, 
    stack_end=0xbffffd9c) at ../sysdeps/generic/libc-start.c:78

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-07-29 02:43 UTC] sniper@php.net
Same as #3337

--Jani
 [2000-07-29 02:49 UTC] sniper@php.net
IMAP related. 

--Jani
 [2000-07-29 23:04 UTC] sniper@php.net
I made a partial fix to this which is committed into the CVS. But there is still some bugs in this. 

For now at least the script below works:

<?php

$envelope["from"]="musone@afterfive.com";
$envelope["to"]="musone@darkstar";
$envelope["cc"]="musone@edgeglobal.com";

$part1["type"]=TYPEMULTIPART;
$part1["subtype"]="mixed";

$filename="/tmp/imap.c.gz";
$fp=fopen($filename,"r");
$contents=fread($fp,filesize($filename));
fclose($fp);
$part2["type"]=TYPEAPPLICATION;
$part2["encoding"]=ENCBINARY;
$part2["subtype"]="octet-stream";
$part2["description"]=basename($filename);
$part2["contents.data"]=$contents;


$part3["type"]=TYPETEXT;
$part3["subtype"]="plain";
$part3["description"]="description3";
$part3["contents.data"]="contents.data3\n\n\n\t";

$body[1]=$part1;
$body[2]=$part2;
$body[3]=$part3;
echo nl2br(imap_mail_compose($envelope,$body));

?>

I will write some kind of documentation of this soon as possible.

--Jani
 [2001-05-03 15:29 UTC] chagenbu@php.net
Can you test this with 4.0.6-cvs? It is very likely fixed now.
 [2001-05-10 09:44 UTC] sniper@php.net
Works nicely for me with 4.0.6-dev. Reopen if problem persist with 4.0.6

--Jani

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 00:01:30 2024 UTC