Giter Club home page Giter Club logo

Comments (1)

tcarmelveilleux avatar tcarmelveilleux commented on June 2, 2024

Attached is a minimal repro program, requires zero deps, and integrates the paths taken in the execution subset for
minimal_test.zip

Build with gcc minimal_test.cpp -g3 -o minimal_test -lstdc++.

Here is the failure trace:

(gdb) break SplitFullDnsName
Breakpoint 1 at 0x2313: file minimal_test.cpp, line 55.
(gdb) run
Starting program: /usr/local/google/home/tennessee/repos/connectedhomeip/minimal_test 

Breakpoint 1, SplitFullDnsName (aName="93E78CD5EA02444B-", '0' <repeats 11 times>, "1B669._matter._tcp.default.service.arpa.") at minimal_test.cpp:55
55	    DnsNameInfo nameInfo;
(gdb) n
56	    std::string fullName = aName;
(gdb) 
58	    if (!NameEndsWithDot(fullName))
(gdb) 
63	    transportPos = fullName.rfind("._udp.");
(gdb) 
65	    if (transportPos == std::string::npos)
(gdb) 
67	        transportPos = fullName.rfind("._tcp.");
(gdb) 
70	    if (transportPos == std::string::npos)
(gdb) 
84	        size_t dotPos = transportPos > 0 ? fullName.find_last_of('.', transportPos - 1) : std::string::npos;
(gdb) 
86	        nameInfo.mDomain = fullName.substr(transportPos + 6); // 6 is the length of "._tcp." or "._udp."
(gdb) 
88	        if (dotPos == std::string::npos)
(gdb) 
96	            nameInfo.mInstanceName = fullName.substr(0, dotPos);
(gdb) 
97	            nameInfo.mServiceName  = fullName.substr(dotPos + 1, transportPos + 4 - dotPos);
(gdb) 
101	    if (!NameEndsWithDot(nameInfo.mDomain))
(gdb) 
106	    return nameInfo;
(gdb) 
107	}
(gdb) 
106	    return nameInfo;
(gdb) p nameInfo
$2 = {mInstanceName = "93E78CD5EA02444B-", '0' <repeats 11 times>, "1B669", mServiceName = "_matter._tcp", mHostName = "", 
  mDomain = "default.service.arpa."}
(gdb) n
SplitFullServiceName (aFullName="93E78CD5EA02444B-", '0' <repeats 11 times>, "1B669._matter._tcp.default.service.arpa.", aType="", aDomain="")
    at minimal_test.cpp:132
132	    VerifyOrExit(nameInfo.IsService(), error = OTBR_ERROR_INVALID_ARGS);
(gdb) 
138	    return error;
(gdb) 
139	}
(gdb) 
138	    return error;
(gdb) 
139	}
(gdb) 
minimal_test: minimal_test.cpp:159: int main(): Assertion `SplitFullServiceName(serviceName, type, domain) == OTBR_ERROR_NONE' failed.

Program received signal SIGABRT, Aborted.
__pthread_kill_implementation (threadid=<optimized out>, signo=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
44	./nptl/pthread_kill.c: No such file or directory.
(gdb) 

from ot-br-posix.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.