Features Download
From: Lena =?iso-8859-1?b?QnL8ZGVy?= <lena-oNqjzoJTaLRrfnJkvnVBVw <at> public.gmane.org>
Subject: libsndfile with 32bit qnx: "Ultimate sanity check" fails
Newsgroups: gmane.comp.audio.libsndfile.devel
Date: Friday 18th May 2012 13:12:05 UTC (over 4 years ago)
Hello Erik de Castro Lopo/libsndfile-developers,
first: thank you for that good library (libsndfile). It is charmingly  
easy to use it to open and read audio files with it.

Back to the hard part:
I am a student from Bochum/Germany and at the time writing my masters  
thesis in computer science, where I am using libsndfile to read wav  
files. Since the software I am writing needs to run on QNX  
(6.5)/ARMv7, I cross-compiled your library, which worked fine without  
compilation errors. But when I try to open a file with sf_open, I get  
an assertion error:

In function sf_open -- sndfile.c:312 sizeof (sf_count_t) == 8 --  
assertion failed

In your source, you state that this is the "Ultimate sanity check",  
but obviously this only works if sf_count_t is 64bits wide. In the  
configure-generated sndfile.h, sf_count_t is defined as off_t (line  
319), which is only 32bits wide in my case here. During configure, I  
get a warning:

checking size of wchar_t... 4
checking size of short... 2
checking size of int... 4
checking size of long... 4
checking size of float... 4
checking size of double... 8
checking size of void*... 4
checking size of size_t... 4
checking size of int64_t... 8
checking size of long long... 8
checking size of off_t... 4
checking size of loff_t... 0
checking size of off64_t... 8
checking for arm-unknown-nto-qnx6.5.0eabi-getconf... no
checking for getconf... getconf
checking for CFLAGS value to request large file support...
checking for LDFLAGS value to request large file support...
checking for LIBS value to request large file support...
checking for _FILE_OFFSET_BITS... no
checking for _LARGEFILE_SOURCE... no
checking for _LARGE_FILES... no
checking size of off_t... 4
configure: WARNING: This machine does not seem to support 64 bit file

In fact, I do not need large file support. Is it possible to disable  
that? I tried faking the lib with just uncommenting that assertion,  
but as expected, that did not work properly (that leaded to the  
library thinking a file with 2 channels has 65538, bit 17 set where it  
should not be set).

With linux, everything is fine.

If you think this might be a bug in your library, I will be happy to  
supply you with more information. If not, I would be happy to have any  
information or idea how I could go on from now, or at least that this  
probably is no bug and that I should go on searching for the problem  
on my side here.

Host: x86/amd64 CPU, 2GiB RAM, Sabayon Linux (->Gentoo fork with binaries)
compiled libsndfile 1.0.25 from source, downloaded from your website  
with QNX qcc cross-compiler, which in fact is gcc 4.4.2 for armv7. It  
is the compiler included in the blackberry playbook ndk 2.0.1.

One thing aside from this: I was not able to test an older version of  
your library, as there are some permission problems on your webserver.  
I was not able to download any version except the latest one - maybe  
you didn't notice that up to now...

Kind regards,
Lena BrĂ¼der
CD: 3ms