[ wxwindows-Bugs-1584387 ] wxProcess::IsInputAvailable()/IsErrorAvailable() crash

SourceForge.net noreply at sourceforge.net
Tue Jul 24 06:20:32 PDT 2007


Bugs item #1584387, was opened at 2006-10-25 12:28
Message generated for change (Comment added) made by pgsnake
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1584387&group_id=9863

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: wxMac specific
Group: None
>Status: Closed
Resolution: None
Priority: 5
Private: No
Submitted By: Dave Page (pgsnake)
Assigned to: Stefan Csomor (csomor)
Summary: wxProcess::IsInputAvailable()/IsErrorAvailable() crash

Initial Comment:
[Previously emailled to Stefan Csomor at his request]

I think I've uncovered another wxMac bug that shows up
in pgAdmin. In sysProcess::ReadInputStream() and
wxString sysProcess::ReadErrorStream() in *our* code
(see
http://svn.pgadmin.org/cgi-bin/viewcvs.cgi/trunk/pgadmin3/src/utils/sysProcess.cpp?rev=5466&view=markup)
it seems that doing anything other than just returning
wxEmptyString will cause a crash on Mac. Calling
IsInputAvailable() or IsErrorAvailable() and then
returning wxEmptyString will crash.

As you can see, the code is quite simple, and it works
perfectly on wxMSW. Any ideas?

Program received signal EXC_BAD_ACCESS, Could not
access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x0000002c
0x102c5e1c in wxProcess::IsInputAvailable (this=0x0) at
./src/common/process.cpp:126
126         return m_inputStream &&
m_inputStream->CanRead();
(gdb) bt
#0  0x102c5e1c in wxProcess::IsInputAvailable
(this=0x0) at ./src/common/process.cpp:126
#1  0x00218e78 in sysProcess::ReadInputStream
(this=0x0) at ./utils/sysProcess.cpp:73
#2  0x00169cc4 in ExternProcessDialog::checkStreams
(this=0x11069a00) at ./main/dlgClasses.cpp:637
#3  0x00169d38 in ExternProcessDialog::OnPollProcess
(this=0x11069a00, event=@0xbffff1c8) at
./main/dlgClasses.cpp:628
#4  0x1026bbd0 in wxAppConsole::HandleEvent
(this=0x10c25f90, handler=0x11069a00, func={__pfn =
(void ( wxEvtHandler::*)(wxEvent &,)) 185250, __delta =
0}, event=@0xbffff1c8) at ./src/common/appbase.cpp:321
#5  0x10313ba4 in wxEvtHandler::ProcessEventIfMatches
(entry=@0x4b3d68, handler=0x11069a00,
event=@0xbffff1c8) at ./src/common/event.cpp:1201
#6  0x10314204 in wxEventHashTable::HandleEvent
(this=0x4b2688, event=@0xbffff1c8, self=0x11069a00) at
./src/common/event.cpp:878
#7  0x10315b18 in wxEvtHandler::ProcessEvent
(this=0x11069a00, event=@0xbffff1c8) at
./src/common/event.cpp:1263
#8  0x0bfbc5b8 in wxTimerBase::Notify (this=0x146f49a0)
at ./src/common/timercmn.cpp:57
#9  0x0beddca0 in wxProcessTimer (theTimer=0x14850810,
data=0x146f49a0) at ./src/mac/carbon/timer.cpp:52
#10 0x907f0550 in __CFRunLoopDoTimer ()
#11 0x907dcec8 in __CFRunLoopRun ()
#12 0x907dc47c in CFRunLoopRunSpecific ()
#13 0x93208740 in RunCurrentEventLoopInMode ()
#14 0x93207dd4 in ReceiveNextEventCommon ()
#15 0x9330c940 in ReceiveNextEventInMode ()
#16 0x0be71f38 in wxApp::MacDoOneEvent
(this=0x10c25f90) at ./src/mac/carbon/app.cpp:1202
#17 0x0be9f7f4 in wxEventLoop::Dispatch
(this=0x13d265e0) at ./src/mac/carbon/evtloop.cpp:107
#18 0x0bf555a0 in wxEventLoopManual::Run
(this=0x13d265e0) at ./src/common/evtloopcmn.cpp:98
#19 0x0bf247d4 in wxAppBase::MainLoop (this=0x10c25f90)
at ./src/common/appcmn.cpp:264
#20 0x0bf24a68 in wxAppBase::OnRun (this=0x10c25f90) at
./src/common/appcmn.cpp:319
#21 0x102b02a4 in wxEntry (argc=@0xbffffc98,
argv=0x10c20fb0) at ./src/common/init.cpp:440
#22 0x102b03c0 in wxEntry (argc=@0xbffffc98,
argv=0xbffffd2c) at ./src/common/init.cpp:452
#23 0x00008128 in main (argc=1, argv=0xbffffd2c) at
./pgAdmin3.cpp:102
Current language:  auto; currently c++

----------------------------------------------------------------------

>Comment By: Dave Page (pgsnake)
Date: 2007-07-24 13:20

Message:
Logged In: YES 
user_id=1181215
Originator: YES

This no longer seems to be an issue in 2.8.x

----------------------------------------------------------------------

Comment By: Dave Page (pgsnake)
Date: 2006-10-25 20:53

Message:
Logged In: YES 
user_id=1181215

[Email to Stefan following his request for a test app]

In typical fashion, my standalone test case works perfectly,
despite being virtually identical in design to the actual
code in pgAdmin. I’m not convinced there isn’t a bug there
though – this code has been in pgAdmin for quite a while,
and still works fine with earlier versions of wxWidgets, or
on GTK/MSW. I’m beginning to wonder if some memory is
getting trashed which only shows up in the larger app.

Anyway, after much experimentation I’ve found a reasonably
clean workaround for pgAdmin so am not overly concerned
about releasing code with broken features. In case you’re
interested, I’ve attached my test code. Just drop it into a
copy of the minimal sample, compile, and execute a command
which outputs something to stdout/stderr over a period of at
least a few seconds.

I’ll add this note to the bug report, and leave it to you to
close it if you want.

Thanks, Dave.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1584387&group_id=9863




More information about the wx-dev mailing list