Repository navigation
Fix issue unveiled on NetBSD: Add PAL__vsnprintf shadow in PAL - #3240
Conversation
|
Maybe also delete _vsnprintf implementation in printf.cpp because of it is unused now? (And it can only cause problems by colliding with the system-provided one.) |
c6caad7 to
ccd8b43
Compare
|
Done! |
|
By removing the _vsnprintf and exposing the PAL__vsnprintf externally, we have lost the logging (PERFENTRY, ENTRY, ...). It seems it would make sense to put it into the PAL__vsnprintf. It would then probably also make sense to replace all usages of PAL__vsnprintf in PAL (there are 6 of them) by the CoreVsnprintf. |
|
Make sense. Also, there is build break on OSX |
To be sure. Please make more clear this part: "It seems it would make sense to put it into the PAL__vsnprintf." Thank you! |
|
Look at the deleted _vsnprintf: int
__cdecl
_vsnprintf(char *buffer,
size_t count,
const char *format,
va_list argptr)
{
LONG Length;
PERF_ENTRY(_vsnprintf);
ENTRY("_vsnprintf (buffer=%p, count=%d, format=%p (%s), argptr=%p)\n",
buffer, count, format, format, argptr);
Length = PAL__vsnprintf(buffer, count, format, argptr);
LOGEXIT("_vsnprintf returns int %d\n", Length);
PERF_EXIT(_vsnprintf);
return Length;
}What I meant is to add the PERF_ENTRY, ENTRY, LOGEXIT and PERF_EXIT to the PAL__vsnprintf. Just copy them from here and modify the name from _vsnprintf to PAL__vsnprintf. |
|
|
|
I can use |
For example, is |
|
Yes, it is safe, since when it was calling PAL__vsnprintf, it was doing the same thing in the PAL__vsnprintf. |
|
LONG is defined as int, since LONG on windows is 32 bit. |
|
OK, I will leave the |
ccd8b43 to
3d06e51
Compare
|
Done! It might be cleaned up.. but it should be good enough. |
|
It failed with tests... before I will be back to .Net, what's the suggested solution? It looks like tests are trying to call |
|
I would try to generate pre-processed version of one of the failing tests to see what's going on. It should be ok for the tests to call _vsnprintf, as it should be defined as PAL__vsnprintf by the pal header, right? |
| #endif // SSCANF_CANNOT_HANDLE_MISSING_EXPONENT | ||
|
|
||
| using namespace CorUnix; | ||
| int CoreVsnprintf(CPalThread *pthrCurrent, LPSTR Buffer, size_t Count, LPCSTR Format, va_list ap); |
There was a problem hiding this comment.
Actually I can see now that we have InternalVsnprintf exposed in the printfcpp.hpp and it is just a wrapper for the CoreVsnprintf to make it public, so it would be cleaner to use that instead of adding the function prototype.
|
It looks like pal.h change has been lost. I will restore it and see what happens. |
9bf62f0 to
2f63858
Compare
|
Should be fine now. Let see what buildslaves will report. |
76116eb to
2f63858
Compare
|
OS X build failed: http://dotnet-ci.cloudapp.net/job/dotnet_coreclr/job/checked_osx_prtest/663/console |
|
@kangaroo would you like to help with MacOSX investigation? Thanks |
|
@dotnet-bot test this please |
|
Thank you, I got exhausted during investigation of this issue and I needed to take rest from it for few days. |
|
I don't know MacOSX.. I will leave this for the last pull-request for myself. Unless someone will spot the error. Thanks! |
|
@dotnet-bot test this please |
231e9b2 to
e910539
Compare
NetBSD's libc internally uses a function named _vsnprintf. We need to mask PAL's version of this function to remove clash with the system. With it snprintf(3) calls were jumping out of libc and landing back to PAL. It was unveiled with many PAL tests. Detailed documentation about _symbols in the NetBSD libc is documented in the NetBSD sources in a file: src/lib/libc/README Retire unneeded _vsnprintf(). Thanks Jan Vorli (Microsoft) for help with debugging. Thanks Jan Kotas (Microsoft) for suggesting the right solution. Fix #3199
e910539 to
fd1f866
Compare
|
ping - this is pretty large commit to maintain locally |
|
LGTM |
|
Thank you! |
…t-50 Fix issue unveiled on NetBSD: Add PAL__vsnprintf shadow in PAL Commit migrated from dotnet/coreclr@3ea0f5f
NetBSD's libc internally uses a function named
_vsnprintf. We need to maskPAL's version of this function to remove clash with the system. With it
snprintf(3) calls were jumping out of libc and landing back to PAL.It was unveiled with many PAL tests.
Detailed documentation about
_symbolsin the NetBSD libc is documentedin the NetBSD sources in a file:
src/lib/libc/READMEThanks Jan Vorli (Microsoft) for help with debugging.
Fix #3199