This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 148453 - Highlighting thread hangs on boost
Summary: Highlighting thread hangs on boost
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Model (show other bugs)
Version: 6.x
Hardware: All All
: P1 blocker (vote)
Assignee: Vladimir Kvashin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-26 07:59 UTC by Vladimir Kvashin
Modified: 2008-10-01 17:37 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
stack (11.59 KB, text/plain)
2008-09-26 08:02 UTC, Vladimir Kvashin
Details
another stack (115.58 KB, text/plain)
2008-09-26 08:09 UTC, Vladimir Kvashin
Details
Proposed fix (1.47 KB, text/plain)
2008-09-29 09:56 UTC, Vladimir Kvashin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Kvashin 2008-09-26 07:59:45 UTC
Open boost project; start opening files one by one.
On 5-th - 15th file, error highlighting does not appear.
Stack dump shows stack overflow.
Comment 1 Vladimir Kvashin 2008-09-26 08:02:00 UTC
Created attachment 70650 [details]
stack
Comment 2 Vladimir Kvashin 2008-09-26 08:09:20 UTC
Created attachment 70653 [details]
another stack
Comment 3 Vladimir Kvashin 2008-09-26 08:12:18 UTC
It seems it's rather a very deep stack that causes it to be very slow.
At leas I haven't seen stack overflow exception.
Comment 4 Vladimir Kvashin 2008-09-26 08:33:55 UTC
File: 
subrule.opp

Construct:
        template <int N, typename ListT>
        struct get_subrule
        {
            typedef typename get_subrule<N, typename ListT::rest_t>::type type;
        };

For typedef type, the chain of original types seems to go forever

Comment 5 Leonid Lenyashin 2008-09-26 08:58:09 UTC
Please do not forget to evaluate IZs when you look at them.
Comment 6 Vladimir Kvashin 2008-09-26 20:44:08 UTC
Here is a localized code example 

template<typename T1, typename T2> class subrule_list {
};

template<int T1, typename T2, typename T3> class subrule_parser {
};

template <int N, typename ListT>
struct get_subrule {
    typedef typename get_subrule<N, typename ListT::rest_t>::type type;
};

template <typename ParserT, typename ScannerT>
struct parser_result
{
    //typedef typename parser_type::template result<ScannerT>::type type;
};

template <int ID, typename ScannerT, typename ContextResultT>
struct get_subrule_result
{
            typedef typename
                get_subrule<ID, typename ScannerT::list_t>::type
            parser_t;

            typedef typename parser_result<parser_t, ScannerT>::type
            def_result_t;
};

Comment 7 Vladimir Kvashin 2008-09-29 06:25:24 UTC
After that happens, IDE is still functional; only highlighting feature does not work any more.
Comment 8 Vladimir Kvashin 2008-09-29 08:55:49 UTC
I see the issue is in o.n.m.c.modelimpl.csm.Instantiation.getClassifier:
it tries to instantiate the element that is already an instantiation;
the newly created instantiation (that wraps a previously created one)
Comment 9 Vladimir Kvashin 2008-09-29 09:56:17 UTC
Created attachment 70783 [details]
Proposed fix
Comment 10 Vladimir Kvashin 2008-09-30 16:41:00 UTC
Please disregard the attached patch ("proposed fix"). 

The proper fix is pushed into the CND integration repository.

Fix:
http://elif.russia.sun.com/hg/release65_cnd_freeze/rev/144890364e4d
Test:
http://elif.russia.sun.com/hg/release65_cnd_freeze/rev/1954070e8dce

QA, verify please.
Comment 11 soldatov 2008-10-01 09:14:26 UTC
Verified. Inaccuracy tests works without problem on Boost.
Comment 12 Vladimir Kvashin 2008-10-01 11:14:34 UTC
Fixed in main
fix:
http://hg.netbeans.org/main/rev/5245b8fd6edd
test:
http://hg.netbeans.org/main/rev/2b3c35a070ca
Comment 13 Egor Ushakov 2008-10-01 12:09:01 UTC
Fix is verified, no objections.
Just check that performance did not regress.
Comment 14 Vladimir Kvashin 2008-10-01 15:03:24 UTC
I measured initial boost parsing; I see no regression.
Comment 15 Vladimir Kvashin 2008-10-01 15:55:04 UTC
Visiting all references on ddd project does not show regressions either.
Comment 16 Quality Engineering 2008-10-01 17:37:34 UTC
Integrated into 'main-golden', will be available in build *200810011401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/5245b8fd6edd
User: Vladimir Kvashin <vkvashin@netbeans.org>
Log: Fix for #148453  Highlighting thread hangs on boost