isc_buffer

Mark Andrews marka at isc.org
Mon Oct 31 14:36:53 UTC 2016


In message <68837329-9b80-9b9c-beb8-70141bbb7d94 at yahoo.no>, Gisle Vanem writes:
> Mark Andrews wrote:
> 
> >> BTW. the number of ISC_x defines are staggering. It
> >> seems some of them are no longer supported. Like with
> >> 'ISC_CHECK_ALL', I'm getting assert-failures in some
> >> win32 .c-files. Anybody who have tried that lately?
> > 
> > Why do you say that?  The first blocks could have #undef's added
> > but that doesn't stop ISC_CHECK_ALL and ISC_CHECK_NONE overridding
> > any individual checks settings and checks are on for any which
> > aren't explicitly set.
> 
> Sorry for the late reply. But you're right. The fault with the trailing
> garbage from isc_netaddr_totext() was elsewhere.
> 
> But it seems to me, there's some issues with all the mem-debugging
> code in libisc. Since if I modify nslookup.c slightly:
> 
> --- a/nslookup.c 2016-09-19 15:41:42
> +++ b/nslookup.c 2016-10-31 11:48:49
> @@ -719,7 +719,7 @@
>         } else if (strncasecmp(opt, "d2", 2) == 0) {
>                 debugging = ISC_TRUE;
>         } else if (strncasecmp(opt, "nod2", 4) == 0) {
> -               debugging = ISC_FALSE;
> +               debugging = ISC_FALSE, isc_mem_debugging = 0xFF;
>         } else if (strncasecmp(opt, "search", 3) == 0) {
>                 usesearch = ISC_TRUE;
>         } else if (strncasecmp(opt, "nosearch", 5) == 0) {
> 
> and do 'nslookup.exe -nod2 www.vg.no', I get this assert:
>   ...
>   mem.c:1300: INSIST(oldsize == size) failed.
> 
> And the call-stack from WinDbg:
>   ucrtbase!abort+0x4b
>   libisc!isc___mem_put(struct isc_mem * ctx0 = 0x04106db0, void * ptr = 0x04117638,
>   unsigned int size = 0x84, char * file = 0x6a854184 "task.c", unsigned int line = 0x14c
> )+0x133
>   libisc!task_finished(struct isc__task * task = 0x04106db0)+0x114
>   libisc!dispatch(struct isc__taskmgr * manager = 0x04116638)+0x234
>   libisc!run(void * uap = 0x04116638)+0x9
>   ucrtbase!thread_start<unsigned int +0x3f

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.
 
> -- 
> --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