jirentabu / crashrpt

Automatically exported from code.google.com/p/crashrpt
0 stars 0 forks source link

450 MD5 hash is missing #116

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
***NOTE*** Please do create a NEW issue per each detected bug! Do not list
all detected problems in single issue record!

What steps will reproduce the problem?
1.generate a fake crash
2.send it via HTTP
3.get error

What is the expected output?
success

What do you see instead?
fail

What version of the product are you using?
latest

On what operating system?
Win7 64bit

Please provide any additional information below.
?

Original issue reported on code.google.com by anbaricf...@gmail.com on 4 Nov 2011 at 7:12

GoogleCodeExporter commented 9 years ago
Thanks for reporting this. I've reproduced this with crashrpt.php script from 
v.1.3.0. Script from v.1.2.10 works well.  

Original comment by zexspect...@gmail.com on 6 Nov 2011 at 4:37

GoogleCodeExporter commented 9 years ago
Oops.. it didn't work for me because I specified incorrect directory for saving 
error reports. Now it works ok.

So, I couldn't reproduce your problem. Please answer the following questions if 
you want I help you:

1. What exactly version of CrashRpt do you use?
2. What exactly version of CrashRpt do you use crashrpt.php script from?

Original comment by zexspect...@gmail.com on 6 Nov 2011 at 4:47

GoogleCodeExporter commented 9 years ago
1. exactly the latest version: #define CRASHRPT_VER 1300
2. the one from the wiki: 
http://crashrpt.sourceforge.net/docs/html/sending_error_reports.html
3. the directory i use is for saving reports is: "./crash_reports", which is 
writable by anyone.  what's yours?

Original comment by anbaricf...@gmail.com on 6 Nov 2011 at 7:33

GoogleCodeExporter commented 9 years ago
I added this at the start of the PHP file:

--------------------
// Specify the directory where to save error reports
$file_root = "./reports/";

// Dump POST and GET to file
$fp = fopen($file_root."CrashRpt.log", 'w');

fwrite($fp, "POST Values\n---\n");
foreach ($_POST as $key => $value) {
    fwrite($fp, $key . ": " . $value . "\n");
}

fwrite($fp, "\nGET Values\n---\n");
foreach ($_GET as $key => $value) {
    fwrite($fp, $key . ": " . $value . "\n");
}

fclose($fp);
--------------------

and then created a crash.  the log file was created and shows this:

--------------------
POST Values
---

GET Values
---
--------------------

my initialization valuse are this:

    CFileRef        fileRef(CFileRef::kFile_EXE); fileRef.Ascend();

    i_msgStr.Set(SSLocalize("Please enter some detailed info about what you were doing right before the crash!", ""));
    i_appNameStr.Set((CFStringRef)CFBundleGetValueForInfoDictionaryKey(CFBundleGetMainBundle(), kCFBundleExecutableKey));
    i_langPath.Set(CFBundleCopyLocalizationPath(), false);
    i_exePath.Set(fileRef.path());
    i_versStr.Set(kString_Version);
    i_emailSubj.Set("Crash Report (Win) " APP_STR " " kString_Version);

    fileRef.SetDefault(CFileRef::kFolder_RES);
    fileRef.Descend("icons/kJams.ico");
    i_icoPath.Set(fileRef.path());

    {
        bool                    existsB = false;
        CFileRef                langFile(i_langPath);

        ETX(langFile.GetChild("CrashReport.strings", &existsB));
        if (!existsB) {
            langFile.Ascend();
            ETX(langFile.GetChild("English.lproj\\CrashReport.strings", &existsB));
            ETX(!existsB);
        }
        i_langPath = langFile.path();
    }

    structclr(i_info);
    i_info.cb                       = sizeof(CR_INSTALL_INFO);
    i_info.pszAppName               = i_appNameStr.w_str();
    i_info.pszAppVersion            = i_versStr.w_str();
    i_info.pszEmailTo               = _T("dave@kjams.com");  
    i_info.pszEmailSubject          = i_emailSubj.w_str();

    //  i_info.pszCrashSenderPath       = NULL means use default
    i_info.pfnCrashCallback         = CB_S_CrashCallback;

    i_info.pszUrl                   = _T("http://kjams.com/crash_reports/CrashRpt.php");
    i_info.uPriorities[CR_HTTP]     = 3;
    i_info.uPriorities[CR_SMAPI]    = 2;

    i_info.uPriorities[CR_SMTP]     = CR_NEGATIVE_PRIORITY; 
    i_info.dwFlags                  = CR_INST_ALL_EXCEPTION_HANDLERS | CR_INST_HTTP_BINARY_ENCODING | CR_INST_SEND_QUEUED_REPORTS;
    i_info.pszPrivacyPolicyURL      = _T("http://karaoke.kjams.com/wiki/KJams_Wiki:Privacy_policy");
    // i_info.pszDebugHelpDLL
    i_info.uMiniDumpType            = MiniDumpNormal;
    //  i_info.pszErrorReportSaveDir
    i_info.pszRestartCmdLine        = i_exePath.w_str();
    i_info.pszLangFilePath          = i_langPath.w_str();
    i_info.pszEmailText             = i_msgStr.w_str();
    // info.pszSmtpProxy
    i_info.pszCustomSenderIcon      = i_icoPath.w_str();

Original comment by anbaricf...@gmail.com on 6 Nov 2011 at 8:08

GoogleCodeExporter commented 9 years ago
You use a strange $file_root value "./reports". In Linux "." means the current 
folder.

For test I used CrashRptTest.exe from CrashRpt 1.3.0 distribution. I tried to 
recreate you PHP file. I use Apache under Windows and use 
$file_root="D:/crash_reports"; path. 

I have this log ():

POST Values
---
appname: CrashRpt Tests
appversion: 1.3.0.0
crashguid: 7203db3e-0c09-4142-b741-6bea4a826c6b
description: 
emailfrom: 
emailsubject: Error from CrashRptTests
md5: 1de602b75b251c9609017d5edc3613b4

GET Values
---

Everything works well. No ideas why your script doesn't work...

Original comment by zexspect...@gmail.com on 7 Nov 2011 at 2:29

GoogleCodeExporter commented 9 years ago
> You use a strange $file_root value "./reports". In Linux "." means 
> the current folder.

Yes, exactly.  The script itself is located, as you can see, at 
http://kjams.com/crash_reports/CrashRpt.php , which means i have the "reports" 
folder at http://kjams.com/crash_reports/reports/ , which is great.  

I'm also using Apache, under OS X Server (10.6.9, only cuz Lion is so crippled 
as a server)

I don't think it's my script?  I think perhaps it's "crash sender" ?

Original comment by anbaricf...@gmail.com on 7 Nov 2011 at 6:21

GoogleCodeExporter commented 9 years ago
I think "./reports" is not a good solution anyway. A good solution would be 
using paths relative to server root directory or relative to getdir(__FILE__). 
However, I'm not sure this is the reason of your problem.

Does the script you are currently using work with CrashRpt v1.2.10? 

Original comment by zexspect...@gmail.com on 8 Nov 2011 at 3:00

GoogleCodeExporter commented 9 years ago
> I think "./reports" is not a good solution anyway.
i understand your opinion but that's not the issue.

I am only using v1.3, i have no way of testing v1.2.10?  (without rebuilding my 
app around it?)

Original comment by anbaricf...@gmail.com on 9 Nov 2011 at 4:50

GoogleCodeExporter commented 9 years ago
I've added this to "HttpRequestSender.cpp" (i include surrounding lines so you 
can see where i added the extra:

at top of file:
#define     kLogTextParts       1

--------
    bRet= FormatTextPartHeader(sName, sHeader);
    if(!bRet)
    {
        m_Assync->SetProgress(_T("Error formatting text part header."), 0);
        return FALSE;
    } else {
        #if kLogTextParts
        m_Assync->SetProgress(_T("header:"), 0);
        m_Assync->SetProgress(sHeader, 0);
        #endif
    }
--------
        m_Assync->SetProgress(_T("Error searching for text part header name."), 0);
        return FALSE; 
    }

#if kLogTextParts
    m_Assync->SetProgress(_T("form:"), 0);
#endif
    size_t nDataSize = it->second.length();
--------
            std::string sBuffer = it->second.substr(pos, dwBytesRead);

        #if kLogTextParts
            m_Assync->SetProgress(CString(sBuffer.c_str()), 0);
        #endif

        DWORD dwBytesWritten = 0;
--------
    {
        m_Assync->SetProgress(_T("Error uploading text part footer."), 0);
        return FALSE;
    } else {
#if kLogTextParts
        m_Assync->SetProgress(_T("footer:"), 0);
        m_Assync->SetProgress(sFooter, 0);
#endif
    }
--------

that produced this log:
Sending HTTP request...
header:
--AaB03x5fs1045fcc7
Content-disposition: form-data; name="appname"

form:
kJams Pro
footer:

header:
--AaB03x5fs1045fcc7
Content-disposition: form-data; name="appversion"

form:
1.0d52r27
footer:

header:
--AaB03x5fs1045fcc7
Content-disposition: form-data; name="crashguid"

form:
236111c6-7941-468f-85d0-049ce0ae0b55
footer:

header:
--AaB03x5fs1045fcc7
Content-disposition: form-data; name="description"

form:
footer:

header:
--AaB03x5fs1045fcc7
Content-disposition: form-data; name="emailfrom"

form:
footer:

header:
--AaB03x5fs1045fcc7
Content-disposition: form-data; name="emailsubject"

form:
Crash Report (Win) kJams Pro 1.0d52r27
footer:

header:
--AaB03x5fs1045fcc7
Content-disposition: form-data; name="md5"

form:
91f0dd14f019dc30b5fa583a9826642b
footer:

Ending HTTP request...
----------------
and my PHP file WAS called on the server, producing the output:

POST Values
---

GET Values
---
------------------

so i'm at a total loss.  

Original comment by anbaricf...@gmail.com on 9 Nov 2011 at 5:29

GoogleCodeExporter commented 9 years ago
You can try to monitor a real HTTP trafic with some tool, for example Fiddler 
http://www.fiddler2.com/fiddler2/

It can show HTTP request data and actual server responce. So you will be able 
to see if this problem is on client side or on server side.

Original comment by zexspect...@gmail.com on 9 Nov 2011 at 3:25

GoogleCodeExporter commented 9 years ago
I plan to close this issue, because there is no responce from its reporter.

Original comment by zexspect...@gmail.com on 18 Nov 2011 at 2:56

GoogleCodeExporter commented 9 years ago
the issue is still open. do NOT close this until i have some time to debug it 
more using a monitor program as suggested.

Original comment by anbaricf...@gmail.com on 18 Nov 2011 at 3:17

GoogleCodeExporter commented 9 years ago
i finally got back around to investigating this issue, sorry it took so long.  
problem was on my end, i had a redirect at the server that was causing the 
problem.  removed redirect, problem gone.  you may close this bug.

Original comment by anbaricf...@gmail.com on 23 Feb 2012 at 11:00

GoogleCodeExporter commented 9 years ago

Original comment by zexspect...@gmail.com on 24 Feb 2012 at 2:58