Open warmist opened 1 week ago
Hi @warmist Have you visited the advice about the errno=42 error at https://github.com/IntelRealSense/librealsense/issues/13037 please?
https://github.com/IntelRealSense/librealsense/issues/13457#issuecomment-2432900837 has instructions for finding on a Windows computer and deleting the realsense-config.json configuration file mentioned in that link.
Hi @MartyG-RealSense. Thanks for answering.
Yes, i've seen both of them. Also i've looked into all the duplicates.
https://github.com/IntelRealSense/librealsense/issues/13457#issuecomment-2432900837 yes, i've looked into hidden files as well. Also you can access the folder faster if you type "%appdata%" into explorer path (i.e. the part where it has "C:\etc...")
I'll try to setup a minimal repro as i feel this issue might be hard to reproduce without setting up a windows machine with username with unicode chars in it.
Here is minimal reproduction: https://gist.github.com/warmist/e0b1927387864566db2804c50d0cf512
In my environment wcstombs_s
fails with error=42
. Content of path:
(see unicode letter in path)
Further research shows that wcstombs_s
uses current locale and current locale is "en-us" and fails to convert unicode character. It should use _wcstombs_s_l
with new locale (i.e. _create_locale(LC_ALL,"");
)
I had a discussion with my Intel RealSense colleagues about the 'failed to convert special folder: errno=42' error earlier in 2024, so I will follow up on it and pass your kindly provided information to them for their consideration.
Source of error is this line: https://github.com/IntelRealSense/librealsense/blob/e1688cc318457f7dd57abcdbedd3398062db3009/third-party/rsutils/src/special-folder.cpp#L81
wcstombs_s returns value 42 which is EILSEQ i.e. it fails to convert wide string to multibyte string.
There are numerous issues closed with this but nobody dug down to the source. It seems that this only happens if your username has unicode characters.