Opened 22 months ago

Last modified 5 weeks ago

#15207 new defect

Crash after repeatedly calling wxWebViewIE::Find()

Reported by: bitset Owned by:
Priority: normal Milestone:
Component: wxMSW Version:
Keywords: Cc: fred.wang@…
Blocked By: Blocking:
Patch: no

Description

Bug in src/msw/webview_ie.cpp (wxWebViewIE class). if you call the function "wxWebViewIE::Find(const wxString& text, int flags)" 8-10 times (search text must be on a page) - program received signal SIGSEGV, Segmentation fault. In RunHTMLApplication () (mshtml.dll).

Example code: ipcBrowser->Find(s, wxWEBVIEW_FIND_HIGHLIGHT_RESULT + wxWEBVIEW_FIND_WRAP);

Attachments (1)

webview_find_crash.cpp download (1.1 KB) - added by frederic_wang 5 weeks ago.
Testcase

Download all attachments as: .zip

Change History (13)

comment:1 Changed 22 months ago by vadz

  • Milestone 2.9.5 deleted
  • Status changed from new to infoneeded_new
  • Summary changed from Bug in src/msw/webview_ie.cpp to Crash after repeatedly calling wxWebViewIE::Find()

Is this reproducible in the sample?

comment:2 Changed 22 months ago by bitset

  • Status changed from infoneeded_new to new

Yes. One call into example code, but you just call Find more than 10 times and use the flags wxWEBVIEW_FIND_HIGHLIGHT_RESULT + wxWEBVIEW_FIND_WRAP.

comment:3 Changed 22 months ago by steve_lamerton

  • Status changed from new to confirmed

I can reproduce this when selecting Wrap and Highlight from the options menu of the Find toolbar in the sample. Will try and take a look into it in the next few days.

comment:4 Changed 22 months ago by SJL

(In [74020]) Use wxCOMPtr throughout the wxWebViewIE Find code.

As well as making the code a bit neater this seems to fix some memory issues.

See #15207.

comment:5 Changed 22 months ago by steve_lamerton

  • Status changed from confirmed to infoneeded_new

Could you test this again after the changes of r74020? They seem to fix the issue for me.

comment:6 Changed 22 months ago by bitset

  • Status changed from infoneeded_new to new

I will test tomorrow and let you know the result.

comment:7 Changed 22 months ago by bitset

wxWebViewIE::Find() still call segmentation fault.

comment:8 Changed 22 months ago by steve_lamerton

  • Status changed from new to infoneeded_new

Could you upload a stack trace? Unfortunately I cannot reproduce this any more after those changes.

comment:9 Changed 22 months ago by bitset

  • Status changed from infoneeded_new to new

If search string contains only 1 symbol (and page text contains this symbol):

Stack trace:

#0 7020301C wxWebViewIE::IsElementVisible(wxCOMPtr<IHTMLElement>) () (F:\bitset\mskp\src\bin\Debug\wxmsw295u_webview_gcc_custom.dll:??)
#1 7022B25A wxWebView::IsContextMenuEnabled() (F:\bitset\mskp\src\bin\Debug\wxmsw295u_webview_gcc_custom.dll:??)
#2 FEEEFEEE ?? () (??:??)

comment:10 Changed 21 months ago by steve_lamerton

  • Status changed from new to infoneeded_new

I am afraid that I still cannot reproduce this, is there a specific page I can test to see this? Also what compiler are you using?

comment:11 Changed 5 weeks ago by frederic_wang

  • Cc fred.wang@… added

Changed 5 weeks ago by frederic_wang

Testcase

comment:12 Changed 5 weeks ago by frederic_wang

  • Status changed from infoneeded_new to new

I attached a minimal testcase from which I can reproduce the crash (just execute the "Find" command from the menu). The crash does not happen with a different url (e.g. the wikipedia home page) or if we move the "Find" call into the MyFrame creation.

I'm using MSYS2/MINGW64 (http://sourceforge.net/projects/msys2/) on Windows 7 with the stable wxWidgets (3.0.2). I'm not able to produce a debug build from the source code (because of https://forums.wxwidgets.org/viewtopic.php?f=19&t=39234), so unfortunately I don't have a better stack trace...

0 0x000000006db03253 in ?? ()

from /mingw64/bin/wxmsw30u_webview_gcc_custom.dll

0x000000006db036ba in ?? ()

from /mingw64/bin/wxmsw30u_webview_gcc_custom.dll

0x000000006db04024 in ?? ()

from /mingw64/bin/wxmsw30u_webview_gcc_custom.dll

0x0000000000401b4c in MyFrame::OnFind (this=0x1d29830)

at C:/msys64/home/braillenet/wxwidgets/test/src/webview.cpp:48

Note: See TracTickets for help on using tickets.