Re: Re: snnewgroup: Segmentation fault on ppc systems
Chris Niekel <[email protected]>
| Newsgroups | gmane.network.sn |
|---|---|
| Message-ID | <[email protected]> |
On Mon, Dec 08, 2003 at 08:17:28PM +0100, Sebastian D.B. Krause wrote:
> > Could you print a backtrace ('bt') at that point? That would show where
> > the 'vachar' was called.
>
> | (gdb) set args gmane.network.sn news.gmane.org 119
> | (gdb) run
> | Starting program: /tmp/sn-0.3.6/snnewgroup gmane.network.sn news.gmane.org 119
> |
> | Program received signal SIGSEGV, Segmentation fault.
> | 0x100015e8 in vachar (c=100, app=0x7ffffbf8, tmp=0x7ffffbc8 "\017?\202X\020\0015 \177??\020\017???\017?~?", len=0x7ffffbfc)
> | at format.c:59
> | 59 case 'd': i = va_arg(*app, int); p = istr(i, 10, tmp); break;
> | (gdb) bt
> | #0 0x100015e8 in vachar (c=100, app=0x7ffffbf8, tmp=0x7ffffbc8 "\017?\202X\020\0015 \177??\020\017???\017?~?", len=0x7ffffbfc)
> | at format.c:59
> | #1 0x100017a0 in formatv (buf=0x1001357c "", size=2147482616, fmt=0x100024b5 "d", ap=0xfe87ee0) at format.c:91
> | #2 0x10001894 in formats (buf=0x0, size=2147482616, fmt=0x7ffffbc8 "\017?\202X\020\0015 \177??\020\017???\017?~?")
> | at format.c:115
This is weird. buf=0 in frame #2, and size is 2^31 - 1032. When frame #3
calls formats in line 155, the code just passed a comparison at line
153.
Besides that, the variable 'i' is also way too large. Can you run the
following small piece of code:
#include <stdio.h>
int main()
{
int i= sizeof("../.outgoing/");
printf("size: %d\n", i);
return 0;
}
And give the results? My instinct told me this would be 4 (char*), but
apparently it's 14 on my i386. Maybe the huge 'i' has something to do
with this? Maybe your platform has a different size than 'int' for the
result of sizeof.
Still a strange problem though.
Chris
--
I've been down so long, if I'd cheer up, I'd still be depressed.
- Lisa Simpson, Moanin' Lisa Blues.