[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: gEDA-user: pcb git segmentation fault in hid binary searchs



   DJ,
   Thanks, I'll see what I can do to remove the linear search as well.
   Jason

   On Sun, May 24, 2009 at 12:07 AM, DJ Delorie <[1]dj@xxxxxxxxxxx>
   wrote:

   > I've tracked the problem to the binary search in hid_find_flag, when
   strcmp
   > gets a null value from the flags being searched.  This may be a
   recent
   > change in glibc for Ubuntu and a test program that just does
   strcmp("some
   > string",NULL); segfaults for me.  I've changed it to use bsearch for
   now...
   > my question is, is there a reason the stdlib bsearch function was
   not used?
   > I notice that qsort is used right above it.  If there is no
   complaint in
   > changing the bsearch's in flags.c and actions.c, I'll submit a patch
   for it.

     No reason, go ahead.

   > Also, question in actions.c... It appears that the binary search is
   > performed and a linear search is done if the action was not found in
   the
   > binary search. Is there a reason for this or was it just overlooked
   in the
   > hid upgrade?

     The binary search is case sensitive, the linear search isn't.  What
     we
     might consider is a hash based on tolower(name) instead.
     _______________________________________________
     geda-user mailing list
     [2]geda-user@xxxxxxxxxxxxxx
     [3]http://www.seul.org/cgi-bin/mailman/listinfo/geda-user

References

   1. mailto:dj@xxxxxxxxxxx
   2. mailto:geda-user@xxxxxxxxxxxxxx
   3. http://www.seul.org/cgi-bin/mailman/listinfo/geda-user

_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user