Exit code 3 after adding Diesel r2d2 on Rocket #2947
-
Hi all! I have an issue with the My rocket app is exiting with code 3, without any message or log on Windows 10. I found that this is occurred by the The detailed problem is described in rwf2/Rocket#1931 and rwf2/Rocket#1931 (comment). Is there any work-around for this issue? Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 61 replies
-
I'm not aware of this issue, so I fear you need to provide much more information especially the following information:
(Another related note: As I do not have access to a windows 10 machine I cannot just take random code and try to reproduce platform specific issues.) EDIT: Another thing that may be useful to know is whether libpq was compiled in a thread safe mode or not. I fear in the second case this "behaviour" is expected. |
Beta Was this translation helpful? Give feedback.
-
Can you try running the tests with
👍 Will have a look at that.
That leaves two possible causes on my list 🤔 I will need some time to think about a way to verify that it is one or the other. |
Beta Was this translation helpful? Give feedback.
-
I finally found the actual problem and a real solution. The real problemYes, the problem is in gettext/libintl. It turns out that in Postgres, according to one of the maintainers from EnterpriseDB:
It is almost impossible to generate a PDB file for gettext/libintl because it must be built with mingw which doesn't produce those. With more effort than I would like to make, there is a tool developed by the D language community that can do this: https://github.com/rainers/cv2pdb The libintl version that is distributed with EnterpriseDB Postgres is named libintl-9.dll. You would think that this is newer than libintl-8.dll. But you would be wrong. See this explanation. This really threw me off! It turns out, therefore, that libintl-8.dll contains newer code than libintl-9.dll The only code that really calls abort() anywhere in the stacktrace has to do with threading macros. So it's something to do with that. There is this one commit that caught my eye: #ifdef _LIBC
__libc_rwlock_fini (domain->conversions_lock);
+#else
+ gl_rwlock_destroy (domain->conversions_lock);
#endif
goto invalid;
} This code is only present in tags v0.20, v0.20.1, v0.20.2, and v0.21. So I grabbed some new binaries that would contain this code from github (see the solution) and verified that the versions that contain this patch do not have the issue. The ones that do not contain the patch do have the issue. For some comic relief, here is real gem I found in the source: #ifdef __GNUC__
# define ZERO 0
#else
# define ZERO 1
#endif Solution
I asked if we could expect a non-broken libintl DLL in upcoming versions (after they figure out the performance regression). I don't know yet, but at least we have a fix. |
Beta Was this translation helpful? Give feedback.
I finally found the actual problem and a real solution.
The real problem
Yes, the problem is in gettext/libintl. It turns out that in Postgres, according to one of the maintainers from EnterpriseDB:
It is almost impossible to generate a PDB file for gettext/libintl because it must be built with mingw which doesn't produce those. With more effort than I would like to make, there …