Re: Strange segfault with improper usage --> plus extra fix for internal_trace issue in there

"Ger Hobbelt" <[email protected]>
Newsgroups gmane.mail.spam.crm114
Message-ID <[email protected]>
On Wed, Mar 26, 2008 at 3:52 PM, Paolo <[email protected]> wrote:
>  Anyway, the patched crmregex_tre.c is attached.

Thanks again.

Inspected. I found I missed a spot (i = 0 following the cache shift
loop). Fixed now.



New src.7z will be up shortly. Has been verified to run megatest on
Win32 in both RANDOM and LINEAR tre cache mode without glaring
failures

BTW: bugreport: the first internal_trace dump loop in there has an
indexing bug. diff attached: apply to your crmregex_tre.c as you have
it. ;-)
The .7z also contains a full copy of my .c for reference; won't
compile with Bills as his doesn't have all the mandatory magick, such
as CRM_ASSERT(), though.

The diff is 'processed' to remove diffs due to code formatting (make
reindent/uncrustify), etc.



What's in the diff:

- internal_trace code dump [i] index --> [j]. FAR easier too see in a
character(!)-based visual diff tool than by looking at +/- diff
reports. grmbl. ;-)

- +#error "Must have #define'd ONE of these:
REGEX_CACHE_RANDOM_ACCESS, REGEX_CACHE_LINEAR_SEARCH"
  if the compiler detects that someone has made a #define booboo
somewhere in the config headers.

  Better safe than sorry.


and some additional cruft:

- curly braces: code sections are not started outside
#ifdef/#else/#endif while being terminated within (see also your
'internal_trace' single liner there). It's more like a coding practice
I adhere rather strictly too, than anything else. Makes for easier
readability and doesn't make me wonder anymore if that one fputs
following that #else is printed _every_ time.and why I don't see it
then.
(Yes, I know. But I'm not always able to work on crm114 or other
projects I like with brain at 200% attention. So I tend to put in
precautions for scares.)

- fputs-->fprintf - no use really but only that I when I search for
diag output, it's all 'fprintf(stderr' - easier to collect that way
and fewer mistakes by me.






-- 
Met vriendelijke groeten / Best regards,

Ger Hobbelt

--------------------------------------------------
web: http://www.hobbelt.com/
 http://www.hebbut.net/
mail: [email protected]
mobile: +31-6-11 120 978
--------------------------------------------------

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace

_______________________________________________
Crm114-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/crm114-general
crmregex_tre.paolo.20080325-2.7z (application/octet-stream, 4 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.