Issue Details (XML | Word | Printable)

Key: CORE-5233
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Adriano dos Santos Fernandes
Reporter: James Clarke
Votes: 1
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
Firebird Core

Unaligned Memory Access in MET_format

Created: 09/May/16 08:27 AM   Updated: 17/Jun/16 03:27 PM
Component/s: Build Issues / Porting
Affects Version/s: 4.0 Initial, 3.0.0
Fix Version/s: 3.0.1, 4.0 Alpha 1

Environment: Debian sid, sparc64

QA Status: Cannot be tested


 Description  « Hide
When building employee.fdb on sparc64, a bus error (unaligned memory access) is produced:

sh -x -c "lockfile -1 ../../gen/Release/firebird/bin/build-db.lock && ./empbuild ../../gen/examples/employee.fdb; res=\$?; rm -f ../../gen/Release/firebird/bin/build-db.lock; exit \$res"
+ lockfile -1 ../../gen/Release/firebird/bin/build-db.lock
ERROR: ld.so: object 'libeatmydata.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
+ ./empbuild ../../gen/examples/employee.fdb
creating database ../../gen/examples/employee.fdb
Turning forced writes off
Creating tables
Turning off indices and triggers
Bus error
Couldn't turn off indices and triggers
+ res=44
+ rm -f ../../gen/Release/firebird/bin/build-db.lock
+ exit 44
Makefile.examples:125: recipe for target '../../gen/examples/employee.fdb' failed

This was introduced in https://github.com/FirebirdSQL/firebird/commit/218f419b5c28093149c5bd5c6194f64091c37b1c, as the additional descriptors are placed back-to-back without any alignment. From gdb:

Program received signal SIGBUS, Bus error.
MET_format (tdbb=tdbb@entry=0x7feffff8c88, relation=relation@entry=0xfff8000104652448, number=<optimized out>) at /build/firebird3.0-dW50KH/firebird3.0-3.0.0.32483.ds4/temp/Release/jrd/met.cpp:5514
5514 dsc desc = *odsDflDesc;
(gdb) bt
#0 MET_format (tdbb=tdbb@entry=0x7feffff8c88, relation=relation@entry=0xfff8000104652448, number=<optimized out>) at /build/firebird3.0-dW50KH/firebird3.0-3.0.0.32483.ds4/temp/Release/jrd/met.cpp:5514
#1 0xfff80001026c098c in make_format (tdbb=tdbb@entry=0x7feffff8c88, relation=relation@entry=0xfff8000104652448, version=version@entry=0x7feffff7de8, stack=<optimized out>, stack@entry=0xfff8000107ef9ad8)
    at /build/firebird3.0-dW50KH/firebird3.0-3.0.0.32483.ds4/temp/Release/jrd/dfw.cpp:9543
#2 0xfff80001026c2588 in make_version (tdbb=0x7feffff8c88, phase=<optimized out>, work=0xfff8000107446f68, transaction=0xfff8000107445bf0) at /build/firebird3.0-dW50KH/firebird3.0-3.0.0.32483.ds4/temp/Release/jrd/dfw.cpp:10220
#3 0xfff80001026b9710 in DFW_perform_work (tdbb=tdbb@entry=0x7feffff8c88, transaction=transaction@entry=0xfff8000107445bf0) at /build/firebird3.0-dW50KH/firebird3.0-3.0.0.32483.ds4/temp/Release/jrd/dfw.cpp:4513
#4 0xfff800010264c15c in TRA_commit (tdbb=tdbb@entry=0x7feffff8c88, transaction=transaction@entry=0xfff8000107445bf0, retaining_flag=retaining_flag@entry=false)
    at /build/firebird3.0-dW50KH/firebird3.0-3.0.0.32483.ds4/src/jrd/tra.cpp:376
#5 0xfff800010267b94c in commit (tdbb=tdbb@entry=0x7feffff8c88, transaction=transaction@entry=0xfff8000107445bf0, retaining_flag=retaining_flag@entry=false) at /build/firebird3.0-dW50KH/firebird3.0-3.0.0.32483.ds4/src/jrd/jrd.cpp:5458
#6 0xfff800010267c090 in JRD_commit_transaction (tdbb=tdbb@entry=0x7feffff8c88, transaction=0xfff8000107445bf0) at /build/firebird3.0-dW50KH/firebird3.0-3.0.0.32483.ds4/src/jrd/jrd.cpp:7670
#7 0xfff8000102687bf0 in Jrd::JTransaction::commit (this=this@entry=0xfff80001000dbf88, user_status=user_status@entry=0x7feffff8e90) at /build/firebird3.0-dW50KH/firebird3.0-3.0.0.32483.ds4/src/jrd/jrd.cpp:2178
#8 0xfff800010269a400 in Firebird::ITransactionBaseImpl<Jrd::JTransaction, Firebird::CheckStatusWrapper, Firebird::IReferenceCountedImpl<Jrd::JTransaction, Firebird::CheckStatusWrapper, Firebird::Inherit<Firebird::IVersionedImpl<Jrd::JTransaction, Firebird::CheckStatusWrapper, Firebird::Inherit<Firebird::ITransaction> > > > >::cloopcommitDispatcher (self=0xfff80001000dbf90, status=0x7feffff9048)
    at /build/firebird3.0-dW50KH/firebird3.0-3.0.0.32483.ds4/src/include/firebird/IdlFbInterfaces.h:7045
#9 0xfff800010028ef00 in Firebird::ITransaction::commit<Firebird::CheckStatusWrapper> (status=0x7feffff9040, this=0xfff80001000dbf90) at /build/firebird3.0-dW50KH/firebird3.0-3.0.0.32483.ds4/src/include/firebird/IdlFbInterfaces.h:1107
#10 Why::YTransaction::commit (this=this@entry=0xfff8000100041068, status=status@entry=0x7feffff9040) at /build/firebird3.0-dW50KH/firebird3.0-3.0.0.32483.ds4/src/yvalve/why.cpp:4750
#11 0xfff80001002acd80 in Firebird::ITransactionBaseImpl<Why::YTransaction, Firebird::CheckStatusWrapper, Firebird::IReferenceCountedImpl<Why::YTransaction, Firebird::CheckStatusWrapper, Firebird::Inherit<Firebird::IVersionedImpl<Why::YTransaction, Firebird::CheckStatusWrapper, Firebird::Inherit<Firebird::ITransaction> > > > >::cloopcommitDispatcher (self=0xfff8000100041070, status=0x1000018a440 <fbStatusObj+8>)
    at /build/firebird3.0-dW50KH/firebird3.0-3.0.0.32483.ds4/src/include/firebird/IdlFbInterfaces.h:7045
#12 0x000001000001c7e4 in commit_trans(Firebird::ITransaction**) ()
#13 0x0000010000028d90 in process_statement(char const*) ()
#14 0x000001000002ac74 in do_isql() ()
#15 0x000001000002d778 in ISQL_main(int, char**) ()
#16 0xfff800010100602c in __libc_start_main () from /lib/sparc64-linux-gnu/libc.so.6
#17 0x000001000000a52c in _start ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb) p odsDflDesc
$1 = (const Ods::Descriptor *) 0x7feffff7803

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.