id	summary	reporter	owner	description	type	status	priority	component	version	resolution	keywords	cc	guest	host
4157	Hang under VBoxGlobal::documentsPath because QDir::cdUp isn't checked for failure => Fixed in SVN	timeless		Mac OS X 10.5.7, ZFS /Users/timeless (among others) [=home directory]\r\n\r\nSteps:\r\n1. run virtualbox\r\n2. select file>Import Appliance\r\n\r\nactual results:\r\nVirtualBox.app burns cpu until I realize it's killing my battery.\r\n\r\nI don't have a Guest yet, I was trying to import a QNX VMWare file (just for kicks). But it seems clear that this won't work on my system (I don't need the file, I was just curious).\r\n\r\n{{{\r\n(gdb) bt\r\n#0  0x95a262c2 in lstat ()\r\n#1  0x010dc090 in QFSFileEnginePrivate::isSymlink ()\r\n#2  0x010dddbe in QFSFileEngine::fileFlags ()\r\n#3  0x0108937b in QDir::exists ()\r\n#4  0x003b99d0 in VBoxGlobal::documentsPath ()\r\n#5  0x004aca73 in VBoxImportApplianceWzd::VBoxImportApplianceWzd ()\r\n#6  0x003f2dfa in VBoxSelectorWnd::fileImportAppliance ()\r\n#7  0x004b8b27 in VBoxSelectorWnd::qt_metacall ()\r\n#8  0x011113f0 in QMetaObject::activate ()\r\n#9  0x0124acac in QAction::triggered ()\r\n#10 0x0124c82f in QAction::activate ()\r\n#11 0x016cbf19 in qt_mac_activate_action ()\r\n#12 0x016cc529 in qt_mac_menu_event ()\r\n#13 0x905cb11d in DispatchEventToHandlers ()\r\n#14 0x905ca55b in SendEventToEventTargetInternal ()\r\n#15 0x905e6eac in SendEventToEventTarget ()\r\n#16 0x9061b1c7 in SendHICommandEvent ()\r\n#17 0x90641939 in SendMenuCommandWithContextAndModifiers ()\r\n#18 0x906418f4 in SendMenuItemSelectedEvent ()\r\n#19 0x9064180a in FinishMenuSelection ()\r\n#20 0x9061e474 in MenuSelectCore ()\r\n#21 0x906ad030 in MenuSelect ()\r\n#22 0x012ac2f2 in QApplicationPrivate::globalEventProcessor ()\r\n#23 0x905cb11d in DispatchEventToHandlers ()\r\n#24 0x905ca55b in SendEventToEventTargetInternal ()\r\n#25 0x905e6eac in SendEventToEventTarget ()\r\n#26 0x905f95e3 in ToolboxEventDispatcherHandler ()\r\n#27 0x905cb4d6 in DispatchEventToHandlers ()\r\n#28 0x905ca55b in SendEventToEventTargetInternal ()\r\n#29 0x905e6eac in SendEventToEventTarget ()\r\n#30 0x012a5401 in qt_mac_send_event ()\r\n#31 0x012b3a42 in QEventDispatcherMac::processEvents ()\r\n#32 0x010ff2a1 in QEventLoop::processEvents ()\r\n#33 0x010ff36d in QEventLoop::exec ()\r\n#34 0x01103301 in QCoreApplication::exec ()\r\n#35 0x003a3623 in TrustedMain ()\r\n#36 0x0000374c in SUPR3HardenedMain ()\r\n#37 0x00002be1 in main ()\r\n(gdb) finish\r\nRun till exit from #0  0x95a262c2 in lstat ()\r\n0x010dc090 in QFSFileEnginePrivate::isSymlink ()\r\n(gdb) \r\nRun till exit from #0  0x010dc090 in QFSFileEnginePrivate::isSymlink ()\r\n0x010dddbe in QFSFileEngine::fileFlags ()\r\n(gdb) \r\nRun till exit from #0  0x010dddbe in QFSFileEngine::fileFlags ()\r\n0x0108937b in QDir::exists ()\r\n(gdb) \r\nRun till exit from #0  0x0108937b in QDir::exists ()\r\n0x003b99d0 in VBoxGlobal::documentsPath ()\r\n(gdb) \r\nRun till exit from #0  0x003b99d0 in VBoxGlobal::documentsPath ()\r\n^C\r\nProgram received signal SIGINT, Interrupt.\r\n0x95a01312 in stat ()\r\n(gdb) bt\r\n#0  0x95a01312 in stat ()\r\n#1  0x010dbf95 in QFSFileEnginePrivate::doStat ()\r\n#2  0x010dda56 in QFSFileEngine::fileFlags ()\r\n#3  0x010979e1 in QFileInfoPrivate::getFileFlags ()\r\n#4  0x01097d8c in QFileInfo::exists ()\r\n#5  0x010902d0 in QDir::cd ()\r\n#6  0x010907fd in QDir::cdUp ()\r\n#7  0x003b99c8 in VBoxGlobal::documentsPath ()\r\n....\r\n}}}\r\n\r\nSo. I'm aware that this is mostly a bug between Qt and zfs, but this is the only application I have which triggers an infinite loop.\r\n\r\n{{{\r\ntimeless-mbp:~ timeless$ df\r\nFilesystem                                                            512-blocks      Used Available Capacity  Mounted on\r\n/dev/disk0s2                                                            71041024  25500488  45028536    37%    /\r\nrpool/export/home/timeless                                             292480799  18353406 274127393     7%    /Users/timeless\r\n\r\ntimeless-mbp:~ timeless$ df /Users/timeless/Documents\r\nFilesystem                 512-blocks     Used Available Capacity  Mounted on\r\nrpool/export/home/timeless  292480796 18353406 274127390     7%    /Users/timeless\r\n\r\ntimeless-mbp:~ timeless$ mount |grep 'rpool/export/home/timeless '\r\nrpool/export/home/timeless on /Users/timeless (zfs, local)\r\n}}}\r\n\r\nI'm using zfs 119\r\n\r\nThe code is looping here:\r\n\r\n{{{\r\n4828 /* static */\r\n4829 QString VBoxGlobal::documentsPath()\r\n4830 {\r\n4831     QString path;\r\n4835     path = QDesktopServices::storageLocation (QDesktopServices::DocumentsLocation);\r\n4839     QDir dir (path);\r\n4840     while (!dir.exists())\r\n4841         dir.cdUp();\r\n}}}\r\n\r\nhttp://doc.trolltech.com/4.5/qdir.html#cdUp\r\n\r\nbool QDir::cdUp ()\r\n\r\nChanges directory by moving one directory up from the QDir's current directory.\r\n\r\nReturns true if the new directory exists and is readable; otherwise returns false. Note that the logical cdUp() operation is not performed if the new directory does not exist.\r\n\r\nI haven't checked, but cdUp clearly can return an error and the code clearly isn't checking for the error, so I believe the code should be fixed.	defect	closed	major	GUI	VirtualBox 2.2.4	fixed			other	Mac OS X
