Opened 9 years ago

Closed 2 years ago

#3183 closed defect (outdated)

strconv.cpp goes into endless loop

Reported by: mbabuskov Owned by:
Priority: normal Milestone:
Component: wxHtml Version:
Keywords: Cc: mbabuskov, jdallaway
Blocked By: Blocking:
Patch: no

Description

It only happens in Ansi debug build. The program simply
hangs after a wxHtmlWindow::SetPage call. Looking at
backtrace it looks like it runs into "invalid encoding
value in wxCSConv ctor", which throws an exception and
calls wxStackWalker which tries to create the report:
while it tries to create a report string, it runs into
same wxCSConv problem and we get endless loop.

No need to mention that program just consumes 100% and
just sits there doing nothing (except eating memory).

When I run html/about sample, and select File->About
from menu I get the dialog with following message:

Failed to display HTML document in ISO-8859-1 encoding.

after which is displays the about box nicely.

Now, my diagnosis might be wrong, so I supply the full
backtrace I managed to catch when I attached to a
running program with gdb.

The same code works properly with wx2.6.2, and makes
program hang with wx2.6.3. The program we're talking
about it FlameRobin, and source is available in our
Subversion repository if someone cares to review it:

https://svn.sourceforge.net/svnroot/flamerobin/trunk/flamerobin

(gdb) run
Starting program:
/home/milanb/devel/svn/flamerobin/debug263/flamerobin
[Thread debugging using libthread_db enabled]
[New Thread -1219758400 (LWP 21819)]
Detaching after fork from child process 21823.
Detaching after fork from child process 21824.
Detaching after fork from child process 21825.
Detaching after fork from child process 21826.
Detaching after fork from child process 21827.
Detaching after fork from child process 21828.
Detaching after fork from child process 21829.
Detaching after fork from child process 21830.
etc.

It just keeps going.

I killed the original process, so I could get back to
gdb, and then ran
"bt" to get the following:

...
Detaching after fork from child process 21846.

Program received signal SIGTERM, Terminated.
[Switching to Thread -1219758400 (LWP 21819)]
0xb77e50e5 in fork () from /lib/tls/libc.so.6
(gdb) bt
#0 0xb77e50e5 in fork () from /lib/tls/libc.so.6
#1 0xb77b1341 in _IO_proc_open@@GLIBC_2.1 () from
/lib/tls/libc.so.6
#2 0xb77b15cc in popen@@GLIBC_2.1 () from
/lib/tls/libc.so.6
#3 0x083c190a in wxStdioPipe (this=0xbfcc6e00,

command=0x86860ec "addr2line -C -f -e

\"/home/milanb/devel/svn/flamerobin/debug263/flamerobin\"
0x80c5532",
type=0x8468e6e "r")

at ./src/unix/stackwalk.cpp:53

#4 0x083c132d in wxStackFrame::OnGetLocation
(this=0xbfcc6f30)

at ./src/unix/stackwalk.cpp:160

#5 0x083c100a in wxStackFrame::OnGetName (this=0xbfcc6f30)

at ./src/unix/stackwalk.cpp:92

#6 0x08369bac in wxStackFrameBase::GetName
(this=0xbfcc6f30) at
stackwalk.h:52
#7 0x0836955b in OnStackFrame (this=0xbfcc72e0,
frame=@0xbfcc6f30)

at ./src/common/appbase.cpp:726

#8 0x083c17fd in wxStackWalker::Walk (this=0xbfcc72e0,
skip=5)

at ./src/unix/stackwalk.cpp:234

#9 0x0836916a in GetAssertStackTrace () at
./src/common/appbase.cpp:756
#10 0x0836937b in ShowAssertDialog (

szFile=0x84667d1 "./src/common/strconv.cpp",

nLine=2464,

szCond=0x8466958 "wxAssertFailure",
szMsg=0x8466930 "invalid encoding value in wxCSConv

ctor",

traits=0x8626f80) at ./src/common/appbase.cpp:800

#11 0x08368c86 in wxAppConsole::OnAssert (this=0x8566280,

file=0x84667d1 "./src/common/strconv.cpp", line=2464,

---Type <return> to continue, or q <return> to quit---

cond=0x8466958 "wxAssertFailure",
msg=0x8466930 "invalid encoding value in wxCSConv

ctor")

at ./src/common/appbase.cpp:457

#12 0x0823f018 in wxApp::OnAssert (this=0x8566280,

file=0x84667d1 "./src/common/strconv.cpp", line=2464,
cond=0x8466958 "wxAssertFailure",
msg=0x8466930 "invalid encoding value in wxCSConv

ctor")

at ./src/gtk/app.cpp:728

#13 0x08368f4f in wxOnAssert (szFile=0x84667d1
"./src/common/strconv.cpp",

nLine=2464, szCond=0x8466958 "wxAssertFailure",
szMsg=0x8466930 "invalid encoding value in wxCSConv

ctor")

at ./src/common/appbase.cpp:645

#14 0x08368edb in wxAssert (cond=0,

szFile=0x84667d1 "./src/common/strconv.cpp",

nLine=2464,

szCond=0x8466958 "wxAssertFailure",
szMsg=0x8466930 "invalid encoding value in wxCSConv

ctor")

at ./src/common/appbase.cpp:612

#15 0x083ac34b in wxCSConv (this=0xbfcc7470,
encoding=wxFONTENCODING_DEFAULT)

at ./src/common/strconv.cpp:2464

#16 0x081f6fd5 in wxHTML_Handler_TITLE::HandleTag
(this=0x86773d8,

tag=@0x8686980) at ./src/html/m_layout.cpp:304

#17 0x08209ff7 in wxHtmlParser::AddTag (this=0x8674b00,
tag=@0x8686980)

at ./src/html/htmlpars.cpp:334

#18 0x08209f4e in wxHtmlParser::DoParsing
(this=0x8674b00, begin_pos=47,
---Type <return> to continue, or q <return> to quit---

end_pos=48) at ./src/html/htmlpars.cpp:318

#19 0x0820a049 in wxHtmlParser::AddTag (this=0x8674b00,
tag=@0x8686930)

at ./src/html/htmlpars.cpp:341

#20 0x08209f4e in wxHtmlParser::DoParsing
(this=0x8674b00, begin_pos=55,

end_pos=3094) at ./src/html/htmlpars.cpp:318

#21 0x0820a049 in wxHtmlParser::AddTag (this=0x8674b00,
tag=@0x8678888)

at ./src/html/htmlpars.cpp:341

#22 0x08209f4e in wxHtmlParser::DoParsing
(this=0x8674b00, begin_pos=3101,

end_pos=3102) at ./src/html/htmlpars.cpp:318

#23 0x08209cb2 in wxHtmlParser::DoParsing (this=0x8674b00)

at ./src/html/htmlpars.cpp:280

#24 0x0820963b in wxHtmlParser::Parse (this=0x8674b00,
source=@0xbfcc7770)

at ./src/html/htmlpars.cpp:113

#25 0x081e2e01 in wxHtmlWindow::SetPage
(this=0x86748e0, source=@0x8674af0)

at ./src/html/htmlwin.cpp:323

#26 0x080d5116 in
MetadataItemPropertiesFrame::processHtmlFile (

this=0x8674148, fileName=

{<wxStringBase> = {static npos = 4294967295,

m_pchData =
0x8682894 "<html>\n<head>\n <title>Table
properties</title>\n</head>\n<body>\n<a\n
href=\"fr://page?type=constraints&parent_window=140984648\">Constraints</a>
| <a\n
href=\"fr://page?type=triggers&parent_window=1"...},
<No data
fields>})

at ../src/gui/MetadataItemPropertiesFrame.cpp:657

#27 0x080d57bd in MetadataItemPropertiesFrame::loadPage
(this=0x8674148)

at string.h:224

...the rest leads to event that started it.

The same code works fine with 2.5.3, 2.5.4, 2.6.0 and
2.6.2. (I haven't tried other versions). The problem
does not appear in Unicode build.

Change History (4)

comment:1 Changed 7 years ago by jdallaway

Was this issue ever resolved for wxWidgets 2.6.3?

comment:2 Changed 6 years ago by wojdyr

  • Component set to wxHtml

Do you see this problem in 2.8 or 2.9?

comment:3 Changed 2 years ago by oneeyeman

According to the OP it happens in ANSI build only.
Since this configuration was dropped and there is no sample page to test with I'd consider this bug outdated.

comment:4 Changed 2 years ago by vadz

  • Resolution set to outdated
  • Status changed from new to closed

I don't think this problem exists in neither 2.8 nor 2.9, even in ANSI build.

Note: See TracTickets for help on using tickets.