---
** [tickets:#2534] log: reference of variable before assignment caused
segmentation fault on agent**
**Status:** unassigned
**Milestone:** 5.17.10
**Created:** Tue Jul 25, 2017 05:24 AM UTC by Tai Dinh
**Last Updated:** Tue Jul 25, 2017 05:24 AM UTC
**Owner:** nobody
Inside the LogAgent::saLogInitialize(), o_msg was defined without
initialization.
It's later on is only assigned during lga_mds_msg_sync_send() if the message
can be synced.
In the case the message failed to be sent, lga_msg_destroy() will be called to
free the o_msg.
This will cause the coredump if o_msg contains some garbarge value.
[[~~~
#0 0x00007fef288c80c7 in raise () from /lib64/libc.so.6
#1 0x00007fef288c9478 in abort () from /lib64/libc.so.6
#2 0x00007fef28905784 in __libc_message () from /lib64/libc.so.6
#3 0x00007fef2890b026 in malloc_printerr () from /lib64/libc.so.6
#4 0x00007fef2890bd53 in _int_free () from /lib64/libc.so.6
#5 0x00007fef29704174 in LogAgent::saLogInitialize (this=0x7fef2990a3e0
<LogAgent::me_>, logHandle=0x252e698, callbacks=0x7fef2af62200 <logCallbacks>,
version=0x7fef2af621f3 <tempLogVersion>) at
../../opensaf/src/log/agent/lga_agent.cc:363
...
### BT FULL ###
#0 0x00007fef288c80c7 in raise () from /lib64/libc.so.6
No symbol table info available.
#1 0x00007fef288c9478 in abort () from /lib64/libc.so.6
No symbol table info available.
#2 0x00007fef28905784 in __libc_message () from /lib64/libc.so.6
No symbol table info available.
#3 0x00007fef2890b026 in malloc_printerr () from /lib64/libc.so.6
No symbol table info available.
#4 0x00007fef2890bd53 in _int_free () from /lib64/libc.so.6
No symbol table info available.
#5 0x00007fef29704174 in LogAgent::saLogInitialize (this=0x7fef2990a3e0
<LogAgent::me_>, logHandle=0x252e698, callbacks=0x7fef2af62200 <logCallbacks>,
version=0x7fef2af621f3 <tempLogVersion>) at
../../opensaf/src/log/agent/lga_agent.cc:363
t_ = {trace_leave_called = false, file_ = 0x0, function_ = 0x0}
ais_rc = SA_AIS_OK
client_id = 0
client_ver = {releaseCode = 65 'A', majorVersion = 2 '\002',
minorVersion = 1 '\001'}
__FUNCTION__ = "saLogInitialize"
__func__ = "saLogInitialize"
client = <optimized out>
i_msg = {next = 0x0, type = LGSV_LGA_API_MSG, info = {api_info = {type
= LGSV_INITIALIZE_REQ, param = {init = {version = {releaseCode = 65 'A',
majorVersion = 2 '\002', minorVersion = 1 '\001'}}, finalize = {client_id =
66113}, lstr_open_sync = {client_id = 66113, lstr_name = {_opaque = {0 <repeats
129 times>}}, logFileName = 0x0, logFilePathName = 0x0, maxLogFileSize = 0,
maxLogRecordSize = 0, haProperty = SA_FALSE, logFileFullAction =
SA_LOG_FULL_ACTION_BEGIN, maxFilesRotated = 0, logFileFmtLength = 0, logFileFmt
= 0x0, lstr_open_flags = 0 '\000'}, lstr_close = {client_id = 66113, lstr_id =
0}, write_log_async = {invocation = 66113, ack_flags = 0, client_id = 0,
lstr_id = 0, logRecord = 0x0, logSvcUsrName = 0x0, logTimeStamp = 0x0}}},
cbk_info = {type = LGSV_WRITE_LOG_CALLBACK_IND, lgs_client_id = 0,
lgs_stream_id = 66113, inv = 0, serverity_filter_cbk = {log_severity = 0},
write_cbk = {error = 0}, clm_node_status_cbk = {clm_node_status = 0}},
api_resp_info = {type = LGSV_I
NITIALIZE_RSP, rc = 0, param = {init_rsp = {client_id = 66113}, lstr_open_rsp
= {client_id = 66113, lstr_id = 0}, finalize_rsp = {client_id = 66113},
close_rsp = {client_id = 66113, lstr_id = 0}}}}}
o_msg = 0x7fef2b184b08
rc = <optimized out>
]]
~~~(http://)(http://)
/Tai
---
Sent from sourceforge.net because opensaf-tickets@lists.sourceforge.net is
subscribed to https://sourceforge.net/p/opensaf/tickets/
To unsubscribe from further messages, a project admin can change settings at
https://sourceforge.net/p/opensaf/admin/tickets/options. Or, if this is a
mailing list, you can unsubscribe from the mailing list.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Opensaf-tickets mailing list
Opensaf-tickets@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-tickets