You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've had users report the following crashes happen occasionally in a scenario where we're using fsnotify to watch the disk for file changes:
lamdera.exe: toEnum{Action}: tag (-1) is outside of enumeration's range (0,4)
CallStack (from HasCallStack):
error, called at win-src\System\Win32\FileNotify.hsc:46:34 in fsnotify-0.4.1.0-7SQlBibA4qu3CuGnOcBOvF:System.Win32.FileNotify
As it's the only place toEnum is used in this package. But I'm unsure what the -1 value would indicate in Windows or how to debug further.
Would be happy to add debugging/instrumentation code if someone could provide some guidance, but otherwise we don't currently have a sure-fire way of replicating the issue reliably.
The text was updated successfully, but these errors were encountered:
It looks like Windows gives us action enums with a value between 1 and 5 inclusive, see here.
It appears that this line is converting from the 1-based Windows indexing to the 0-based Haskell Enum indexing. But somehow Windows is sending 0 for the action, resulting in a call to (toEnum (-1))?
If you have a Windows dev machine handy, maybe you can load FileNotify.hsc in GHCi and check that the enums (FileAction and Action) have the expected values?
I've had users report the following crashes happen occasionally in a scenario where we're using fsnotify to watch the disk for file changes:
I'm guessing this is related to:
hfsnotify/win-src/System/Win32/FileNotify.hsc
Lines 42 to 46 in cff8882
As it's the only place
toEnum
is used in this package. But I'm unsure what the-1
value would indicate in Windows or how to debug further.Would be happy to add debugging/instrumentation code if someone could provide some guidance, but otherwise we don't currently have a sure-fire way of replicating the issue reliably.
The text was updated successfully, but these errors were encountered: