Bug 714042
| Summary: | ccs_tool segfaults: (1) input file = output file and subcommand gets some options, (2) update gets no input file | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 5 | Reporter: | Attila Sragli <attila.sragli.ext> | ||||
| Component: | cman | Assignee: | Jan Pokorný [poki] <jpokorny> | ||||
| Status: | CLOSED ERRATA | QA Contact: | Cluster QE <mspqa-list> | ||||
| Severity: | low | Docs Contact: | |||||
| Priority: | unspecified | ||||||
| Version: | 5.6 | CC: | cluster-maint, edamato, fdinitto, jpokorny, rsteiger | ||||
| Target Milestone: | --- | Keywords: | EasyFix, Reopened | ||||
| Target Release: | --- | ||||||
| Hardware: | x86_64 | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | cman-2.0.115-111.el5 | Doc Type: | Bug Fix | ||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2013-09-30 22:05:54 UTC | Type: | --- | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Embargoed: | |||||||
| Attachments: |
|
||||||
|
Description
Attila Sragli
2011-06-17 08:15:55 UTC
Admittedly, "Red Hat Cluster Suite" product in Bugzilla is tempting, but no longer in use (no longer having a standalone position). As per the indicated version, flipping to RHEL 5 -- cman. If this was not encountered on RHEL, please change to Fedora rawhide. Core file arising from the segfault would be appreciated (see, e.g., https://access.redhat.com/knowledge/solutions/4896). Development Management has reviewed and declined this request. You may appeal this decision by reopening this request. # ccs_tool addfence -c /etc/cluster/cluster.conf \
-o /etc/cluster/cluster.conf virt fence_virt
> running ccs_tool update...
> Segmentation fault
[...]
> #0 _getopt_internal_r
> (argc=2, argv=0x7fffffffe730, optstring=0x40afd9 "P:", longopts=0x0,
> longind=0x0, long_only=0, d=0x2aaaab9f79c0)
> at getopt.c:461
>
> #1 _getopt_internal
> (argc=7, argv=0x7fffffffe730, optstring=0x756c632f72657473 <Address
> 0x756c632f72657473 out of bounds>, longopts=0x7, longind=0x5,
> long_only=7)
> at getopt.c:1136
>
> #2 parse_args
> (argc=2, argv=0x7fffffffe730)
> at update.c:120
>
> #3 update2
> (argc=2, argv=0x7fffffffe730)
> at update.c:194
>
> #4 update
> (location=<value optimized out>)
> at update.c:171
>
> #5 save_file
> (doc=0x61a960, ninfo=0x7fffffffe820)
> at editconf.c:246
>
> #6 add_fence
> (argc=7, argv=0x7fffffffe9a0)
> at editconf.c:1139
>
> #7 main
> (argc=7, argv=<value optimized out>)
> at ccs_tool.c:66
Problem is that there are 2+ nested independent usages of "getopt"
without resetting "optind" (+ opt{err,opt}) properly in all but the first
call (in which it is initialized implicitly by the library [1]).
Looks like a little miracle this hasn't been triggered before.
[1] http://pubs.opengroup.org/onlinepubs/7908799/xsh/getopt.html
(The Open Group Base Specifications Issue 6 ditto)
This request was evaluated by Red Hat Product Management for inclusion in a Red Hat Enterprise Linux release. Product Management has requested further review of this request by Red Hat Engineering, for potential inclusion in a Red Hat Enterprise Linux release for currently deployed products. This request is not yet committed for inclusion in a release. Another reproducer (affected: ccs/ccs_tool:update2): # ccs_tool update -P c:4200 Set cluster base port to 4200 Segmentation fault -P switch not documented in built-in help, but present in man ccs_tool. Created attachment 736552 [details] Proposed patch Now: re [comment 3]: # ccs_tool addfence -c /etc/cluster/cluster.conf \ -o /etc/cluster/cluster.conf virt fence_virt running ccs_tool update... Config file updated from version 4 to 5 re [comment 6]: # ccs_tool update -P c:4200 Set cluster base port to 4200 Source configuration file not specified. Failed to update config file (In reply to comment #7) > Created attachment 736552 [details] > Proposed patch > > Now: > > re [comment 3]: > # ccs_tool addfence -c /etc/cluster/cluster.conf \ > -o /etc/cluster/cluster.conf virt fence_virt > running ccs_tool update... > Config file updated from version 4 to 5 > > re [comment 6]: > # ccs_tool update -P c:4200 > Set cluster base port to 4200 > Source configuration file not specified. > > Failed to update config file Patch looks good, please commit to RHEL510 branch https://git.fedorahosted.org/cgit/cluster.git/commit/?h=RHEL510&id=d55fe105fd6c3dc5ceafb60e08880a5653440732 commit d55fe105fd6c3dc5ceafb60e08880a5653440732 Author: Jan Pokorný <jpokorny> Date: Wed Apr 17 15:21:54 2013 +0200 ccs_tool: fix several segfaults (1) input file = output file and subcommand gets some options (2) update gets no input file + several overflows in case the output file was specified explicitly and contained, as a global path, around 255 bytes or more Signed-off-by: Jan Pokorný <jpokorny> Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2013-1304.html |