Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xcode 6.1 quickly shutdown when activating breakpoint anywhere #466

Closed
toolbits opened this issue Nov 12, 2014 · 10 comments
Closed

Xcode 6.1 quickly shutdown when activating breakpoint anywhere #466

toolbits opened this issue Nov 12, 2014 · 10 comments
Assignees
Milestone

Comments

@toolbits
Copy link

I use cpp-netlib 0.11.1RC2 on Xcode 6.1 + Yosemite + boost 1.56.0.
When I use boost::network::uri::uri class and make it's instance, I cannot use Xcode's debugger with breakpoints.
If there is no breakpoints and breakpoints are deactivated, that code run smoothly.
If a breakpoint is installed anywhere, Xcode's debugger quickly hung-up.

I found where is the problem.
Below code is in boost/network/uri/uri.ipp file:

if 0

                    // original code
                    ipv6address %= qi::raw
                    [qi::repeat(6)[h16 >> ':'] >> ls32 |
                     "::" >> qi::repeat(5)[h16 >> ':'] >> ls32 |
                     -qi::raw[h16] >> "::" >> qi::repeat(4)[h16 >> ':'] >> ls32 |
                     -qi::raw[h16] >> "::" >> qi::repeat(3)[h16 >> ':'] >> ls32 |
                     -qi::raw[h16] >> "::" >> qi::repeat(2)[h16 >> ':'] >> ls32 |
                     -qi::raw[h16] >> "::" >> h16 >> ':' >> ls32 |
                     -qi::raw[h16] >> "::" >> ls32 | -qi::raw[h16] >> "::" >> h16 |
                     -qi::raw[h16] >> "::" |
                     -qi::raw[qi::repeat(1)[(h16 >> ':')] >> h16] >> "::" >>
                     qi::repeat(3)[h16 >> ':'] >> ls32 |
                     -qi::raw[qi::repeat(1)[(h16 >> ':')] >> h16] >> "::" >>
                     qi::repeat(2)[h16 >> ':'] >> ls32 |
                     -qi::raw[qi::repeat(1)[(h16 >> ':')] >> h16] >> "::" >> h16 >>
                     ':' >> ls32 |
                     -qi::raw[qi::repeat(1)[(h16 >> ':')] >> h16] >> "::" >> ls32 |
                     -qi::raw[qi::repeat(1)[(h16 >> ':')] >> h16] >> "::" >> h16 |
                     -qi::raw[qi::repeat(1)[(h16 >> ':')] >> h16] >> "::" |
                     -qi::raw[qi::repeat(2)[(h16 >> ':')] >> h16] >> "::" >>
                     qi::repeat(2)[h16 >> ':'] >> ls32 |
                     -qi::raw[qi::repeat(2)[(h16 >> ':')] >> h16] >> "::" >> h16 >>
                     ':' >> ls32 |
                     -qi::raw[qi::repeat(2)[(h16 >> ':')] >> h16] >> "::" >> ls32 |
                     -qi::raw[qi::repeat(2)[(h16 >> ':')] >> h16] >> "::" >> h16 |
                     -qi::raw[qi::repeat(2)[(h16 >> ':')] >> h16] >> "::" |
                     -qi::raw[qi::repeat(3)[(h16 >> ':')] >> h16] >> "::" >> h16 >>
                     ':' >> ls32 |
                     -qi::raw[qi::repeat(3)[(h16 >> ':')] >> h16] >> "::" >> ls32 |
                     -qi::raw[qi::repeat(3)[(h16 >> ':')] >> h16] >> "::" >> h16 |
                     -qi::raw[qi::repeat(3)[(h16 >> ':')] >> h16] >> "::" |
                     -qi::raw[qi::repeat(4)[(h16 >> ':')] >> h16] >> "::" >> ls32 |
                     -qi::raw[qi::repeat(4)[(h16 >> ':')] >> h16] >> "::" >> h16 |
                     -qi::raw[qi::repeat(4)[(h16 >> ':')] >> h16] >> "::" |
                     -qi::raw[qi::repeat(5)[(h16 >> ':')] >> h16] >> "::" >> h16 |
                     -qi::raw[qi::repeat(5)[(h16 >> ':')] >> h16] >> "::" |
                     -qi::raw[qi::repeat(6)[(h16 >> ':')] >> h16] >> "::"];

else

                    // fixed for Xcode 6.1 + boost 1.56.0
                    qi::rule<const_iterator, string_type()> a;
                    qi::rule<const_iterator, string_type()> b;
                    qi::rule<const_iterator, string_type()> c;
                    qi::rule<const_iterator, string_type()> d;
                    a %= qi::repeat(6)[h16 >> ':'] >> ls32 |
                    "::" >> qi::repeat(5)[h16 >> ':'] >> ls32 |
                    -qi::raw[h16] >> "::" >> qi::repeat(4)[h16 >> ':'] >> ls32 |
                    -qi::raw[h16] >> "::" >> qi::repeat(3)[h16 >> ':'] >> ls32 |
                    -qi::raw[h16] >> "::" >> qi::repeat(2)[h16 >> ':'] >> ls32 |
                    -qi::raw[h16] >> "::" >> h16 >> ':' >> ls32 |
                    -qi::raw[h16] >> "::" >> ls32 | -qi::raw[h16] >> "::" >> h16 |
                    -qi::raw[h16] >> "::" |
                    -qi::raw[qi::repeat(1)[(h16 >> ':')] >> h16] >> "::" >> qi::repeat(3)[h16 >> ':'] >> ls32 |
                    -qi::raw[qi::repeat(1)[(h16 >> ':')] >> h16] >> "::" >> qi::repeat(2)[h16 >> ':'] >> ls32 |
                    -qi::raw[qi::repeat(1)[(h16 >> ':')] >> h16] >> "::" >> h16 >> ':' >> ls32;
                    b %= -qi::raw[qi::repeat(1)[(h16 >> ':')] >> h16] >> "::" >> ls32 |
                    -qi::raw[qi::repeat(1)[(h16 >> ':')] >> h16] >> "::" >> h16 |
                    -qi::raw[qi::repeat(1)[(h16 >> ':')] >> h16] >> "::" |
                    -qi::raw[qi::repeat(2)[(h16 >> ':')] >> h16] >> "::" >> qi::repeat(2)[h16 >> ':'] >> ls32 |
                    -qi::raw[qi::repeat(2)[(h16 >> ':')] >> h16] >> "::" >> h16 >> ':' >> ls32;
                    c %= -qi::raw[qi::repeat(2)[(h16 >> ':')] >> h16] >> "::" >> ls32 |
                    -qi::raw[qi::repeat(2)[(h16 >> ':')] >> h16] >> "::" >> h16 |
                    -qi::raw[qi::repeat(2)[(h16 >> ':')] >> h16] >> "::" |
                    -qi::raw[qi::repeat(3)[(h16 >> ':')] >> h16] >> "::" >> h16 >> ':' >> ls32;
                    d %= -qi::raw[qi::repeat(3)[(h16 >> ':')] >> h16] >> "::" >> ls32 |
                    -qi::raw[qi::repeat(3)[(h16 >> ':')] >> h16] >> "::" >> h16 |
                    -qi::raw[qi::repeat(3)[(h16 >> ':')] >> h16] >> "::" |
                    -qi::raw[qi::repeat(4)[(h16 >> ':')] >> h16] >> "::" >> ls32 |
                    -qi::raw[qi::repeat(4)[(h16 >> ':')] >> h16] >> "::" >> h16 |
                    -qi::raw[qi::repeat(4)[(h16 >> ':')] >> h16] >> "::" |
                    -qi::raw[qi::repeat(5)[(h16 >> ':')] >> h16] >> "::" >> h16 |
                    -qi::raw[qi::repeat(5)[(h16 >> ':')] >> h16] >> "::" |
                    -qi::raw[qi::repeat(6)[(h16 >> ':')] >> h16] >> "::";
                    ipv6address %= qi::raw[a | b | c | d];

endif

When I use original code, Xcode hung up. If fixed version is used, Xcode runs well.

@toolbits
Copy link
Author

Here is a sample test code https://github.com/toolbits/cpp-netlib_xcode610_test

@deanberris deanberris added this to the 0.11.1 milestone Nov 13, 2014
@deanberris
Copy link
Member

@glynos Do you have time to look at this?

@glynos
Copy link
Member

glynos commented Nov 18, 2014

I'll take a look when I find time this weekend. @toolbits could you check if the issue exists in the URI repo as well (https://github.com/cpp-netlib/uri)?

@toolbits
Copy link
Author

@glynos, @deanberris thank you for your reply. I'll check new URI repo in a few days. Please wait a result.

@toolbits
Copy link
Author

Hello @glynos, I had tested new URI class (https://github.com/cpp-netlib/uri). The result is fail. I uploaded test source codes at https://github.com/toolbits/cpp-netlib_xcode610_test2.

When I added new URI class's source codes to simple hello world project and build-debug-run, Xcode 6.1 goes to hungup.
It is strange acting. The bug occurs only when URI code was linked.
I think there are two bad codes at detail/uri_parse.cpp and detail/uri_parse_authority.cpp
Maybe the parsing code of IPv6 is too long. Xcode generates bad code or linker makes some strange symbol, etc...I don't know.

My development environment is:
o MacOSX 10.10.1
o Xcode 6.1
o Apple LLVM 6.0
o clang
o libc++ and C++11
o boost 1.56.0 (compiled with libc++ and C++11)

My boost library is uploaded at https://github.com/toolbits/boost_1_56_0_xcode610_universal_binary.
If you want to use same boost lib, please get it.
Thank you :)

@stari4ek
Copy link

We have same issue with Xcode 6.1.1 and 6.2, boost 1.57, latest cpp-netlib/uri (55ec3cd78918c42dfb874e01c9745b4daf51091b)

@Falven
Copy link

Falven commented Apr 5, 2015

Having the same issue with Xcode Version 6.2 (6C131e), boost 1.57 and
https://storage.googleapis.com/cpp-netlib-downloads/0.11.1/cpp-netlib-0.11.1-final.tar.bz2
(213ba700e534596b44409cd6d5738b959fe41746)

Can't debug my project which uses the library extensively. Been a while since this issue was updated. Anything new?

@deanberris
Copy link
Member

I don't know about @glynos' availability -- so it looks like this is could be fixed with changing the way we define the grammar. @toolbits do you have time to send a pull request? I'd love to review that and merge it to both the URI library and 0.11-devel. I suspect there's some things we can do to optimize our usage of Spirit here, and that we haven't been doing the "best practices" when it comes to complicated grammars.

@toolbits
Copy link
Author

Hi, I made a pull request for this issue. I don't know about boost qi so much. Please review carefully about my modification.

@deanberris
Copy link
Member

I think the latest in 0.11-devel should have fixed this. Can you see whether that's true @toolbits? Closing for now, assuming the parser break-up would have dealt with this already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants