Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Nov 1996 22:07:18 -0500 (EST)
From:      "Eric J. Chet" <ejc@gargoyle.bazzle.com>
To:        current@freebsd.org
Cc:        dob@nasvr1.cb.lucent.com
Subject:   diff.deque.h (fwd) 
Message-ID:  <Pine.BSF.3.95.961113220412.23559A-100000@gargoyle.bazzle.com>

next in thread | raw e-mail | index | archive | help
Hello
	We have a bug in deque.h, I think this should be patched.

                                              Eric J. Chet
                                               - ejc@bazzle.com
---------- Forwarded message ----------
Date: Fri, 8 Nov 1996 15:45:43 -0500
From: "Dan O'Brien, 614.860.3292" <cbsky!dob@naserver1.cb.lucent.com>
To: ejc@naserver1.cb.lucent.com, ejc@gargoyle.bazzle.com
Subject: diff.deque.h

Eric,

I found the bug in FreeBSD GNU STL version of deque.h.  Looks like a source 
file maintenance error.  Here is the patch.  

*** deque.h.ORG	Fri Nov  8 15:36:38 1996
--- deque.h	Fri Nov  8 15:36:46 1996
*************** void deque<T>::allocate_at_begin() {
*** 437,444 ****
  	    finish = iterator(finish.current, map + map_size / 4 + i + 1);
  	} else {
  #ifdef __GNUG__
! 	map_size = map_allocator_type::init_page_size();
! 	map = map_allocator_type::allocate(map_size);
  #else
  	    *--start.node = p;
  	    start = iterator(p + __dq_buffer_size, start.node);
--- 437,446 ----
  	    finish = iterator(finish.current, map + map_size / 4 + i + 1);
  	} else {
  #ifdef __GNUG__
! //	map_size = map_allocator_type::init_page_size();
! //	map = map_allocator_type::allocate(map_size);
! 	    *--start.node = p;
! 	    start = iterator(p + __dq_buffer_size, start.node);
  #else
  	    *--start.node = p;
  	    start = iterator(p + __dq_buffer_size, start.node);

I'm not sure who to submit this to.  Please forward it to whomever should
receive this bug report.

Here is a test program.  It core dumps without the patch.

#include <iostream.h>
#include <deque.h>

int
main()
{
	deque<double> a;

	for ( int i = 0 ; i < 8000 ; i++ ) 
	{
		a.push_front( i );
	}
	return 1;
}

Thanks for handling this report,

Dan O'Brien




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.95.961113220412.23559A-100000>