Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Rockbox mail archive

Subject: Re: Segfault with Faster MDCT patch and -fPIC

Re: Segfault with Faster MDCT patch and -fPIC

From: Slawomir Testowy <slawomir.testowy_at_gmail.com>
Date: Fri, 17 Sep 2010 16:26:31 +0200

2010/9/17 Rafaël Carré <rafael.carre_at_gmail.com>:
> On Fri, 17 Sep 2010 14:01:48 +0200
> Slawomir Testowy <slawomir.testowy_at_gmail.com> wrote:
>
>> Hi,
>>
>> thanks for quick response.
>>
>> 2010/9/17 Rafaël Carré <rafael.carre_at_gmail.com>:
>> > I think the OP should post .S output of gcc and also give
>> > us compiler version and options being used
>> >
>> > --
>> > Rafaël Carré
>> >
>>
>> Here it is:
>>
>> /opt/freescale/usr/local/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnue
>> abi/bin/arm-none-linux-gnueabi-gcc --version
>> arm-none-linux-gnueabi-gcc (GCC) 4.1.2
>> Copyright (C) 2006 Free Software Foundation, Inc.
>> This is free software; see the source for copying conditions.  There
>> is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
>> PARTICULAR PURPOSE.
>>
>> Exact command line:
>>
>> /opt/freescale/usr/local/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnue
>> abi/bin/arm-none-linux-gnueabi-gcc -std=gnu89 -fPIC -DHAVE_CONFIG_H
>> -I. -I./ -O2 -D_ARM_ASSEM_ -fsigned-char -ffast-math
>> -fsingle-precision-constant -D_REENTRANT -DUSE_MEMORY_H -MT
>> fft-ffmpeg.lo -MD -MP -MF .deps/fft-ffmpeg.Tpo -c fft-ffmpeg.c -o
>> fft-ffmpeg.o
>>
>> Outputs of gcc -S and gcc -E are included in attachments.
>>
>> I'm afraid I won't be able to test proposed patch today. I'll try on
>> Monday.
>
> I think the patch wouldn't compile on ARM because I missed the ldmia
> ordering constraints like Dave mentioned
>
> otherwise I see that fft8_dispatch only differs on 1 register (-fPIC
> use r9 and without it uses r10==sl) but I don't see r10/sl being used
> as a pointer.. perhaps it's only done at linking phase?
>
> BTW building gdb should be as simple as:
> ./configure --target=arm-none-linux-gnueabi ; make
>
> --
> Rafaël Carré
>

I managed to build gdbserver + gdb. Here is the stacktrace:

Program received signal SIGSEGV, Segmentation fault.
0x0003b3a0 in pass (z_arg=<value optimized out>,
    STEP_arg=<value optimized out>, n_arg=<value optimized out>)
    at fft-ffmpeg.c:243
243 w += STEP;
(gdb) bt
#0 0x0003b3a0 in pass (z_arg=<value optimized out>,
    STEP_arg=<value optimized out>, n_arg=<value optimized out>)
    at fft-ffmpeg.c:243
#1 0x0003c080 in fft64 (z=0x1b10190) at fft-ffmpeg.c:355
#2 0x0003c0b0 in fft128 (z=0x1b10190) at fft-ffmpeg.c:356
#3 0x0003c0e0 in fft256 (z=0x1b10190) at fft-ffmpeg.c:357
#4 0x0003b924 in ff_fft_calc_c (nbits=<value optimized out>, z=0x1ae2dc0)
    at fft-ffmpeg.c:370
#5 0x0003ad78 in ff_imdct_half (nbits=28199880, output=0x1b100c8,
    input=<value optimized out>) at mdct-ffmpeg.c:112
#6 0x0003b178 in ff_imdct_calc (nbits=28377488, output=0x1afa5c8, input=0x0)
    at mdct-ffmpeg.c:348
#7 0x0003a5ac in mapping0_inverse (vb=0xbef3c670, l=0x1b0b538)
    at mapping0.c:290
#8 0x00033270 in vorbis_synthesis (vb=0xbef3c670, op=<value optimized out>,
    decodep=1) at synthesis.c:75

Unfortunately, most values are optimized out. On Monday, I will
rebuild tremor with -O0 and try again.

-- 
regards
Slawomir Testowy
Received on 2010-09-17

Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy