IBM Support

IV86811: -QCHECK=UNSET CAUSING UNNECESSARY TRAP

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • The -qcheck=unset option is incorrectly issuing a trap for the
    code below:
    
    ===== COMPILE COMMAND:
    xlC -qcheck=unset test.cpp
    
    ===== TESTCASE:
    $ cat test.cpp
    #include <map>
    
    int main(int, const char*[])
    {
        std::map<int, int> map;
        map[1] = 2;
        map.erase(1);
        return 0;
    }
    $
    
    ===== ACTUAL OUTPUT:
    $ dbx a.out
    Type 'help' for help.
    reading symbolic information ...warning: no source compiled with
    -g
    
    (dbx) run
    
    Trace/BPT trap in std::bidirectional_iterator_tag
    std::_Iter_cat<std::_Tree<std::_Tmap_traits<int,int,std::less<in
    t>,std::allocator<std::pair<const int,int> >,0>
    >::iterator>(const
    std::_Tree<std::_Tmap_traits<int,int,std::less<int>,std::allocat
    or<std::pair<const int,int> >,0> >::iterator&) at 0x10006684
    0x10006684 (std::bidirectional_iterator_tag
    std::_Iter_cat<std::_Tree<std::_Tmap_traits<int,int,std::less<in
    t>,std::allocator<std::pair<const int,int> >,0>
    >::iterator>(const
    std::_Tree<std::_Tmap_traits<int,int,std::less<int>,std::allocat
    or<std::pair<const int,int> >,0> >::iterator&)+0x24) 0c830000
    tweqi   r3,0x0
    (dbx) where
    std::bidirectional_iterator_tag
    std::_Iter_cat<std::_Tree<std::_Tmap_traits<int,int,std::less<in
    t>,std::allocator<std::pair<const int,int> >,0>
    >::iterator>(const
    std::_Tree<std::_Tmap_traits<int,int,std::less<int>,std::allocat
    or<std::pair<const int,int> >,0> >::iterator&)(0x2ff224c0,
    0x2ff224e8) at 0x10006684
    void
    std::_Distance<std::_Tree<std::_Tmap_traits<int,int,std::less<in
    t>,std::allocator<std::pair<const int,int> >,0>
    >::iterator,unsigned
    long>(std::_Tree<std::_Tmap_traits<int,int,std::less<int>,std::a
    llocator<std::pair<int,int> >,0>
    >::iterator,std::_Tree<std::_Tmap_traits<int,int,std::less<int>,
    std::allocator<std::pair<int,int> >,0> >::iterator,unsigned
    long&)(0x20002d50, 0x20002d10, 0x2ff22518) at 0x100069a8
    std::_Tree<std::_Tmap_traits<int,int,std::less<int>,std::allocat
    or<std::pair<const int,int> >,0> >::erase(const
    int&)(0x2ff22570, 0x2ff22580) at 0x10006b3c
    main(0x1, 0x2ff22610) at 0x10008538
    (dbx)
    
    
    
    ===== EXPECTED OUTPUT:
    Should run to completion without a trap
    

Local fix

  • N/A
    

Problem summary

  • USERS AFFECTED:
    Uses of the -qcheck=unset option with empty
    structs or with objects that make use of empty structs.
    
    PROBLEM DESCRIPTION:
    The -qcheck=unset option checks for automatic variables that
    are used
    before they are set. In the case of empty structs they cannot
    be
    initialized and therefore should not be checked by this option.
    

Problem conclusion

  • Empty structs are a particular corner case that confuses the
    -qcheck=unset option.
    Since empty structs cannot be initialized the option should not
    apply to them.
    

Temporary fix

Comments

APAR Information

  • APAR number

    IV86811

  • Reported component name

    XL C FOR AIX

  • Reported component ID

    5725C7100

  • Reported release

    D13

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2016-07-13

  • Closed date

    2016-12-21

  • Last modified date

    2016-12-23

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    XL C FOR AIX

  • Fixed component ID

    5725C7100

Applicable component levels

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSGH2K","label":"XL C for AIX"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"D13","Line of Business":{"code":"LOB57","label":"Power"}}]

Document Information

Modified date:
29 June 2020