I did more investigations and here is what I found. Note that manually
calculated alligned address is correct. Also note that the rest of
"invalid address looks like correct one has". It seems assignment
right part of expression cut 8 bytes pointers to 4 bytes. But I have
explanation of this.

Starting program: /home/roman/prj/firebird/gen/Debug/firebird/bin/isql
-q -i /home/roman/prj/firebird/src/dbs/metadata.sql
warning: no loadable sections found in added symbol-file
system-supplied DSO at 0x7ffff7ffa000
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff5251700 (LWP 17940)]
[Thread 0x7ffff5251700 (LWP 17940) exited]
[New Thread 0x7ffff4a50700 (LWP 17941)]

Breakpoint 1, Firebird::ZeroBuffer::ZeroBuffer (this=0x7ffff7f8a7b8,
p=..., size=262144)
    at 
/home/roman/prj/firebird/src/include/../jrd/../jrd/../common/classes/File.h:57
57 bufAligned = buffer.getBuffer(bufSize + SYS_PAGE_SIZE);
(gdb) n
58 bufAligned = (char*) FB_ALIGN((U_IPTR) bufAligned, SYS_PAGE_SIZE);
(gdb) print bufAligned
$4 = 0x7ffff1e93040
"\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314",
<incomplete sequence \314>...
(gdb) print sizeof(FB_SIZE_T)
$5 = 4
(gdb) print sizeof(size_t)
$6 = 8
(gdb) print (char*) ((0x7ffff1e93040 + 4096 - 1) & ~(4096 - 1))
$9 = 0x7ffff1e94000
"\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314\314",
<incomplete sequence \314>...
(gdb) n
59 memset(bufAligned, 0, size);
(gdb) print bufAligned
$10 = 0xf1e94000 <Address 0xf1e94000 out of bounds>
(gdb) print sizeof(U_IPTR)
$11 = 8



-- 
Roman Simakov

------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to