Opened 14 years ago
Closed 13 years ago
#8986 closed patch (Fixed)
mythfilldatabase hangs on MacOS in QFSFileEnginePrivate::nativeRead
Reported by: | Owned by: | Nigel | |
---|---|---|---|
Priority: | minor | Milestone: | unknown |
Component: | MythTV - Mythfilldatabase | Version: | 0.23-fixes |
Severity: | medium | Keywords: | |
Cc: | Ticket locked: | no |
Description
I have a patch that fixes (works around) the hang in mythfilldatabase on MacOS.
According to some old posts, this bug appeared in 0.22 and is still present in 0.23. It worked fine in 0.21.
Reference post with stack trace:
I have been running for several days with my patch, and it's working well. I am using 0.23-fixes.
The bug is that QFSFileEnginePrivate::nativeRead does not correctly exit from its read loop when the end-of-stream is reached. Instead, it gets stuck in a loop with errno==EINTR.
GDB backtrace:
- 0 0x9029d153 in fgetc ()
- 1 0x8ea6acee in QFSFileEnginePrivate::nativeRead ()
- 2 0x8ea2e1e0 in QFile::readData ()
- 3 0x8ea34440 in QIODevice::read ()
- 4 0x8cfb397e in copy ()
Though the actual bug is likely down inside Qt, isolating that with a proper test case and producing a safe/correct fix is too high a barrier, so I hope this workaround will suffice for now.
./mythbackend.intel --version Please attach all output as a file in bug reports. MythTV Version : 25586 MythTV Branch : branches/release-0-23-fixes Network Protocol : 23056 Library API : 0.23.1.201000710-1 QT Version : 4.6.0 Options compiled in:
debug darwin_da using_corevideo using_backend using_darwin using_disable_mmx_for_debugging using_firewire using_frontend using_hdhomerun using_iptv using_lirc using_mheg using_opengl_video using_qtwebkit using_appleremote using_bindings_perl using_bindings_python using_darwin_da using_opengl using_ffmpeg_threads using_live using_mheg
Attachments (1)
Change History (6)
Changed 14 years ago by
Attachment: | streamReadPatch.patch added |
---|
comment:1 Changed 14 years ago by
Owner: | changed from stuartm to Nigel |
---|---|
Status: | new → assigned |
comment:2 Changed 14 years ago by
comment:3 Changed 14 years ago by
I'm using SchedulesDirect? in the US, for which I believe mythfilldatabase uses wget (streaming to stdout).
Here's a dump from my console the night I was working on this.
- Normally it would hang at the end of the transfer, right before printing this line:
2010-09-18 00:48:33 (38.9 KB/s) - `-' saved [324228]
- I built everything debug and then stopped in the debugger... at the point that it was hung, the number of bytes read was equal to the filesize in bytes (in util.cpp), but the Qt reader kept returning errno==EINTR and never coming back.
$ ./mythfilldatabase 2010-09-18 00:48:18.330 Using runtime prefix = /Users/andy/mythsrc/packaging/OSX/build/.osx-packager/build/bin 2010-09-18 00:48:18.344 Using configuration directory = /Users/andy/.mythtv 2010-09-18 00:48:18.354 Using localhost value of tinymac 2010-09-18 00:48:18.357 New DB connection, total: 1 2010-09-18 00:48:18.365 Connected to database 'mythconverg' at host: XXX 2010-09-18 00:48:18.365 Closing DB connection named 'DBManager0' 2010-09-18 00:48:18.366 Connected to database 'mythconverg' at host: XXX 2010-09-18 00:48:18.370 Current MythTV Schema Version (DBSchemaVer): 1254 2010-09-18 00:48:18.373 New DB connection, total: 2 2010-09-18 00:48:18.374 Connected to database 'mythconverg' at host: XXX 2010-09-18 00:48:23.860 Updating source #1 (Comcast Cable) with grabber schedulesdirect1 2010-09-18 00:48:23.861 Found 59 channels for source 1 which use grabber 2010-09-18 00:48:23.865 2010-09-18 00:48:23.865 Checking day @ offset 0, date: Sat Sep 18 2010 2010-09-18 00:48:23.937 Data is already present for Sat Sep 18 2010, skipping 2010-09-18 00:48:23.939 2010-09-18 00:48:23.939 Checking day @ offset 1, date: Sun Sep 19 2010 2010-09-18 00:48:23.939 Data Refresh always needed for tomorrow 2010-09-18 00:48:23.939 Refreshing data for Sun Sep 19 2010 2010-09-18 00:48:23.939 This DataDirect listings source is shared by 4 MythTV lineups 2010-09-18 00:48:23.940 We should keep data around after this one 2010-09-18 00:48:23.940 New DB DataDirect connection 2010-09-18 00:48:23.941 Connected to database 'mythconverg' at host: XXX 2010-09-18 00:48:23.942 Retrieving datadirect data. 2010-09-18 00:48:23.942 Grabbing data for Sat Sep 18 2010 offset 1 2010-09-18 00:48:23.943 From Sun Sep 19 05:00:00 2010 to Mon Sep 20 05:00:00 2010 (UTC) 2010-09-18 00:48:23.944 Grabbing listing data 2010-09-18 00:48:23.946 DataDirect: Saving listings to DD cache --2010-09-18 00:48:24-- http://webservices.schedulesdirect.tmsdatadirect.com/schedulesdirect/tvlistings/xtvdService Resolving webservices.schedulesdirect.tmsdatadirect.com... 144.142.232.53 Connecting to webservices.schedulesdirect.tmsdatadirect.com|144.142.232.53|:80... connected. HTTP request sent, awaiting response... 401 Unauthorized Connecting to webservices.schedulesdirect.tmsdatadirect.com|144.142.232.53|:80... connected. HTTP request sent, awaiting response... 200 OK Length: unspecified [text/xml] Saving to: `STDOUT' [ <=> ] 324,228 54.0K/s in 8.1s 2010-09-18 00:48:33 (38.9 KB/s) - `-' saved [324228] 2010-09-18 00:48:33.273 New DB connection, total: 3 2010-09-18 00:48:33.274 Connected to database 'mythconverg' at host: XXX 2010-09-18 00:48:33.292 DataDirect: Your subscription expires on Sun Jun 19 (2011) 10:55 PM 2010-09-18 00:48:33.419 sourceid 1 has lineup type: Cable 2010-09-18 00:48:33.489 sourceid 4 has lineup type: CableDigital 2010-09-18 00:48:33.502 sourceid 2 has lineup type: LocalBroadcast 2010-09-18 00:48:46.859 Grab complete. Actual data from Sun Sep 19 05:00:00 2010 to Mon Sep 20 05:00:00 2010 (UTC) 2010-09-18 00:48:46.861 Main temp tables populated. 2010-09-18 00:48:46.861 Updating myth channels. 2010-09-18 00:48:46.876 IconData: Updating icons for sourceid: 1 2010-09-18 00:48:46.877 Channels updated. 2010-09-18 00:48:47.143 Clearing data for source. 2010-09-18 00:48:47.143 Clearing from Sun Sep 19 00:00:00 2010 to Mon Sep 20 00:00:00 2010 (localtime) 2010-09-18 00:48:48.424 Data for source cleared. 2010-09-18 00:48:48.424 Updating programs. 2010-09-18 00:48:50.180 Program table update complete. 2010-09-18 00:48:50.181 2010-09-18 00:48:50.181 Checking day @ offset 2, date: Mon Sep 20 2010 2010-09-18 00:48:50.287 Data is already present for Mon Sep 20 2010, skipping 2010-09-18 00:48:50.288 ... ...
comment:4 Changed 13 years ago by
Andy, sorry for the lack of action on this. However, last week myth_system() had a major re-write committed, and most of the bugs are ironed out. Any chance of testing with a vanilla Qt, and recent trunk? (e.g. 55661dbf7)
Haven't reproduced yet. tested OK with mythfilldatabase --file, and invoking XMLTV grabber:
with recent binary: