Description of problem: multipathd daemon segfaults when no LUN wwid value present along with the keyword wwid . A typo mistake in multipath.conf should not segfault the daemon. Version-Release number of selected component (if applicable): device-mapper-multipath-0.4.7-42.el5 How reproducible: Always Steps to Reproduce: 1. # grep -v ^# /etc/multipath.conf multipaths { multipath { wwid alias red } multipath { wwid 1IET_00010001 alias hat } } 2. # service multipathd start Starting multipathd daemon: [ OK ] 3. # multipath -ll Segmentation fault /var/log/message reported segfault kernel: multipath[15911]: segfault at 0000000000000000 rip 0000000000412a4d rsp 00007fff45a7b000 error 4 Actual results: multipathd daemon segfaults Expected results: Multipathd daemons should fail with warning message instead of segfault. Additional info: # file /tmp/core.15911 /tmp/core.15911: ELF 64-bit LSB core file AMD x86-64, version 1 (SYSV), SVR4-style, from 'multipath' #0 0x0000000000412a4d in set_value (strvec=0x46199d0) at parser.c:378 378 int size = strlen(str); (gdb) bt #0 0x0000000000412a4d in set_value (strvec=0x46199d0) at parser.c:378 #1 0x000000000040b065 in wwid_handler (strvec=0x46199d0) at dict.c:1006 #2 0x0000000000412eb0 in process_stream (keywords=0x4618880) at parser.c:493 #3 0x0000000000412edc in process_stream (keywords=0x4618480) at parser.c:497 #4 0x0000000000412edc in process_stream (keywords=0x46173b0) at parser.c:497 #5 0x000000000041300b in init_data (conf_file=0x42b5b4 "/etc/multipath.conf", init_keywords=0x40d663 <init_keywords>) at parser.c:542 #6 0x0000000000404c94 in load_config (file=0x42b5b4 "/etc/multipath.conf") at config.c:426 #7 0x000000000040332e in main (argc=2, argv=0x7fff45a7b318) at main.c:325 (gdb) frame 1 #1 0x000000000040b065 in wwid_handler (strvec=0x46199d0) at dict.c:1006 1006 mpe->wwid = set_value(strvec); (gdb) p mpe->wwid $1 = 0x0 Seems there is no condition check if the wwid value is NULL . - dominic
Hello Ben, Dominic, I wonder if the solution is to a. create a syntax checker for multipath.conf. b. get multipathd to not start with an invalid conf file. This is the behaviour with other daemons such as apache or samba.
multipath now correctly checks for empty values.
Technical note added. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: multipath wasn't checking if the user had actually entered a value for their multipath.conf options, before it tried to read it. This caused multipathd to crash when users entered options in to multipath.conf without any values. Multipath now checks if there is a value before attempting to read it, and it no longer crashes.
Verified, we now get an error message. # multipath -ll error parsing config file
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2011-1032.html