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
It assumes that the error message is always in english, but unfortunaly that's
not the case. For example I have here "virheellinen ELF-otsikko" instead of
"invalid ELF header".
I'm running into this only when I'm using node-webkit. Plain node seems to be
unaffected for some reason. It might be because node-webkit does some extra
locale digging on startup: https://github.com/rogerwang/node-webkit/wiki/Play-with-window (the last section).
But nevertheless node-ffi should not never rely on error message strings which
might get translated. The reason for this implementation seems to be the lack of
proper error codes in dlopen(3) API, but I hope we could figure out some more
robust implementation for this.
The text was updated successfully, but these errors were encountered:
Interesting find! I suppose we're gonna have to find a way to fix this. Patches welcome of course. Figuring out how to add a test case for this will be interesting as well...
without the English text, and then do the retry, it would resolve that issue. If it match another dlopen error accidentally, then what happens? We get another error, and nothing else, we could throw the original one, and everything works like before.
I'm trying to link to
libc
on fairly standard Ubuntu Quantal installationwith finnish translations and locales.
And I'm getting following error:
This works fine if I change the language to english from gnome-control-center.
The reason for this is very obvious after looking at this:
https://github.com/rbranson/node-ffi/blob/a4f2caa15dcafb7c317a9636bef50b2ffb8e3322/lib/dynamic_library.js#L66
It assumes that the error message is always in english, but unfortunaly that's
not the case. For example I have here "virheellinen ELF-otsikko" instead of
"invalid ELF header".
I'm running into this only when I'm using node-webkit. Plain node seems to be
unaffected for some reason. It might be because node-webkit does some extra
locale digging on startup:
https://github.com/rogerwang/node-webkit/wiki/Play-with-window (the last section).
But nevertheless node-ffi should not never rely on error message strings which
might get translated. The reason for this implementation seems to be the lack of
proper error codes in dlopen(3) API, but I hope we could figure out some more
robust implementation for this.
The text was updated successfully, but these errors were encountered: