Opened 17 years ago
Closed 17 years ago
#2614 closed defect (fixed)
MythNews crash when news URL is incorrect
Reported by: | otto at kolsi dot fi | Owned by: | paulh |
---|---|---|---|
Priority: | minor | Milestone: | 0.21 |
Component: | mythnews | Version: | head |
Severity: | medium | Keywords: | |
Cc: | Ticket locked: | no |
Description
If one of the news sites in MythNews? contains wrong URL (the host part, e.g. www.something.com -> www1.something.com) and user presses couple of times (within 1-2 seconds) the RETRIEVENEWS button, MythNews? crashes with SIGSEGV. Crashing thread is in QSocket::connectToHost().
I've attached both frontend log with -v all and gdb backtrace.
Attachments (2)
Change History (8)
Changed 17 years ago by
Attachment: | mythfrontend.log added |
---|
comment:1 Changed 17 years ago by
Milestone: | unknown → 0.21 |
---|---|
Owner: | changed from Isaac Richards to stuartm |
comment:2 follow-up: 3 Changed 17 years ago by
The attached backtrace doesn't really help at all. It sounds like a race condition and I might stumble across a fix by trying a few things and crossing my fingers but I don't have mythnews installed or the time to do it.
You could try moving stop() from the end of NewsSite::slotFinished to the top. Or a more likely fix would be to block repeated calls to site->retrieve() while m_RetrieveTimer->isActive() or using another block flag.
MythNews::slotRetrieveNews is a little strange, it loops through the list of sites three times and calls site->stop() on each site twice (see cancelRetrieve()). One loop connects the NewsSite::finished signal, but retrieve isn't called until we reach the second loop. We also connect that signal every time the function is called and never disconnect it which I think has the potential to get very, very messy (single signal resulting in a slot be called several times over).
comment:3 Changed 17 years ago by
Replying to stuartm:
You could try moving stop() from the end of NewsSite::slotFinished to the top. Or a more likely fix would be to block repeated calls to site->retrieve() while m_RetrieveTimer->isActive() or using another block flag.
Tried to move the stop() but that didn't help. Also tried to play a bit with m_RetrieveTimer->isActive() and use it to block repeated calls, but without success. I'm not familiar with this signaling stuff so have to leave this to someone who can figure out what's going one.
One further note to anyone trying to reproduce this: crash occurs when pressing several times RETRIEVENEWS button iff user has beforehand pressed right so that news article section is active/focused (not the lefthand news-site list).
comment:4 Changed 17 years ago by
Owner: | changed from stuartm to Isaac Richards |
---|
Ok, well I can't figure out what's going wrong here, so I'm putting it back into the pool.
comment:5 Changed 17 years ago by
Owner: | changed from Isaac Richards to paulh |
---|
comment:6 Changed 17 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
(In [14376]) Fix a long standing problem in MythNews? were when trying to retrieve news articles from an unreachable URL it would more often than not cause a segfault. The actual fix is to not call QUrlOperator::stop() inside the finished() slot it's not needed anyway.
Also fixes a memory leak and cleans up connecting to some of the signals to make sure we only connect to each signal once.
Fixes #2614.
Frontend log with -v all