I had a look into the crash issue, and it was a buffer overflow with the
buffer size being setup incorrectly. It's a bit scary that this wasn't
discovered earlier. It showed up using valgrind. You can see the simple
fix made by following the link below:
http://simpledb.svn.sourceforge.net/viewvc/simpledb/trunk/SimpleDB/StringColumn.cpp?r1=10&r2=18
A new release with this fix has now been made available on sourceforge:
https://sourceforge.net/projects/simpledb/
I look forward to your DynamicStringColumn :)
Cheers,
Russell
On Thu, 2010-06-24 at 09:48 -0700, Bruce Bailey wrote:
> Russell
>
> Thanks very much for the reply. Writing a 'DynamicStringColumn' class
> is intriguing and I may take that on.
>
> I'll take your advice and simply set a bigger column size and hope for
> the best. Extracting a row of data and putting it in another,
> dynamically sized structure isn't too hard and that way I get the best
> of both worlds -- efficient space utilization and use of SimbleDB.
>
> In case it helps, I am including a simple duplication example
> (base64/bzip2).
>
> On windows, using VS2008, it simply crashes on exit.
> On RH Linux (somewhat older) it returns 6 characters (1 greater than
> the buffer size), no errors or exceptions.
>
>
> _=_
> _=_ Part 001 of 001 of file sdb.cpp.bz2
> _=_
>
> QlpoOTFBWSZTWZYdhX8AAPVfgBZSWfX//z9n/06/7//qIALSFEKChohMieCJimymTJk1GnpHqeo9
> R
> +pqAeoHhNQHoJIiZNTTRlTwmp5EbUeoGgaNBpiAxAMT1JCFIAC7d2sv0xrs6cxDbUMVDkYEIJuZ
> ldsYz2E2q2xK4tFPodU/MpXiSCpCBkjwmFpe7pOfqI1DfSE9fLlOwSzEjd
> +dWK67axVVj/myFFQi
> OFgdVhwMrlK3A04zoWHtW9HV/FRNdG3F2Si9F008YqUOchUQbOk6XUsJySwGXWBkeWglFpPMDz7F
> NVTzRRSiQYA5JKxwXjbMa1XeZ6RrR68725qkh7Fe6i1SyoFFIHw5AUQiI6x32gU98AZDijOiSONF
> 3wRpRyIpyo7aNzJ7GYXcDiQt9e1tLa2ZhnQHXlA9JCsiHn0ewcNe0fQTvVqSfchvYfQGe2QvuHnv
> 3bOG9rt8yXGjjx6hVJyuhfaD3N8PCSldNYk6emqOJLoTvxsDTgYvzPmhasSe
> +wV6pacsoMzIh/cm
> b/mjLeZYWgFIgaAGmTHGV3MnUQOUXKytCAWdYMc+J5c63TIv3zSmdCOOA
> +mHzajvZ2kraZGctCxE
> ywFeTm73k1tzzzShU6aLdTu1jETQhrFmJVNRdmHC0DBaBbqrDZThiQx6dzAailHsiXoe0kFTg/Qx
> e7qbcWULb5+A09Zrkhpw9trwXdG6gCavJAxfMDoMW
> +WgjGVADAxlglILMSW53ckGBPvSa18TDQc7
> FKECU4lbPjToepVf5wiHklljdqV6TU8ygXGCIwzEYs7qvLVKqrXZHJep5UwYmPGtUcpWYoTIwgzY
> 3tcakBcGbvGDJRSGQXdqhiZvE93BFnWwLxcDSMCwMTOSP4qM0NjYq30GXPho8YP5Y5d2RIRWmKQB
> woMPrCqwMLk029O0cgVlprMu0KBpTIA4WbBzBQctjAMLcF6qIqhfVZbMAkVrC4cO
> +wGOa1Gh3ZM9
> //F3JFOFCQlh2Ffw
>
>
>
> Bruce
>
> > Subject: Re: [Simpledb-general] StringColumn Length Question (SDB
> ver 1.13)
> > From: ru...@kl...
> > To: bru...@ho...
> > CC: sim...@li...
> > Date: Thu, 24 Jun 2010 10:37:57 +1000
> >
> > > It appears that if you set the size of the buffer too small for a
> > > given field (i.e. data type of 'text'), that the program will
> crash --
> > > presumably due to buffer overrun.
> >
> > Setting a buffer too small shouldn't cause a buffer overrun. If it
> does,
> > then it is a bug that needs to be fixed. Are you sure it isn't
> throwing
> > an exception?
> >
> > > What is the conventional wisdom for using StringColumn where the
> > > length isn't known?
> > >
> > > Should I just allocate a very large buffer and hope for the best?
> > > Are there plans for a DynamicStringColumn class?
> >
> > Until now, I have been just setting a reasonable sized buffer. A
> > DynamicStringColumn class would be great! Feel free to send a patch.
> >
> > Cheers,
> >
> > Russell
> >
>
>
> ______________________________________________________________________
> The New Busy is not the old busy. Search, chat and e-mail from your
> inbox. Get started.
|