http://bugs.winehq.org/show_bug.cgi?id=30353
Bug #: 30353 Summary: IEDriver from selenium crash Product: Wine Version: 1.5.1 Platform: x86 OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown AssignedTo: wine-bugs@winehq.org ReportedBy: fracting@gmail.com Classification: Unclassified
1. Download and install python26 from http://www.python.org/ftp/python/2.6/python-2.6.msi
2. Download and install easyinstall from http://pypi.python.org/packages/2.6/s/setuptools/setuptools-0.6c11.win32-py2...
3. start wine cmd, install Selenium with easyinstall : easyinstall selenium
3.5 winetricks wininet, works around Bug 30352
4. start the sample python-selenium script as attachment selenium-Ie.py : $ wine 'c:\python26\python.exe' selenium-Ie.py
$ ./selenium-Ie.sh
iexplore starts successfully, but then IEDriver of selenium crashes:
Backtrace: =>0 0x00d045d1 in iedriver (+0x845d1) (0x0262e460) 1 0x00c9fd1a in iedriver (+0x1fd19) (0x0262e4e0) 2 0x00ca9490 in iedriver (+0x2948f) (0x0262e538)
http://bugs.winehq.org/show_bug.cgi?id=30353
Qian Hong fracting@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download, source URL| |http://pypi.python.org/pypi | |/selenium
http://bugs.winehq.org/show_bug.cgi?id=30353
--- Comment #1 from Qian Hong fracting@gmail.com 2012-04-04 01:42:49 CDT --- Created attachment 39676 --> http://bugs.winehq.org/attachment.cgi?id=39676 Script: start iexplore with selenium
http://bugs.winehq.org/show_bug.cgi?id=30353
--- Comment #2 from Qian Hong fracting@gmail.com 2012-04-04 01:43:13 CDT --- Created attachment 39677 --> http://bugs.winehq.org/attachment.cgi?id=39677 Log: iexdriver crashes
http://bugs.winehq.org/show_bug.cgi?id=30353
Qian Hong fracting@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #39677|0 |1 is obsolete| |
--- Comment #3 from Qian Hong fracting@gmail.com 2012-04-07 06:39:29 CDT --- Created attachment 39707 --> http://bugs.winehq.org/attachment.cgi?id=39707 Log: backtrace with symbols
http://bugs.winehq.org/show_bug.cgi?id=30353
--- Comment #4 from Qian Hong fracting@gmail.com 2012-04-07 06:49:38 CDT --- I rebuild IEDriver with debugging symbols, when IEDriver crash, there is a dialog as below:
Microsoft Visual C++ Debug Library
Debug Assertion Failed!
Program: C:\python26\python.exe File: E:\Program Files\Mircosoft Visual Studion 10.0\VC\atlmfc\include\atlcomcli.h Line: 182
Expression: p!=0
For information on how your program can cause an assertion failure, see the Visual C++ documentation on asserts.
(Press Retry to debug the application)
http://bugs.winehq.org/show_bug.cgi?id=30353
Qian Hong fracting@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Depends on| |30352
http://bugs.winehq.org/show_bug.cgi?id=30353
--- Comment #5 from Qian Hong fracting@gmail.com 2012-10-21 07:44:51 CDT --- Still present in wine-1.5.15-204-g673617e
http://bugs.winehq.org/show_bug.cgi?id=30353
--- Comment #6 from Qian Hong fracting@gmail.com 2013-05-25 15:58:38 CDT --- ObjectFromLresult is a stub, cause IEDriver crashing.
Reference: http://support.microsoft.com/kb/249232/en
http://bugs.winehq.org/show_bug.cgi?id=30353
Qian Hong fracting@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever confirmed|0 |1
--- Comment #7 from Qian Hong fracting@gmail.com --- Piotr is working on it, I'm really exciting, thank you Piotr! http://source.winehq.org/patches/data/104176
http://bugs.winehq.org/show_bug.cgi?id=30353
Qian Hong fracting@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |piotr@codeweavers.com
--- Comment #8 from Qian Hong fracting@gmail.com --- Still crashing with Piotr's patches.
I initialize *ppObject to 0xdeadbeef, and found the crashing is still caused by ObjectFromLresult failure. I can't found corresponding LresultFromObject in the trace log, only ObjectFromLresult found. Maybe we need to implement ObjectFromLresult exactly like natives for compatibility, it is likely that something like lresult_atom_prefix is not compatible enough.
+ if(!ppObject) + return E_INVALIDARG; + *ppObject = (void *)0xdeadbeef;
002f:Call KERNEL32.GetProcAddress(7db40000,00babc40 "ObjectFromLresult") ret=00b93389 002f:Ret KERNEL32.GetProcAddress() retval=7db42be8 ret=00b93389 002f:Call oleacc.ObjectFromLresult(00000000,00ba859c,00000000,024be398) ret=00b933a1 002f:trace:oleacc:ObjectFromLresult 0 {332c4425-26cb-11d0-b483-00c04fd90119} 0 0x24be398 002f:Call KERNEL32.GlobalGetAtomNameW(00000000,024be2c2,00000027) ret=7db43014 002f:Ret KERNEL32.GlobalGetAtomNameW() retval=00000000 ret=7db43014 002f:Ret oleacc.ObjectFromLresult() retval=80004005 ret=00b933a1 002f:trace:seh:raise_exception code=c0000005 flags=0 addr=0xb9347f ip=00b9347f tid=002f 002f:trace:seh:raise_exception info[0]=00000000 002f:trace:seh:raise_exception info[1]=deadbeef 002f:trace:seh:raise_exception eax=deadbeef ebx=00000000 ecx=024be398 edx=7bcaaec0 esi=024be3d0 edi=024be8c0 002f:trace:seh:raise_exception ebp=024be3b0 esp=024be388 cs=0073 ds=007b es=007b fs=0033 gs=003b flags=00010282 002f:trace:seh:call_stack_handlers calling handler at 0xb9a520 code=c0000005 flags=0 002f:Call KERNEL32.GetLastError() ret=00b6af5f 002f:Ret KERNEL32.GetLastError() retval=00000057 ret=00b6af5f
Piotr, could you have a look at this bug? Thanks a lot!
http://bugs.winehq.org/show_bug.cgi?id=30353
--- Comment #9 from Qian Hong fracting@gmail.com --- This part of log seems related:
002f:Call user32.RegisterWindowMessageW(00babbb4 L"WM_HTML_GETOBJECT") ret=00b94273 002f:Ret user32.RegisterWindowMessageW() retval=0000c041 ret=00b94273 002f:Call KERNEL32.LoadLibraryW(00babbd8 L"OLEACC.DLL") ret=00b94281
http://support.microsoft.com/kb/249232 http://msdn.microsoft.com/en-us/library/windows/desktop/dd373892(v=vs.85).as...
https://bugs.winehq.org/show_bug.cgi?id=30353
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |focht@gmx.net Summary|IEDriver from selenium |selenium |crash |'InternetExplorerDriver' | |fails to retrieve | |IHTMLDocument COM object | |reference as LRESULT
--- Comment #10 from Anastasius Focht focht@gmx.net --- Hello folks,
the instructions need to be updated ...
You obviously need to download the actual server binary to have 'webdriver.Ie()' instancing work. 'easy_install selenium' doesn't do that automatically for you.
Download: https://selenium-release.storage.googleapis.com/2.41/IEDriverServer_Win32_2.... (and put it into path visible in PATH).
I didn't see bug 30352 (wininet?) please retest.
The selenium driver basically does this:
http://www.moshkin.info/blog/accessing-web-browsers-window-contents-from-ano...
--- snip --- IHTMLDocument* IHTMLDocumentFromHWND(HWND hWnd) { UINT WM_HTML_GETOBJECT = RegisterWindowMessage(_T("WM_HTML_GETOBJECT")); if (WM_HTML_GETOBJECT == 0) return NULL;
DWORD lResult = 0; SendMessageTimeout( hWnd, WM_HTML_GETOBJECT, 0, 0, SMTO_ABORTIFHUNG, 1000, &lResult );
if (lResult == NULL) return NULL;
IHTMLDocument* HTMLDocument; HRESULT hr = ObjectFromLresult( lResult, IID_IHTMLDocument, 0, (void**)&HTMLDocument );
if (FAILED(hr)) return NULL;
return HTMLDocument; } --- snip ---
Relevant trace log:
--- snip --- ... 0037:Call user32.RegisterWindowMessageW(100e2a20 L"WM_HTML_GETOBJECT") ret=10092456 0037:Ret user32.RegisterWindowMessageW() retval=0000c042 ret=10092456 0037:Call KERNEL32.LoadLibraryW(100e2a44 L"OLEACC.DLL") ret=10092464 0037:Call PE DLL (proc=0x7dde7040,module=0x7dde0000 L"oleacc.dll",reason=PROCESS_ATTACH,res=(nil)) 0037:trace:oleacc:DllMain 0x7dde0000, 1, (nil) ... 0037:Ret KERNEL32.LoadLibraryW() retval=7dde0000 ret=10092464 ... 0037:Call user32.SendMessageTimeoutW(000200a4,0000c042,00000000,00000000,00000002,000003e8,014ad774) ret=10090fd9 ... 0039:Call user32.PeekMessageW(0033f35c,00000000,00000000,00000000,00000001) ret=6af030c7 0039:Call window proc 0xf697c886 (hwnd=0x200a4,msg="WM_HTML_GETOBJECT",wp=00000000,lp=00000000) 0039:Call user32.GetPropW(000200a4,f69a7308 L"THIS") ret=f697c8e9 0039:Ret user32.GetPropW() retval=0016e968 ret=f697c8e9 0039:Call user32.DefWindowProcW(000200a4,0000c042,00000000,00000000) ret=f697cb0f 0039:Ret user32.DefWindowProcW() retval=00000000 ret=f697cb0f 0039:Ret window proc 0xf697c886 (hwnd=0x200a4,msg="WM_HTML_GETOBJECT",wp=00000000,lp=00000000) retval=00000000 0039:Ret user32.PeekMessageW() retval=00000001 ret=6af030c7 ... 0039:Call user32.TranslateMessage(0033f35c) ret=69d80b8d 0039:Ret user32.TranslateMessage() retval=00000000 ret=69d80b8d 0039:Call user32.DispatchMessageW(0033f35c) ret=69d80b99 0037:Ret user32.SendMessageTimeoutW() retval=00000001 ret=10090fd9 0039:Call window proc 0x69d80a44 (hwnd=0x100a8,msg="nsAppShell:EventID",wp=00000000,lp=012d0998) 0037:Call KERNEL32.GetProcAddress(7dde0000,100e303c "ObjectFromLresult") ret=10090fe8 0039:Ret window proc 0x69d80a44 (hwnd=0x100a8,msg="nsAppShell:EventID",wp=00000000,lp=012d0998) retval=00000001 0039:Ret user32.DispatchMessageW() retval=00000001 ret=69d80b99 ... 0037:Call oleacc.ObjectFromLresult(00000000,100de1ec,00000000,014ad830) ret=10091000 0037:trace:oleacc:ObjectFromLresult 0 {332c4425-26cb-11d0-b483-00c04fd90119} 0 0x14ad830 0037:Call KERNEL32.GlobalGetAtomNameW(00000000,014ad5a2,00000027) ret=7dde5f4c 0037:Ret KERNEL32.GlobalGetAtomNameW() retval=00000000 ret=7dde5f4c 0037:Ret oleacc.ObjectFromLresult() retval=80004005 ret=10091000 --- snip ---
$ wine --version wine-1.7.17-175-gc1bf61e
Regards
https://bugs.winehq.org/show_bug.cgi?id=30353
--- Comment #11 from Anastasius Focht focht@gmx.net --- Hello folks,
another code example from Microsoft, essentially doing the same thing:
https://support.microsoft.com/kb/249232 ("How to get IHTMLDocument2 from a HWND")
Regards
https://bugs.winehq.org/show_bug.cgi?id=30353 Bug 30353 depends on bug 30352, which changed state.
Bug 30352 Summary: builtin iexplore + selenium hangs on startup https://bugs.winehq.org/show_bug.cgi?id=30352
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |FIXED
https://bugs.winehq.org/show_bug.cgi?id=30353
Qian Hong fracting@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC|piotr@codeweavers.com |
--- Comment #12 from Qian Hong fracting@gmail.com --- Thanks Anastasius, great analysis again.
Workaround by winetricks -q ie7, so it seems like a mshtml bug or similar components now. oleacc works now, thanks Piotr, sorry for the noise, I'm going to remove you from the CC list to avoid further noise to you (again, hopefully you don't mind :p ), but really thank you for the oleacc work!
https://bugs.winehq.org/show_bug.cgi?id=30353
lizhenbo litimetal@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |litimetal@gmail.com
https://bugs.winehq.org/show_bug.cgi?id=30353
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Summary|selenium |selenium |'InternetExplorerDriver' |'InternetExplorerDriver' |fails to retrieve |fails to retrieve |IHTMLDocument COM object |IHTMLDocument COM object |reference as LRESULT |reference as LRESULT | |(WM_HTML_GETOBJECT message | |not handled) Component|-unknown |mshtml
--- Comment #13 from Anastasius Focht focht@gmx.net --- Hello folks,
revisiting, still present.
iexplorer out-of-proc server (mshtml): needs to handle WM_HTML_GETOBJECT, returning handle for client using LresultFromObject().
driver app / client: uses ObjectFromLresult() to convert the handle back to accessible object
Stable links to snapshots via Internet Archive:
https://web.archive.org/web/20100705235303/http://www.python.org/ftp/python/...
https://web.archive.org/web/20130306142711/http://pypi.python.org/packages/2...
https://web.archive.org/web/20200525213051/https://files.pythonhosted.org/pa...
https://web.archive.org/web/20140629184533/http://selenium-release.storage.g...
Original sites/pages gone, snapshots exist:
https://web.archive.org/web/20100729150345/http://www.moshkin.info/blog/acce...
https://web.archive.org/web/20070311122737/http://support.microsoft.com/kb/2...
$ wine --version wine-5.9
Regards