Bug 762790 (GLUSTER-1058) - vasprintf dumps core when %llu is involved
Summary: vasprintf dumps core when %llu is involved
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: GLUSTER-1058
Product: GlusterFS
Classification: Community
Component: core
Version: mainline
Hardware: All
OS: Solaris
low
medium
Target Milestone: ---
Assignee: shishir gowda
QA Contact:
URL:
Whiteboard:
: GLUSTER-1005 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-07-08 20:49 UTC by Krishna Srinivas
Modified: 2015-12-01 16:45 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Regression: ---
Mount Type: ---
Documentation: DNR
CRM:
Verified Versions:


Attachments (Terms of Use)

Description Krishna Srinivas 2010-07-08 20:49:16 UTC
I got two solaris core dumps here because of this bug:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37080

I think it is better to not handle vasprintf compatibility for solaris at all and work around it by doing malloc() of big enough buffer and use vsnprintf() if we need vasprintf only in logging. It is easier to restrict logging lines to say 4k size and not deal with difficult compatibility problems like this.


BACKTRACE-1:

(gdb) bt
#0  0xfed9ab25 in _lwp_kill () from /lib/libc.so.1
#1  0xfed9599f in thr_kill () from /lib/libc.so.1
#2  0xfed41ee3 in raise () from /lib/libc.so.1
#3  0xfee57fa9 in gf_print_trace (signum=11) at common-utils.c:462
#4  0xfed975df in __sighndlr () from /lib/libc.so.1
#5  0xfed8d2a0 in call_user_handler () from /lib/libc.so.1
#6  <signal handler called>
#7  0xfee64b6c in vasprintf (result=0x0, format=0xfec80dd9 "write failed: offset %llu, %s", args=0x8046878 "") at compat.c:470
#8  0xfee51eb3 in _gf_log (domain=0x80b16d8 "brick-posix", file=0x41 <Address 0x41 out of bounds>, function=0xfec80644 "posix_writev", line=2705, 
    level=GF_LOG_ERROR, fmt=0xfec80dd9 "write failed: offset %llu, %s") at logging.c:502
#9  0xfec7a82c in posix_writev (frame=0x80d09b0, this=0x80b1cd8, fd=0x80cdff8, vector=0x80b2758, count=1, offset=0, iobref=0x80d1130) at posix.c:2734
#10 0xfec563ba in ac_writev_resume (frame=0x80b3708, this=0x80b3708, fd=0x80cdff8, vector=0x80b2758, count=1, offset=0, iobref=0x80d1130)
    at access-control.c:1468
#11 0xfee62bb2 in call_resume (stub=0x80d2188) at call-stub.c:2285
#12 0xfec5647c in ac_writev_fstat_cbk (frame=0x80cf708, cookie=0x80d02a8, this=0x80b3708, op_ret=0, op_errno=0, buf=0x8046be0) at access-control.c:1493
#13 0xfec7e240 in posix_ftruncate (frame=0x80d02a8, this=0x80b1cd8, fd=0x80cdff8, offset=-80794519455717656) at posix.c:3950
#14 0xfec5660b in ac_writev (frame=0x80b3708, this=0x80b3708, fd=0x80cdff8, vector=0x8046d90, count=1, offset=0, iobref=0x80d1130) at access-control.c:1522
#15 0xfec35aa4 in pl_writev (frame=0x80d14b0, this=0x80b3fd0, fd=0x80cdff8, vector=0x8046d90, count=1, offset=0, iobref=0x80d1130) at posix.c:732
#16 0xfe3d03b6 in server_writev_resume (frame=0x80b4898, bound_xl=0x80b3fd0) at server-protocol.c:2941
#17 0xfe3d882b in server_resolve_done (frame=0x80d0d8c) at server-resolve.c:594
#18 0xfe3d8901 in server_resolve_all (frame=0x80d0d8c) at server-resolve.c:629


BACKTRACE-2:
(gdb) bt
#0  0xfed9ab25 in _lwp_kill () from /lib/libc.so.1
#1  0xfed9599f in thr_kill () from /lib/libc.so.1
#2  0xfed41ee3 in raise () from /lib/libc.so.1
#3  0xfee57fa9 in gf_print_trace (signum=11) at common-utils.c:462
#4  0xfed975df in __sighndlr () from /lib/libc.so.1
#5  0xfed8d2a0 in call_user_handler () from /lib/libc.so.1
#6  <signal handler called>
#7  0xfee64b6c in vasprintf (result=0x0, format=0xfec81490 "LOWER24 of pfd->ia_ino (%llu) does not match with inode number (%llu) got from fstat() for %s", 
    args=0x80462c8 "") at compat.c:470
#8  0xfee51eb3 in _gf_log (domain=0x80b16d0 "brick-posix", file=0x48 <Address 0x48 out of bounds>, function=0xfec8065e "posix_fstat_with_gen", line=478, 
    level=GF_LOG_ERROR, fmt=0xfec81490 "LOWER24 of pfd->ia_ino (%llu) does not match with inode number (%llu) got from fstat() for %s") at logging.c:502
#9  0xfec73dd7 in posix_fstat_with_gen (this=0x80b1cd0, pfd=0x81440e0, stbuf_p=0x8046940) at posix.c:476
#10 0xfec79515 in posix_create (frame=0x814b628, this=0x80b1cd0, loc=0x8141560, flags=2, mode=420, fd=0x8145bc0) at posix.c:2330
#11 0xfec5535b in ac_create_resume (frame=0x80b3700, this=0x80b3700, loc=0x8141560, flags=2, mode=420, fd=0x8145bc0) at access-control.c:1161
#12 0xfee63553 in call_resume (stub=0x8141548) at call-stub.c:2178
#13 0xfec5541c in ac_create_stat_cbk (frame=0x8157940, cookie=0x813d148, this=0x80b3700, op_ret=0, op_errno=0, buf=0x8046c20) at access-control.c:1185
#14 0xfec7467a in posix_stat (frame=0x813d148, this=0x80b1cd0, loc=0x8046cc0) at posix.c:729
#15 0xfec555eb in ac_create (frame=0x8157940, this=0x80b3700, loc=0x80b3700, flags=2, mode=420, fd=0x8145bc0) at access-control.c:1219
#16 0xfec349b6 in pl_create (frame=0x80b3fc8, this=0x80b3fc8, loc=0x80b6e88, flags=2, mode=420, fd=0x8145bc0) at posix.c:471
#17 0xfe3cfc38 in server_create_resume (frame=0x81571c4, bound_xl=0x80b3fc8) at server-protocol.c:2790
#18 0xfe3d882b in server_resolve_done (frame=0x81571c4) at server-resolve.c:594
#19 0xfe3d8901 in server_resolve_all (frame=0x81571c4) at server-resolve.c:629
#20 0xfe3d8b0f in server_resolve (frame=0x81571c4) at server-resolve.c:576
#21 0xfe3d88a7 in server_resolve_all (frame=0x81571c4) at server-resolve.c:625

Comment 1 shishir gowda 2010-09-21 05:21:18 UTC
Moving all solaris bug to target milestone 3.2.0

Comment 2 Anand Avati 2010-11-13 12:02:30 UTC
PATCH: http://patches.gluster.com/patch/5682 in master (Solaris: vasprint fix for %llu crash)

Comment 3 shishir gowda 2010-11-16 07:08:37 UTC
*** Bug 1005 has been marked as a duplicate of this bug. ***

Comment 4 Amar Tumballi 2011-02-15 04:55:45 UTC
Currently mention that till 3.1.2, we don't have complete solaris port.


Note You need to log in before you can comment on or make changes to this bug.