-
Notifications
You must be signed in to change notification settings - Fork 594
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Geany crashes when opening many files at once #3209
Comments
Without more info its hard to help you, but I'm pretty sure Windows users have opened more than 30 files. |
The problem does happen only if you select many files to open at once in the file open dialog. What other info can I give you to help pinpointing the problem? I'm using Geany last version, 1.38 on windows 10 latest release. |
Sorry, now I tested this again now and it's not crashing but refuses to load one of the files giving this error: Could not open file "path_to_filename(some chinese chars instead of the correct file extension)" (Error when getting information for file "path_to_filename(some chinese chars instead of the correct file extension)": no such file or directory this does NOT happen if the very same file is opened as a single file! |
What locale is set? Do the filenames (that fail) have any non-ASCII characters in them? Are the filenames stored in a different encoding? |
Geany locale is en ; the filenames have no non ascii char, and the file content is utf-8 encoded php and html source code. |
I cannot reproduce on Windows 7 with about 60 PHP files and 50 C files. All files open properly, from the GTK file dialog as well as from the native Windows file dialog and also using Drag'n'Drop from the Windows Explorer. I'm wondering about the Chinese characters you mentioned. Do you have any idea where they might come from? Could you provide the full debug log (Help->Debug Messages) and maybe a list of the filenames? |
Those could be ANSI file paths being rendered as multi-byte streams; forcefully casting a @ShoresOfNowhere, have you checked whether Unicode encoding has been activated on your PC?
|
Sorry for the delay, I wasn't connected; Checked the setting you told me, it was and it is unckeched. |
Here's the "official" explanation, courtesy of Raymond Chen:
|
@ShoresOfNowhere you said that the setting @rdipardo mentioned was unset, did you set it and see what happened? Also you said the locale was Which Geany open dialog are you using? The GTK one or the windows native one? (Edit->Preferences->General->Miscellaneous->Use Windows Native Dialogs`) |
Hello! I have files listed below in a folder and geany crashes when loading all. Doesnt matter if they are empty (echo or type NUL > filename) or real registry files (reg export KEY FILENAME). It must be names. No troubles with files named 01.txt - 20.txt (total 20 txt files opened without crash). W7x64. And when selecting 3 files - 04, 05, 06, program doesnt crash but opens only 2 and gives error. HTH.
PS. Just remembered that I had also bunch of real registry files, but named as "disable_this_setting.reg", "remove-this_thing.reg" etc. This is the result
|
@yekb @ShoresOfNowhere Since the Geany devs can't reproduce the problem somebody who can reproduce it needs to run geany with the GNU debugger and get a backtrace when it crashes. |
Made some progress as far as reproducing the random Chinese and the failure to open more than 2 or 3 files. Most importantly, I can't get the GTK file dialog to reproduce any aspect of the issue, so disabling the native Windows file dialog at "Edit > Preferences > Miscellaneous" is probably all that's needed to work around it. With the native file chooser open, I select a bunch of full paths between 110 and 120 characters each. I set a breakpoint in
The trouble starts at file number 4, which is incompletely copied to the
Geany's debug output pipes up at the same time:
The Status window, trying to display the truncated file path, shows the garbled Chinese that @ShoresOfNowhere reported. I can't paste it here because trying to copy it with the widget's context menu fails with another error:
Still no crash, but then my file list wasn't extreme, and I compiled with zero optimization (-O0). Footnotes |
@rdipardo ok, so the windows native dialog returns multiple filenames in one buffer, but it truncates the last one when it won't fit, yuck!! How are they supposed to work in that case? How does the caller know what length buffer to pass to it? No wonder MS deprecates those dialogs. [end rant] Can they be forced to only select one file which "should" be safe if inconvenient? |
Or if "somebody" wanted to update the native dialog handling to use the newer MS dialogs which return multiple results in arrays of pointers to strings. Although that effort might be wasted if Geany ever moves to GTK4 since (IIUC) native dialogs are not supported by it. |
@rdipardo and @elextr sorry for responding late! I confirm the problem happens only with native dialogs (but non native ones cannot seem to sort properly by file type, as when instructed to do so, they sort by type but NOT sort secondarily by file name, as native dialogs do, making them almost unusable!). I confirm that that setting you were talking about was OFF, and in my tests it made no difference at all if turned on or not. About the locale, how can I confirm the locale Geany is currently using? I'm using Geany with no language installed... |
Had the "Use Windows Native dialogs" checked previously, with GTK dialog no more problems. Thanks for sorting this out. |
Unless Geany intends to support XP, it should be instantiating Windows dialogs from Limiting file selections to < 512 total bytes would be a miserable user experience. With GTK4 looming, it might be time to simply drop native dialogs. It's the least amount of work and will definitely prevent a recurrence of this issue. |
Sadly the problem is built into the Windows native dialogs, so we can't fix it, you can either open short lists/single files from the native dialogs, or use the GTK dialogs to open lots of files.
AFAICT they apply a sort on top of the existing order, so if you sort by name then by type the name order should remain. Thanks for finding the problem.
Agree and agree, windows maintainers welcome.
It can happen as part of the GTK4 support, but GTK4 contributors seem as rare a bird as Windows ones. |
Their implementation was buggy, use very old Windows APIs and require double implementation and maintenance efforts for us The GTK dialogs work well for all other users already, so they probably will also for Windows users. Closes geany#3209.
Their implementation was buggy, use very old Windows APIs and require double implementation and maintenance efforts for us The GTK dialogs work well for all other users already, so they probably will also for Windows users. Closes geany#3209.
We've got #3219 to remove the native Windows dialogs (well, most of them) completly and also the corresponding setting. Granted, this is the easiest solution but IMO also reasonable as this issue revealed, the implementation uses old APIs and has bugs. |
Their implementation was buggy, use very old Windows APIs and require double implementation and maintenance efforts for us The GTK dialogs work well for all other users already, so they probably will also for Windows users. Closes geany#3209.
@elextr I have tried sorting on file name and then on type, and you're right, it gets sorted correctly, but... as soon as you use the top bar to change folder all reverts to a useless ordering! |
Sorry to bother, but has anyone idea of where can I report the sorting bug in the GTK file selection dialog? |
Well, maybe not the only one, but clearly most users do not have a problem since its standard GTK behaviour and there are lots of users. Perhaps most users use filename extensions to distinguish types so sorting on names is sufficient. |
I have inserted an issue on GTK bug tracking: https://gitlab.gnome.org/GNOME/gtk/-/issues/5015 @elextr ok, this seems strange to me as sorting by multiple columns is widely used in Windows and Linux file managers, so I would expect the GTK dialogs to work on the same principle, but let's see if the GTK people would consider this a real bug! :) |
Your issue is slightly misleading, it has nothing to do with Geany, it happens with all GTK open dialogs, Linux, Windows, Geany Gedit, etc etc. [Edit: it even happens with MS Vscode on Linux] Well, given that AFAICT there is no description of what the sorting is supposed to do, so I expect its not a bug, you can't have a bug for something unspecified. But they may take it as a feature request, which will be implemented in GTK4 since nothing is changing in GTK3 now. |
@elextr sorry but I don't agree with you: if you click on the file name header and then on the type header, you get exactly the sorting you expect, first by type and then by file name. if you change folder this sorting isn't kept, and it reverts to only sorted by type. |
Their implementation was buggy, use very old Windows APIs and require double implementation and maintenance efforts for us The GTK dialogs work well for all other users already, so they probably will also for Windows users. Closes #3209.
When opening many files at once by selecting them in the file open dialog on windows 10, geany simply crashes to the desktop with no message at all.
I don't know the exact number of files, but I'm sure that under 10 files it never happens, and over 30 files it always happens.
The text was updated successfully, but these errors were encountered: