strspn [was: 0.11.1 debian failures]

David Relson relson at osagesoftware.com
Tue Mar 11 13:39:37 CET 2003


At 07:09 AM 3/11/03, David Relson wrote:

> >>> Using core file "./core".
> >>> Using exec file "../bogofilter -n -d ./checks.12714.20030311T063641 
> -c ./checks.12714.20030311T0".
> >>> Running command: gdb -nw -r -batch -n -x script.gdb.12761 -silent 
> ../bogofilter -n -d ./checks.12714.20030311T063641 -c 
> ./checks.12714.20030311T0 ./core </dev/null
>Core was generated by `../bogofilter -n -d ./checks.12714.20030311T063641 
>-c ./checks.12714.20030311T0'.
>Program terminated with signal 11, Segmentation fault.
>#0  0x401cf302 in strspn () from /lib/libc.so.6
><<< SIMPLE BACKTRACE <<<
>#0  0x401cf302 in strspn () from /lib/libc.so.6
>#1  0x00405882 in read_config_file (fname=0x7ffff825 "0.415", 
>tilde_expand=false, warn_on_error=true) at configfile.c:229
><<< FULL BACKTRACE <<<
>#0  0x401cf302 in strspn () from /lib/libc.so.6
>No symbol table info available.
>#1  0x00405882 in read_config_file (fname=0x7ffff825 "0.415", 
>tilde_expand=false, warn_on_error=true) at configfile.c:229
>         delim = " \t="
>         len = 4
>         buff = "robx\00.415", '\0' <repeats 189 times>
>         error = false
>         lineno = 1
>         fp = (FILE *) 0x421148
>         filename = 0x420d10 "./checks.12714.20030311T063641/test.cf"
>         val = 0x7ffff825 "0.415"
> >>> Done.

Looking at the parameters and local variables I see several things that are 
peculiar.

1 - Both fname and val point at the same memory address.  This is _wrong_.
2 - We know we're at the first line of the config file because of lineno = 
1.  As the first line of the file is "robx=0.415", this is confirmed by the 
value in buff, i.e. "robx\00.415".  The presence of the '\0' is correct at 
the time strspn() is called.  However the value of len should be 10, not 4.

When I step through it on my PIII, all looks fine.  So all is not quite 
right (and the S390 is likely correct to complain, via SegFault).  More 
research to follow ...





More information about the bogofilter-dev mailing list