isc_buffer

Mark Andrews marka at isc.org
Mon Oct 31 22:43:14 UTC 2016


In message <c3425453-cb5c-67d7-95f1-06bb3565c4b4 at yahoo.no>, Gisle Vanem writes:
> Mark Andrews wrote:
> 
> > isc_mem_debugging is designed to be set before any isc_mem_create*() calls are made.
> > Changing it after that will lead to the results you have seen.
> > That said we could record isc_mem_debugging when a context is created
> > and use then there after which would avoid the INSIST when you change it
> > too late.
> 
> Ok, that makes sense. I removed my patch to nslookup.c and all seems
> okay for now.
> 
> But as I mentioned the trailing garbage was elsewhere; in isc_print_sprintf().
> (I think because my platform.h had a 'ISC_PLATFORM_NEEDPRINTF' defined).
> 
> Speaking of 'isc_print_sprintf()', the 'ISC_QUAD_FORMAT' for Windows is defined
> to "I64". But in print_test, I get this failure in 'print_test.exe snprintf':
> 
>   *** Check failed: print_test.c:116: n != 18
>   *** Check failed: print_test.c:117: buf != "0xf5f5f5f5f5f5f5f5" (0xI64x != 0xf5f5f5f5f
> 5f5f5f5)
>   failed: 2 checks failed; see output for more details
> 
> With a '#define ISC_PLATFORM_QUADFORMAT "ll"' in lib\isc\win32\include\isc\platform.h,
> the print_test gets a 'passed'. I assume since MSVC-2015 handle both "llx" and "I64x".

Untested bit this should address it.

diff --git a/lib/isc/print.c b/lib/isc/print.c
index d79a85a..761e8fb 100644
--- a/lib/isc/print.c
+++ b/lib/isc/print.c
@@ -283,6 +283,15 @@ isc__print_printf(void (*emit)(char, void *), void *arg,
                        z = 1;
                        format++;
                        goto doint;
+#ifdef WIN32
+               case 'I':
+                       if (format[1] == '6' && format[2] == '4') {
+                               q = 1;
+                               format += 3;
+                               goto doint;
+                       }
+                       continue;
+#endif
                case 'n':
                case 'i':
                case 'd':

> -- 
> --gv
> _______________________________________________
> bind-workers mailing list
> bind-workers at lists.isc.org
> https://lists.isc.org/mailman/listinfo/bind-workers
-- 
Mark Andrews, ISC
1 Seymour St., Dundas Valley, NSW 2117, Australia
PHONE: +61 2 9871 4742                 INTERNET: marka at isc.org


More information about the bind-workers mailing list