MAPI 與 AmosConnect 間的記憶體存取錯誤

MVP 的問題點數還沒下來,所以這次我跟 Moli 又賒借了一個技術支援問題點數,最後確認過,這個問題有被扣點,因為這個問題「應該」發生在 AmosConnect 上,所以不算 bug ,問題是還沒結束,因為 AmosConnect 那邊還沒做最終回覆,不過大概是擺爛沒下文了,微軟這邊有問題關閉的壓力,就只好先把問題關了。
 

From: 鄭子璉
Sent: Thursday, January 10, 2008 5:52 PM
To: ‘mstcpss@mssupport.microsoft.com’
Subject: [VB2005]
此測試案例在 IDE 環境下可正常執行,直接執行執行檔無法正常執行

 

標題:

[VB2005] 此測試案例在 IDE 環境下可正常執行,直接執行執行檔無法正常執行

 

造成問題:

無法正確在客戶電腦執行指定動作

 

說明:

此專案需要在海上船舶電腦執行,故現地採 AmosConnector 軟體發送郵件,AmosConnector 為一播接衛星網路、傳真、收發電子郵件一體之軟體,並提供傳輸加強壓縮功能,在大多數商船上均採用此軟體進行與陸上船公司溝通。

軟體網頁說明請參閱:http://www.stratosglobal.com/products/page-products_valueAddedServices_amosConnect.cfm

軟體下載連結見上面網頁,摘在此處 (AmosConnector v7.4)ftp://ftp.amosconnect.com/amosconnect/amosconnect-current/AC-7.4.17.zip

 

 

重現步驟(產生之專案如附件壓縮檔):

0.

安裝AmosConnector v7.4 軟體於 WinXP/Win2003 (AmosConnector v7.4 Vista 上並不能被指定為預設郵件軟體),並透過網際網路選項、程式集設定為預設的郵件軟體。

 

1.

程式碼較為繁瑣,請直接利用附件專案開啟並執行,點選 Button 即可,專案已經過簡化整理。

 

2.

附件程式碼說明: Windows 2003 SP2下以 VB2005 開發環境執行後,可得正常顯示畫面,如圖,可透過 MAPI 操控該軟體崁入附件,並等待使用者確認送出,下圖右下方有 AmosConnect 軟體的畫面: 

 

關閉執行中的程式,改由檔案總管找出執行檔點選執行,則在呼叫 MAPISendMail 時發生下列錯誤,無法正確叫用軟體發信。 

 

 

MAPI.vb ( 204 ~ 221 )

Public Function SendMail(ByVal strSubject As String, ByVal strBody As String, Optional ByVal nFlags As MAPIConsts = MAPIConsts.LogonUI Or MAPIConsts.Dialog) As Integer

     Dim msg As MapiMessage = New MapiMessage()

     msg.Subject = strSubject

     msg.NoteText = strBody

 

     msg.recips = GetRecipients(msg.RecipCount)

     msg.Files = GetAttachments(msg.FileCount)

 

     Try

          m_lastError = MAPISendMail(m_Session, WindowHandle, msg, nFlags, 0)

     Catch ex As Exception

          MsgBox(ex.Message)

     End Try

 

     Cleanup(msg)

 

     Return m_lastError

End Function

 

 

3.

其它測試:

其他軟體如 Outlook / Outlook Express 則不論在 VB2005 開發環境或獨立執行檔下均可正確執行。

此問題同樣發生在客戶使用 Win2k / WinXP 之電腦上。

 

連絡資訊:

姓名:鄭子璉

電話:xxxxxxxxxx / xxxxxxxxx

技術支援服務合約編號:xxxxxxxxx (DPE 部門提供,若有疑問請洽副本收件者)

E-Mail xxxxxxx@xxxx.xxx.xxx , xxxxx@xxxxxx.xxx.xxx

 

背景:

以下軟體皆為繁體中文版 (MSDN VST )

OS: Windows 2003 R2 SP2 (2008/1/9) [Without .Net framework 2.0/3.0 SP1, Office 2007 SP1]

開發工具: Visual Studio Team Suite 2005 8.0.50727.762 (SP.050727-7600)


 

由於這個問題比較麻煩,微軟那邊希望先蒐集記憶體傾印 (memory dump) 來查找:
 

Sent: Tuesday, January 15, 2008 5:54 PM
To:
鄭子璉
Subject:
微軟回覆您的問題 [SRT080111816214] Visual Basic.NET程式在Visual Studio 2005 IDE環境下可正常執行,直接執行執行檔發生錯誤

 

先生您好:
謝謝您的來電。敝姓*,我是台灣微軟技術支援工程師,很榮幸有機會為您服務。[略]

問題代號: SRT080111816214


問題描述:

Visual Basic.NET程式使用MAPISendMail()透過AmosConnect送信,在Visual Studio 2005 IDE環境下可正常執行,直接執行執行檔發生錯誤:"嘗試讀取或寫入受保護的記憶體。這通常表示其他記憶體已毀損。"

 

後續處理事項:

麻煩您協助我們利用WinDbg工具收集memory dump檔案供我們分析。請您至下列網址下載Debugging Tools for Windows

http://www.microsoft.com/whdc/devtools/debugging/installx86.mspx

安裝之後請開啟命令提示列,切換到windbg.exe執行檔所在的目錄(預設為%Program Files%Debugging Tools for Windows)。

cscript adplus.vbs -quiet -crash -FullOnFirst -sc <ProcessName>

其中<ProcessName>為您的應用程式執行檔名稱。執行之後會載入您的應用程式執行,接著應該會產生一個新的目錄,裡面即是Crash Dump檔案(.dmp)

 

麻煩您利用下面的網址和密碼上傳您收集到的dump檔案供我們分析以協助您解決您的問題:

[網址與密碼省略]


經過翻查比對後,得到的問題發生點:
 

Sent: Wednesday, January 16, 2008 11:50 AM
 

[略] 

造成原因:

AmosConnectmssapi32.dll模組造成存取違規導致程式crash。請參考下列call stack資訊:

 

# ChildEBP RetAddr  Args to Child             

WARNING: Stack unwind information not available. Following frames may be wrong.

00 0012d310 18001cae 00000019 180ae1d4 0012d3a0 mssapi32!zipExtract+0x66c6

01 0012d338 18001d19 180ae260 180ae210 00000091 mssapi32+0x1cae

02 0012d360 180513fa 180ae260 180ae210 00000091 mssapi32+0x1d19

03 0012d380 18051689 180ae260 180ae210 00000091 mssapi32!dbsGetFldMem+0xa53

04 0012d3c0 18059121 00000005 0012e654 180d8e18 mssapi32!dbsGetFldMem+0xce2

05 0012e690 1805e868 1002bc40 1002bc38 36333141 mssapi32!dbsUpdateScanTask+0x303

06 0012e8fc 1805eced 1002bc40 00000000 00000001 mssapi32!dbsSetConfigString+0x17c

*** WARNING: Unable to verify checksum for ammapi32.dll

*** ERROR: Symbol file could not be found.  Defaulted to export symbols for ammapi32.dll –

07 0012e920 10004a25 1002bc40 00000000 0012ead8 mssapi32!dbsUpdateUser+0x24

08 0012e930 10003ba7 1002bc38 03d721e8 000d0700 ammapi32+0x4a25

09 0012ead8 1000437d 00000001 001b4898 00000008 ammapi32+0x3ba7

0a 0012ed4c 10006f95 1002bc38 001d1fb0 001d1fe0 ammapi32+0x437d

0b 0012ee60 10007825 1002bc38 000d0700 001b4898 ammapi32!MAPILogoff+0x375

0c 0012eeb4 79e79097 00000000 001afe98 001b4898 ammapi32!MAPISendMail+0x3d

0d 0012ef1c 00fb13be 1002bc38 000d0700 012cd478 mscorwks!PreStubWorker+0x130 [f:qfendpclrsrcvmprestub.cpp @ 917]

*** WARNING: Unable to verify checksum for System.Windows.Forms.ni.dll

0e 0012f020 7b060bdb 012cc26c 012bfedc 012bfd50 0xfb13be

0f 0012f034 7b1292e9 012bfd50 012cc26c 7b1293ef System_Windows_Forms_ni!TabToPreviousCell+0x1b0 [f:qfendpfxsrcWinFormsManagedSystemWinFormsDataGridViewMethods.cs @ 28249]

10 0012f040 7b1293ef 00000108 000000f4 00000071 System_Windows_Forms_ni!get_NeedsCommit+0x37 [f:qfendpfxsrcWinFormsManagedSystemWinFormsPropertyGridInternalPropertyGridView.cs @ 438]

11 0012f064 7b0f68c6 7b0619ee 012bfd50 00000071 System_Windows_Forms_ni!set_SelectedGridEntry+0x1a [f:qfendpfxsrcWinFormsManagedSystemWinFormsPropertyGridInternalPropertyGridView.cs @ 499]

12 0012f198 77e2c09f 00603650 00000000 003926ca System_Windows_Forms_ni!Compare+0x11 [f:qfendpfxsrcWinFormsManagedSystemWinFormsToolStripPanel.cs @ 1575]

13 000d0702 00000000 00000000 00000000 00000000 user32!CallNextHookEx+0x48 [d:ntwindowscorentuserclientwow.c @ 760]

 

解決方法:

請連絡原開發廠商尋求解決方法,或使用Outlook/Outlook Express進行收發信動作。


 
微軟說這個問題發生在 AmosConnect 的 ammapi32.dll 呼叫 mssapi32.dll ,也許是在 mssapi32.dll 自動呼叫函數 zipExtract 時,發生記憶體損毀,如果要繼續除錯這個問題,有兩個方式:
1. AmosConnect 提供除錯符號檔 (當編譯器使用除錯模式) 給台灣微軟,或
2. 我提供我的記憶體內容檔 (約 98 mb) 給 AmosConnect 來找出這個問題。
所以乖乖發信給廠商問看看,看是不是能提供符號檔 (Symbol files) ,中間有好幾封信啦,只列比較重要的:
 

From: 鄭子璉
Sent: Wednesday, January 16, 2008 10:28 PM
To: ‘Customer Support’
Subject: Ask the error message when using the AmosConnect

 

Dear Customer Support of STRATOSGLOBAL,

 

I am developing a software for Central Weather Bureau (CWB) of Taiwan in order to transfer meteorological data from ship to  CWB.  In the program, we would like to automatically call AmosConnect to send the data via email transformation because most of the ships use AmosConnect to transfer emails.

 

Now, I encounter a problem.  One error message happen when my program is going to call AMOS. The message is "Try to write into the protected memory area. This means some part of memory has been crashed".

I have been asked help from Microsoft Technical Support Division. They asked me to connect you.  We think we can find where the problem is by checking the symbol files of mssapi32.dll and ammapi32.dll within AmosConnect software.

Would you please offer me the file or help me to solve this problem ?

 

When I finish the program. CWB of Taiwan will push it to several big shipping companies. In the other point of view, it is to promote using AMOS.

 

In this email, I attach two files.  One is an execute file of a test program I developed. If you execute the file, you will see the error I met. The other file is its source code. Maybe you will need it or maybe you can help me to find the problem.

 

I appreciate for your help very much.

 

thanks and best regards

       

ps.

I have re-compressed my test program with WinRAR.  Attach files:

Ship.rar : source code of test progeam.

Ship.exe.rar : complied file (ship.exe) and symbol file (ship.pdb)

 

TLCheng

 

From: Customer Support
Sent: woensdag 16 januari 2008 15:36
To: Binnekade, Robert
Subject: FW: Ask the error message when using the AmosConnect

Hello Robert,

Can you review the below message and provide some guidance/feedback?

 

Best Regards,

________________________________________________________________________
Scott Ring| Customer Support Specialist
               Stratos 34 Glencoe Drive Mt Pearl, NL  A1E 2A4
               (p) 709-748-4226 (f) 709-748-4230 www.stratosglobal.com

 

From: Binnekade, Robert
Sent: Tuesday, January 22, 2008 12:59 AM
Subject: RE: Ask the error message when using the AmosConnect

 

Dear Mr. Cheng,

 

Thank you very much for your interest in our product. I appreciate the time and effort that you have put into this.

 

Unfortunately we don’t support direct VBS calls into our product and disallow any modification of it.

 

AmosConnect offers an API interface which can receive an email, extract the attachment and if neccessary start a script with configurable parameters. This is how for example the SPOS weather package works in combination with AmosConnect. Additionally we support standard Windows MAPI and a commandline interface.

 

Please let me know what information you require and I will be more than willing to help.

 

Best regards,

______________________________________________________________________

Robert Binnekade  |     International Product Manager 
                                  Stratos Loire 158-160 The Hague The Netherlands  
                                  (p) +31 70 3013237 (m) +31 6 53680230 
                                  www.stratosglobal.com


 
我再回:

From: 鄭子璉
Sent: Wednesday, January 23, 2008 2:45 PM
To: ‘Binnekade, Robert’
Subject: RE: Ask the error message when using the AmosConnect

 

Dear Robert Binnekade,

 

Thank you for your kindly reply.

I understood all you mentioned in the email.

Actually, I use VB2005 to call MAPI in order to connect AmosConnect in my program.  However some error happened which described in my privious email. It is shortly described again below.

 

I have ever asked the help from Microsoft Global Technical Support Center – Taiwan (MSGTSCT) about my problem. 

When they checked my program accroding to the contents of Memory Dump, they found the error happened when the AmosConnect ammapi32.dll (C:Program FilesAmosConnectAmMapi32.dll) calls mssapi32.dll (C:Program FilesAmosConnectMssApi32.dll).  They guessed that the memory may be crashed when mssapi32.dll is automatically calling the function zipExtract.  They suggested me two methods to solve the problem,

1.     AmosConnect offers symbol files (under th debug mode compiler) to MSGTSCT, therfore they can help me to find the problem

2.     I provide you (AmosConnect) my memory dump contents (98 MB) and ask you help to find this problem. 

 

Actually, I prefer to use the first solution.

Would you please give me any solutions or suggestions on this problem ?

 

thank you very very much

 

 

T.L. Cheng

 

From: Binnekade, Robert
Sent: Wednesday, January 23, 2008 2:46 PM
Subject: Out of Office AutoReply: Ask the error message when using the AmosConnect

 

Dear Sender,

I’m currently out of the office for business meetings. I’ll be back in the office on Thursday the 24th of January.

For technical issues regarding AmosConnect please contact Stratos Customer Support at support@stratosglobal.com

Best regards,
Robert Binnekade


The information contained in this email is strictly confidential and subject to the Confidentiality Notice at http://www.stratosglobal.com/email-privacy.html


 

然後到今天都還沒回應,微軟那邊又再問,只好先把問題關閉,有回應再說了。

 

From: Jonathan Chang [mailto:jonchan@microsoft.com]
Sent: Tuesday, January 29, 2008 2:56 PM
To:
鄭子璉

Subject:
微軟結案確認函 [SRT080111816214] Visual Basic.NET程式在Visual Studio 2005 IDE環境下可正常執行,直接執行執行檔發生錯誤

 

先生您好:
謝謝您的來電。敝姓,我是台灣微軟技術支援工程師,很榮幸有機會為您服務。關於您遇到的問題,請參考以下報告。 

 

關於這個 case 和您在電話中確認過,您並同意此 case結案,請參考下列此 case 的處理報告。

[略] 

問題狀況:  結案

 

技術支援工程師 Support Engineer
Developer Support Team

Global Technical Support Center – Taiwan

技術支援服務首頁: http://support.microsoft.com

技術支援專線: 0800-008-833(市話專用)/ 02-2999-8833

 

廣告
Categories: 更新與回報 | 發表留言

文章分頁導航

發表迴響

在下方填入你的資料或按右方圖示以社群網站登入:

WordPress.com Logo

您的留言將使用 WordPress.com 帳號。 登出 / 變更 )

Twitter picture

您的留言將使用 Twitter 帳號。 登出 / 變更 )

Facebook照片

您的留言將使用 Facebook 帳號。 登出 / 變更 )

Google+ photo

您的留言將使用 Google+ 帳號。 登出 / 變更 )

連結到 %s

在 WordPress.com 建立免費網站或網誌.

%d 位部落客按了讚: