htdig: core problem with modified htsearch :(


Doug (DougB@simplenet.com)
Wed, 20 Jan 1999 13:31:26 -0800


        Well I'm getting closer to my goal, but I have an (what I'm hoping is a
small) error in my code that causes htsearch to "work" in the sense that
sending it a fake test on the command line outputs the desired html, but
it cores every time it runs.

        I'm a decent C programmer, but my C++ leaves a lot to be desired. Here
is what I've done:

*** htdig-3.1.0b4/htsearch/Display.cc Tue Dec 22 18:15:39 1998
--- htdig-3.1.0b4-mod/htsearch/Display.cc Wed Jan 20 13:13:22 1999
***************
*** 265,272 ****
      {
        vars.Add("EXCERPT", excerpt(ref));
      }
      char *url = match->getURL();
! vars.Add("URL", new String(url));
      vars.Add("SCORE", new String(form("%d", match->getScore())));
      vars.Add("CURRENT", new String(form("%d", current)));
      char *title = ref->DocTitle();
--- 265,280 ----
      {
        vars.Add("EXCERPT", excerpt(ref));
      }
+
      char *url = match->getURL();
!
! size_t sn_max_qs_size = 128;
! char *sn_query_string =
"?track=00101.00015.005.00012.001-99010613001212638\0";
!
! char *new_url = strncat(url, sn_query_string, sn_max_qs_size);
!
! vars.Add("URL", new String(new_url));
!
      vars.Add("SCORE", new String(form("%d", match->getScore())));
      vars.Add("CURRENT", new String(form("%d", current)));
      char *title = ref->DocTitle();

This code compiles clean and runs, but produces a core. Here's a look at
the core file with gdb:

#0 0xef64bfcc in t_splay ()
(gdb) where
#0 0xef64bfcc in t_splay ()
#1 0xef64be24 in t_delete ()
#2 0xef64bab8 in realfree ()
#3 0xef64c28c in _free_unlocked ()
#4 0xef64c1c0 in free ()
#5 0xbf100 in ___builtin_delete (ptr=0x125538)
#6 0x37ba8 in Object::~Object (this=0x125538, __in_chrg=3) at
Object.cc:34
#7 0x38af0 in String::~String (this=0x125538, __in_chrg=3) at
String.cc:120
#8 0x374c0 in List::Destroy (this=0xefffef4c) at List.cc:69
#9 0x37428 in List::~List (this=0xefffef4c, __in_chrg=2) at List.cc:35
#10 0x295d0 in TemplateList::~TemplateList (this=0xefffef30,
__in_chrg=2) at TemplateList.cc:31
#11 0x238b4 in Display::~Display (this=0xefffea88, __in_chrg=2) at
Display.cc:158
#12 0x2b094 in main (ac=1, av=0xeffffcec) at htsearch.cc:298

As always I'm grateful for any help.

Doug
----------------------------------------------------------------------
To unsubscribe from the htdig mailing list, send a message to
htdig-request@sdsu.edu containing the single word "unsubscribe" in
the body of the message.



This archive was generated by hypermail 2.0b3 on Mon Jan 25 1999 - 08:15:23 PST