[pkg-firebird-general] Firebird pkg on SPARC

Daniel Smolik marvin at mydatex.cz
Thu Mar 15 00:12:28 CET 2007


Daniel Smolik napsal(a):
> Damyan Ivanov napsal(a):
> 
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> - -=| Daniel Smolik, 14.03.2007 23:14 |=-
>>
>>> I would like to help developing FB pkg. I am not programmer but good
>>> tester and have big experience with compiling under Linux.
>>> I am specialy interested to debian SPARC package. If you would like test
>>> some on SPARC let m know.
>>
>>
>>
>> Thanks for the generous offer :)
>>
>> After your help on 1.5.3-sparc front, can you help me get 2.0 built also?
> 
> Yes  I can :-)
> 
>>
>> Currently, as you've already read, the build of 2.0.1rc1 fails with bus
>> error at the first call of "create_db". create_db is a small,
>> statically-linked program, whose purpose is to simply create an empty
>> database file. For some reason, this program generates a BUS error on
>> sparc, meaning that it accesses memory which is not properly aligned.
>>
> When I try compile 1.5 it crashes too. But when I disable things about 
> cpu and mcpu it compiles and run.
> 
>> (please don't get offended if I am too verbose in my explanations below.
>> I don't assume anything about your abilities/knowledge. The only reason
>> to be verbose is to ensure you have enough information to understand
>> what I mean)
>>
>> Why 1.5 builds ok and 2.0 fails is a mistery to me. I have zero
>> experience with sparc, but from what I've heard, CPU has some
>> constraints when accessing memory. For example, it requires that if a
>> program accesses a 4-byte memory value that that value must start at an
>> address that is multiple of 4 (like 0, 4, 8, etc). If a program tries to
>> fetch a 4-byte value from address 3, it receives a BUS error.
> 
> It is true SPARC is big and i386 little endian or reverse :-)  is the 
> same as my first computer Amiga. This problem is called unaligned access 
>  Am I right ?
> 
>>
>> So, there is something wrong in the 2.0-related changes (probably not
>> caused by debian patches) that make firebird2.0 access unaligned memory.
>> To see what exactly happens, upstream developers need a backtrace.
>>
>> Backtrace is a list of source lines, which the program was executing at
>> the moment of the bus error. To get it, please do the following on sparc.
>>
>> 1. Get the sources. The easiest way is to run "dget -x
>> http://your.mirror.here/debian/pool/main/f/firebird2.0/firebird2.0_2.0.0.12748.ds1-5.dsc". 
>>
>> dget is in the "devscripts" debian package. It will download the source
>> package and extract it into ./firebird2.0-2.0.0.12748.ds1
>> 2. cd firebird2.0-2.0.0.12748.ds1
>> 3. Check that all packages needed for the build are present
>>   dpkg-checkbuilddeps
>> 4. disable the autoboot debian patch
>>   edit debian/patches/series and place a dash before the line
>> "autoboot.patch"
>> 5. apply all patches
>>   quilt push -a
>> 3. run "./autogen.sh --enable-debug"
>>   (this will require that autoconf is installed)
>> 4. run "make"
>> .. eventually, make is interrupted because of the bus error of create_db
>> 5. get a backtrace: (gdb is in the gdb debian package)
>>   export FIREBIRD=./gen/firebird
>>   gdb gen/firebird/bin/create_db
>>   ... gdb prints some messages ...
>>   (gdb) run empty.fdb
>> Program received signal SIGBUS, Bus error.
>>   (gdb) bt
>>   ... gdb shows the backtrace ...
>>
>> All this is much easier if you have someone to ask when stuck. Please
>> feel free to contact me on my Jabber ID "dam at jabber.minus273.org" or on
>> IRC (I am "dam" on server irc.debian.org, usually I hang on
>> #debian-devel). If you prefer some other instant messaging protocol -
>> please say so and I'll try to reach you.
>>
>> Thank you for your help so far and please keep it coming :)

  gdb gen/firebird/bin/create_db
GNU gdb 6.6-debian
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain 
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "sparc-linux-gnu"...
Using host libthread_db library "/lib/libthread_db.so.1".
(gdb) run empty.fdb
Starting program: 
/home/marvin/tmp/firebird2.0-2.0.0.12748.ds1/gen/firebird/bin/ 
   create_db empty.fdb
warning: Lowest section in /usr/lib/libicudata.so.36 is .hash at 000000b4
[Thread debugging using libthread_db enabled]
[New Thread 16384 (LWP 14443)]

Program received signal SIGBUS, Bus error.
[Switching to Thread 16384 (LWP 14443)]
0x001748f0 in validate_owner (own_ptr=12028, freed=1)
     at ../src/lock/lock.cpp:4468
4468            CHECK(owner->own_acquire_time <= LOCK_header->lhb_acquires);
(gdb) bt
#0  0x001748f0 in validate_owner (own_ptr=12028, freed=1)
     at ../src/lock/lock.cpp:4468
#1  0x00175be8 in validate_lhb (lhb=0xf6ebc000) at ../src/lock/lock.cpp:4275
#2  0x0017a958 in create_owner (status_vector=0xffe91b80, owner_id=14443,
     owner_type=3 '\003', owner_handle=0x4da848) at 
../src/lock/lock.cpp:2177
#3  0x0017aadc in LOCK_init (status_vector=0xffe91b80, owner_flag=true,
     owner_id=14443, owner_type=3 '\003', owner_handle=0x4da848)
     at ../src/lock/lock.cpp:743
#4  0x0008dd60 in LCK_init (tdbb=0xffe8f6cc,
     owner_type=Jrd::LCK_OWNER_attachment) at ../src/jrd/lck.cpp:606
#5  0x0007f14c in jrd8_create_database (user_status=0xffe91b80,
     _file_length=0, _file_name=0xffe8f84c "empty.fdb", handle=0xffe919c8,
     dpb_length=0, dpb=0xffe91870 "\001", db_type=0,
     _expanded_filename=0xffe9084c 
"/home/marvin/tmp/firebird2.0-2.0.0.12748.ds1/            empty.fdb") at 
../src/jrd/jrd.cpp:1888
#6  0x0005da58 in isc_create_database (user_status=0xffe91b80, 
file_length=0,
     file_name=0xffe91dc8 "empty.fdb", public_handle=0xffe91bd4, 
dpb_length=0,
     dpb=0x0, db_type=0) at ../src/jrd/why.cpp:1445
#7  0x000162b4 in main (argc=2, argv=0xffe91ca4)
     at ../src/utilities/create_db.cpp:22
(gdb)

Dan



More information about the pkg-firebird-general mailing list