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: Dave Hooper <dave_at_beermex.com>
Date: Sun, 10 Oct 2010 11:35:11 +0100

I hope to take a look today
> On 17.09.2010 09:32, Slawomir Testowy wrote:
>> Hi all!
>>
>> For some time I have been using tremor with fastermdct patch found on
>> http://www.rockbox.org/wiki/FasterMDCT. This patch gives huge speedup on
>> i686/x86_64 machines and smaller, but still significant, speedup on ARM.
>>
>> Everything works great until I compile tremor on ARM with -fPIC flag (I
link
>> tremor into a shared object). In such case it segfaults in macro
TRANSFORM_EQUAL
>> in file fft-ffmpeg_arm.h at line 158:
>>
>> asm volatile( "ldmia %[my_z], {%[t5],%[t6]}\n\t":[t5] "=r" (t5), [t6]
"=r"
>> (t6):[my_z] "r" (z));\
>>
>> When I compile tremor without -fPIC or with -U_ARM_ASSEM_, there is no
segfault.
>> Tremor without fastermdct.patch also doesn't have this problem.
>>
>> I tried debugging the code for a moment, but this code (MDCT +
>> #defines + lots of
>> assmebly) is completely incomprehensible to me.
>>
>> Unfortunately, I don't have gdb built for this platform (I managed to
find the
>> problematic line with `fprintf(stderr, ...)`, which itself could change
the way
>> it segfaults). At first sight all variables are initialized to proper
values.
>>
>> The ARM processor I'm using is (according to /proc/cpuinfo):
>>
>> Processor : ARMv6-compatible processor rev 4 (v6l)
>> CPU implementer : 0x41
>> CPU architecture: 6TEJ
>> CPU variant : 0x0
>> CPU part : 0xb36
>> CPU revision : 4
>> Hardware : Freescale MX31/MX32 3-Stack Board
>>
>>
>> Can you help me handle this issue?
>>
>> --
>> regards,
>> Slawomir Testowy
>
>
> The android has the same problem (after enabling ASM optimzations),
> crash/segfault immediately when trying to play a song. There's a number
> of codecs that do not work and most (or all, I don't know exactly) of
> them use the mdct: wma, vorbis, aac, a52, cook. I strongly suspect it's
> the very same problem, since IIUC the NDKs gcc has -fPIC on by default
> (as does the android gcc target in gcc 4.6).
>
> I hope this can be resolved.
>
> Best regards.
Received on 2010-10-10


Page was last modified "Jan 10 2012" The Rockbox Crew
aaa