Bug 91456 - crashes after file upload and triggering PHP script
Summary: crashes after file upload and triggering PHP script
Status: RESOLVED DUPLICATE of bug 105899
Alias: None
Product: konqueror
Classification: Applications
Component: khtml forms (other bugs)
Version First Reported In: unspecified
Platform: openSUSE Linux
: NOR crash
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-10-16 17:24 UTC by Uros Dukanac
Modified: 2005-06-29 13:11 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Uros Dukanac 2004-10-16 17:24:03 UTC
Version:            (using KDE KDE 3.2.1)
Installed from:    SuSE RPMs
OS:                Linux

I wrote a PHP program for uploading files, and storing it in directory.
a) First you browse for a PDF file.
b) You upload PDF file to PHP server with some tempname and then next line of code just moves that TMP file to some other directory and rename it.
c) PHP then redisplay the main page.

Between b) and c) Konqueror crashes.

Here is the crash extract (Backtrace):
-------------------------
(no debugging symbols found)...Using host libthread_db library "/lib/tls/libthread_db.so.1".
(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...[Thread debugging using libthread_db enabled]
[New Thread 1094827296 (LWP 4956)]
(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...0xffffe410 in ?? ()
#0  0xffffe410 in ?? ()
#1  0xbfffd16c in ?? ()
#2  0x00000000 in ?? ()
#3  0x00000000 in ?? ()
#4  0x411c6e63 in __waitpid_nocancel () from /lib/tls/libpthread.so.0
#5  0x4075e862 in KCrash::defaultCrashHandler ()
   from /opt/kde3/lib/libkdecore.so.4
#6  <signal handler called>
#7  0x419bbc3d in KHTMLView::nonPasswordStorableSite ()
   from /opt/kde3/lib/libkhtml.so.4
#8  0x419ffe45 in DOM::HTMLFormElementImpl::submit ()
   from /opt/kde3/lib/libkhtml.so.4
#9  0x41a00b92 in DOM::HTMLFormElementImpl::prepareSubmit ()
   from /opt/kde3/lib/libkhtml.so.4
#10 0x41a00be9 in DOM::HTMLInputElementImpl::activate ()
   from /opt/kde3/lib/libkhtml.so.4
#11 0x41a00d36 in DOM::HTMLInputElementImpl::defaultEventHandler ()
   from /opt/kde3/lib/libkhtml.so.4
#12 0x419ea62f in DOM::NodeImpl::dispatchGenericEvent ()
   from /opt/kde3/lib/libkhtml.so.4
#13 0x419ea872 in DOM::NodeImpl::dispatchEvent ()
   from /opt/kde3/lib/libkhtml.so.4
#14 0x419ec9b5 in DOM::NodeImpl::dispatchUIEvent ()
   from /opt/kde3/lib/libkhtml.so.4
#15 0x419ea67c in DOM::NodeImpl::dispatchGenericEvent ()
   from /opt/kde3/lib/libkhtml.so.4
#16 0x419ea872 in DOM::NodeImpl::dispatchEvent ()
   from /opt/kde3/lib/libkhtml.so.4
#17 0x419bbb11 in KHTMLView::dispatchMouseEvent ()
   from /opt/kde3/lib/libkhtml.so.4
#18 0x419c0a5b in KHTMLView::viewportMouseReleaseEvent ()
   from /opt/kde3/lib/libkhtml.so.4
#19 0x419bf182 in KHTMLView::eventFilter () from /opt/kde3/lib/libkhtml.so.4
#20 0x40b1b6fe in QObject::activate_filters ()
   from /usr/lib/qt3/lib/libqt-mt.so.3
#21 0x40b1b7e0 in QObject::event () from /usr/lib/qt3/lib/libqt-mt.so.3
#22 0x40b502df in QWidget::event () from /usr/lib/qt3/lib/libqt-mt.so.3
#23 0x40ab9ddf in QApplication::internalNotify ()
   from /usr/lib/qt3/lib/libqt-mt.so.3
#24 0x40abbfb8 in QApplication::notify () from /usr/lib/qt3/lib/libqt-mt.so.3
#25 0x407a6ca4 in KApplication::notify () from /opt/kde3/lib/libkdecore.so.4
#26 0x40a55633 in QETWidget::translateMouseEvent ()
   from /usr/lib/qt3/lib/libqt-mt.so.3
#27 0x40a54225 in QApplication::x11ProcessEvent ()
   from /usr/lib/qt3/lib/libqt-mt.so.3
#28 0x40a68875 in QEventLoop::processEvents ()
   from /usr/lib/qt3/lib/libqt-mt.so.3
#29 0x40ad1811 in QEventLoop::enterLoop () from /usr/lib/qt3/lib/libqt-mt.so.3
#30 0x40ad1656 in QEventLoop::exec () from /usr/lib/qt3/lib/libqt-mt.so.3
#31 0x40abb6cf in QApplication::exec () from /usr/lib/qt3/lib/libqt-mt.so.3
#32 0x4154860c in kdemain () from /opt/kde3/lib/libkdeinit_konqueror.so
#33 0x400188d4 in kdeinitmain () from /opt/kde3/lib/kde3/konqueror.so
#34 0x0804e7f1 in launch ()
#35 0x0804eefc in handle_launcher_request ()
#36 0x0804f489 in handle_requests ()
#37 0x0804fbfa in main ()
-------------------------

I'm using SuSE 9.1 with KDE 3.2.1. - standard installation.

PHP CODE - step a) - this works
---------------- InvoiceFileForm.php --------------
<HTML>
<HEAD>
<TITLE>LucidTech - Fakture</TITLE>
	<META HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=windows-1250'>
	<LINK HREF="styles.css" REL="stylesheet" TYPE="text/css">	
</HEAD>

<BODY BGCOLOR='#97A7C7' TEXT='#000000'>
	<?php
		$InvoiceID = $_GET["InvoiceID"];

		echo "<FORM NAME='UploadForm' ENCTYPE='multipart/form-data' ACTION='InvoiceFileAdd.php?InvoiceID=$InvoiceID' METHOD='post' TARGET='MainWindow'>\n";
	?>
	<SPAN CLASS='text1'>Path to PDF file:</SPAN><BR>
	<INPUT TYPE='file' NAME='EFileField' SIZE='40' CLASS='input1'><BR>
	<INPUT TYPE='submit' VALUE='Insert PDF' OnClick='window.close()'>
	<INPUT TYPE='button' VALUE='Cancel' OnClick='window.close()'>
	</FORM>
</BODY>
</HTML>
---------------------------------------------------

PHP CODE - step b) & c) - where crash occurs
--------------- InvoiceFileAdd.php ----------------
<?php
	$InvoiceID = $_GET["InvoiceID"];

	if ($_FILES)
	{
		$FileName = $_FILES["EFileField"]["name"];
		$FileType = $_FILES["EFileField"]["type"];
		$FileSize = $_FILES["EFileField"]["size"];
		$TempFileName = $_FILES["EFileField"]["tmp_name"];

		$ValidFileType = "application/pdf";

		$FileType = strtolower($FileType);
		if ($FileType == $ValidFileType)
		{
			$NewFileName = $G_FilePath . $InvoiceID . "." . $G_FileExtension;
			$Stored = move_uploaded_file($TempFileName, $NewFileName);
			
			if (!$Stored)
				echo "Error! File not moved from <$TempFileName> to <$NewFileName>";
			else		// Redisplay page
				header("Location: MainForm.php");
		}
		else
			echo "Wrong Format!";
	}
?>

---------------------------------------------------

It crashes somwhere here...

$NewFileName = $G_FilePath . $InvoiceID . "." . $G_FileExtension;
$Stored = move_uploaded_file($TempFileName, $NewFileName);
			
if (!$Stored)
	echo "Error! File not moved from <$TempFileName> to <$NewFileName>";
else	// Redisplay page
	header("Location: MainForm.php");

It doesn't reach Redisplay Page part

It works with IE under Windows :(...

If I can halp you more please don't hesitete to write me on
dukanac@yubc.net or even better
office@lucidtech.org

Yhank you!

Uros Dukanac
Comment 1 George Staikos 2004-10-30 01:06:54 UTC
Please retry with KDE 3.3.
Comment 2 Tommi Tervo 2005-06-29 13:11:23 UTC
Bug #105899 has a better test case.

*** This bug has been marked as a duplicate of 105899 ***