D. Richard Hipp wrote:
> On Dec 8, 2009, at 9:51 AM, Andreas Schwab wrote:
> 
>> "D. Richard Hipp" <d...@hwaci.com> writes:
>>
>>> On Dec 7, 2009, at 8:41 PM, Andreas Schwab wrote:
>>>
>>>> D. Richard Hipp writes:
>>>>
>>>>> As always, please let us know if you encounter any difficulties  
>>>>> with
>>>>> this or any other SQLite release.
>>>> It's still crashing due to undefined behaviour.
>>>>
>>>> $ ./sqlite3 :memory: 'create table test(integer)'
>>>> Segmentation fault
>>>>
>>>
>>> I am unable to reproduce this behavior.  The example above works fine
>>> here.  I also ran your command using valgrind and it reports no   
>>> problems.
>> That's the very nature of undefined behaviour.  You are violating  
>> the C
>> aliasing rules, and the compiler has all freedom to wreck havoc of  
>> your
>> code.  QED.
> 
> 
> No, you have not proven your thesis, you have merely stated a  
> conjecture.  For proof, could you please indicate where, exactly, we  
> are violating C aliasing rules?  And what compiler are you using that  
> is sensitive to these violations yet generates no warnings?

I'm no expert on the C standard, but I very recently got a new toy: an 
ARM PDA running a version of Ubuntu for ARMs (a "Smart Q5", for the 
curious).

I installed the available gcc compiler to test one of my programs which 
makes use of SQLite and got a segmentation fault, and also after I 
upgraded SQLite to 3.6.21.

Even before I tried to analyze the problem, I remembered this message 
and applied the patch. It doesn't segfault anymore...

So it seems I can confirm the bug and the fix.

u...@smartq:~/src/sqlite/sqlite-3.6.21$ gcc -v
Using built-in specs.
Target: arm-linux-gnueabi
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 
4.4.1-4ubuntu8' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs 
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr 
--enable-shared --enable-multiarch --enable-linker-build-id 
--with-system-zlib --libexecdir=/usr/lib --without-included-gettext 
--enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 
--program-suffix=-4.4 --enable-nls --enable-clocale=gnu 
--enable-libstdcxx-debug --enable-objc-gc --disable-sjlj-exceptions 
--with-arch=armv6 --with-tune=cortex-a8 --with-float=softfp 
--with-fpu=vfp --disable-werror --enable-checking=release 
--build=arm-linux-gnueabi --host=arm-linux-gnueabi 
--target=arm-linux-gnueabi
Thread model: posix
gcc version 4.4.1 (Ubuntu 4.4.1-4ubuntu8)

It takes 26 minutes to compile the amalgamation source on this device, 
so it took me 52 minutes of compile time just to confirm this, so I'm 
not very inclined to do a full "make test", but if there is a real 
interest I can do it.

It should probably be faster to use qemu for this, but I'm a bit green 
on this type of development.


Best regards,
~Nuno Lucas

> 
> D. Richard Hipp
> d...@hwaci.com
> 
> 
> 
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to