Giter VIP home page Giter VIP logo

Comments (10)

jdswensen avatar jdswensen commented on June 11, 2024

Hi @gadekula1, could you run this command again but also capture the output of dbus-monitor --system? For example:

# terminal window 1
dbus-monitor --system > dbus.log

# terminal window 2
dbus-send --system --print-reply --dest=io.openthread.BorderRouter.wpan0 /io/openthread/BorderRouter/wpan0 io.openthread.BorderRouter.AddExternalRoute array:byte:0x00,0x11 byte:0x01 uint16:byte:bool:bool:0x1111:0x01:0x00:0x00

I was able to get a crash on my setup, but it's a different signal. I'm curious to know if the data is being properly formatted. The dbus-monitor command should print out the message format as it is processed. On my system, the dbus-send call you provided did not match the introspect document. You may need to double check the syntax of the command or try sending the message in a different way to insure correct syntax. For example, python bindings could be used to quickly test something.

method call time=1698867030.467833 sender=:1.22 -> destination=io.openthread.BorderRouter.wpan0 serial=2 path=/io/openthread/BorderRouter/wpan0; interface=io.openthread.BorderRouter; member=AddExternalRoute
   array of bytes [
      00 11
   ]
   byte 1
   uint16 0

from ot-br-posix.

gadekula1 avatar gadekula1 commented on June 11, 2024

Thanks @jdswensen , for reply,
Please find below dbus monitor log and dbus command

dbus-send --system --print-reply --dest=io.openthread.BorderRouter.wpan0 /io/openthread/BorderRouter/wpan0 io.openth read.BorderRouter.AddExternalRoute array:byte:0x00,0x11 byte:0x01 uint16:byte:bool:bool:0x1111:0x01:0x00:0x00

Error org.freedesktop.DBus.Error.NoReply: Message recipient disconnected from message bus without replying

cat dbus.log

signal time=1698980780.789248 sender=org.freedesktop.DBus -> destination=:1.29 serial=2 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameAcquired
string ":1.29"
signal time=1698980780.789338 sender=org.freedesktop.DBus -> destination=:1.29 serial=4 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameLost
string ":1.29"
method call time=1698980784.969485 sender=:1.30 -> destination=org.freedesktop.DBus serial=1 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=Hello
method return time=1698980784.969528 sender=org.freedesktop.DBus -> destination=:1.30 serial=1 reply_serial=1
string ":1.30"
signal time=1698980784.969545 sender=org.freedesktop.DBus -> destination=(null destination) serial=10 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
string ":1.30"
string ""
string ":1.30"
signal time=1698980784.969567 sender=org.freedesktop.DBus -> destination=:1.30 serial=2 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameAcquired
string ":1.30"
method call time=1698980784.970229 sender=:1.30 -> destination=io.openthread.BorderRouter.wpan0 serial=2 path=/io/openthread/BorderRouter/wpan0; interface=io.openthread.BorderRouter; member=AddExternalRoute
array of bytes [
00 11
]
byte 1
uint16 0
signal time=1698980785.083220 sender=org.freedesktop.DBus -> destination=:1.28 serial=5 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameLost
string "io.openthread.BorderRouter.wpan0"
signal time=1698980785.083272 sender=org.freedesktop.DBus -> destination=(null destination) serial=11 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
string "io.openthread.BorderRouter.wpan0"
string ":1.28"
string ""
signal time=1698980785.083609 sender=org.freedesktop.DBus -> destination=:1.28 serial=6 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameLost
string ":1.28"
signal time=1698980785.083644 sender=org.freedesktop.DBus -> destination=(null destination) serial=12 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
string ":1.28"
string ":1.28"
string ""
error time=1698980785.083667 sender=org.freedesktop.DBus -> destination=:1.30 error_name=org.freedesktop.DBus.Error.NoReply reply_serial=2
string "Message recipient disconnected from message bus without replying"
signal time=1698980785.084110 sender=org.freedesktop.DBus -> destination=:1.27 serial=13 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameLost
string ":1.27"
signal time=1698980785.084145 sender=org.freedesktop.DBus -> destination=(null destination) serial=34 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
string ":1.27"
string ":1.27"
string ""
signal time=1698980785.084550 sender=org.freedesktop.DBus -> destination=:1.30 serial=4 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameLost
string ":1.30"
signal time=1698980785.084581 sender=org.freedesktop.DBus -> destination=(null destination) serial=35 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
string ":1.30"
string ":1.30"
string ""
`
observation :
failing at dbus_message_iter_recurse(aIter, &sub);
while parsing aRoute.mPrefix

(gdb) p aRoute.mPrefix
$2 = {mPrefix = {<std::_Vector_base<unsigned char, std::allocator >> = {
M_impl = {<std::allocator> = {<__gnu_cxx::new_allocator> = {}, }, <std::_Vector_base<unsigned char, std::allocator >::_Vector_impl_data> = {M_start = 0x0, M_finish = 0x0, M_end_of_storage = 0x0}, }}, }, mLength = 0 '\000'}

can we get complete/working dbus send command for AddExternalRoute if possible?

from ot-br-posix.

gadekula1 avatar gadekula1 commented on June 11, 2024

now we are able to pass values correctly ((ayy)y(bbbbbbb)).

method call time=1672542658.774958 sender=:1.44 -> destination=io.openthread.BorderRouter.wpan0 serial=2 path=/io/openthread/BorderRouter/wpan0; interface=io.openthread.BorderRouter.wpan0; member=AddOnMeshPrefix
struct {
struct {
array of bytes [
fd 11 00 22 00 00 00 00
]
byte 64
}
byte 0
struct {
boolean true
boolean true
boolean false
boolean false
boolean true
boolean true
boolean true
}
}
error time=1672542658.775497 sender=:1.29 -> destination=:1.44 error_name=org.freedesktop.DBus.Error.UnknownMethod reply_serial=2
string "Method "AddOnMeshPrefix" with signature "((ayy)y(bbbbbbb))" on interface "io.openthread.BorderRouter.wpan0" doesn't exist
"
still otbr-agent throwing error.

AddOnMeshPrefix method from Introspect

<!-- AddOnMeshPrefix: Add an on-mesh prefix to the network.
  @prefix: The on-mesh prefix.

  The on-mesh prefix structure is:
  <literallayout>
    struct {
      struct {
        uint8[] prefix_bytes
        uint8 prefix_length
      }
      byte preference
      struct {
        boolean preferred
        boolean slaac
        boolean dhcp
        boolean configure
        boolean default_route
        boolean on_mesh
        boolean stable
      }
    }
  </literallayout>
-->
<method name="AddOnMeshPrefix">
  <arg name="prefix" type="((ayy)y(bbbbbbb))"/>
</method>

from ot-br-posix.

superwhd avatar superwhd commented on June 11, 2024

For the issue in #2079 (comment), I've sent #2126 which should be able to fix the issue. @gadekula1 could you cherry-pick it and have a try?

from ot-br-posix.

gadekula1 avatar gadekula1 commented on June 11, 2024

@superwhd
Thanks for patch, even we tried with introspect of OnMeshPrefixes get property.

Now calling OnMeshPrefixes method with c++ dbus code with below parameters

method call time=1672532690.284219 sender=:1.22 -> destination=io.openthread.BorderRouter.wpan0 serial=2 path=/io/openthread/BorderRouter/wpan0; interface=io.openthread.BorderRouter; member=AddOnMeshPrefix
struct {
struct {
array of bytes [
fd 12 00 23 00 00 00 00
]
byte 64
}
uint16 63489
byte 0
boolean true
boolean true
boolean false
boolean false
boolean true
boolean true
boolean true
boolean false
boolean false
}
method return time=1672532690.286115 sender=:1.19 -> destination=:1.22 serial=10 reply_serial=2

Result of OnMeshPrefixes get property

dbus_test# dbus-send --system --print-reply --dest=io.openthread.BorderRouter.wpan0 /io/openthread/BorderRouter/wpan
0 org.freedesktop.DBus.Properties.Get string:io.openthread.BorderRouter string:OnMeshPrefixes
method return time=1672533309.560068 sender=:1.19 -> destination=:1.25 serial=13 reply_serial=2
variant array [
struct {
struct {
array of bytes [
fd 97 bf 63 01 2d 00 01
]
byte 64
}
uint16 63488
byte 255
boolean true
boolean true
boolean false
boolean false
boolean false
boolean true
boolean true
boolean false
boolean false
}
struct {
struct {
array of bytes [
fd 12 00 23 00 00 00 00
]
byte 64
}
uint16 63488
byte 0
boolean false
boolean true
boolean false
boolean false
boolean true
boolean true
boolean true
boolean false
boolean false
}
]

Note we tried to call method with dbus-send command but otbr-agent crashing

dbus-send --system --print-reply --dest=io.openthread.BorderRouter.wpan0 /io/openthread/BorderRouter/wpan
0 io.openthread.BorderRouter.AddOnMeshPrefix array:byte:0xfd,0x11,0x00,0x22,0x00,0x00,0x00,0x00 byte:0x64 uint16:0x15360 byte:0x00 bo
olean:true boolean:true boolean:false boolean:false boolean:true boolean:true boolean:true boolean:false boolean:false
Error org.freedesktop.DBus.Error.NoReply: Message recipient disconnected from message bus without replying

logs of dbus monitor
method call time=1672533472.568218 sender=:1.29 -> destination=io.openthread.BorderRouter.wpan0 serial=2 path=/io/openthread/BorderRouter/wpan0; interface=io.openthread.BorderRouter; member=AddOnMeshPrefix
array of bytes [
fd 11 00 22 00 00 00 00
]
byte 100
uint16 21344
byte 0
boolean true
boolean true
boolean false
boolean false
boolean true
boolean true
boolean true
boolean false
boolean false

unable send parameters in structure format using dbus-send. can we know how to pass parameters properly using dbus-send command.

from ot-br-posix.

superwhd avatar superwhd commented on June 11, 2024

I reproduced the crash issue via dbus-send command in #2079 (comment).

I'm not sure if the payload of dbus-send is correct but otbr-agent shouldn't crash even if the input is invalid. I'll take a look to fix it.

BTW, I was able to call this API using gdbus:

gdbus call --system --dest io.openthread.BorderRouter.wpan0 --method=io.openthread.BorderRouter.AddOnMeshPrefix --object-path /io/openthread/BorderRouter/wpan0 "(([0xfd,0x11,0x12,0x13], 64),0x5343, 0x01, false,false,false,false,false,false,false,false,false)

from ot-br-posix.

gadekula1 avatar gadekula1 commented on June 11, 2024

@superwhd
similar crash for AddExternalRoute

dbus-send --system --print-reply --dest=io.openthread.BorderRouter.wpan0 /io/openthread/BorderRouter/wpan0 io.opent
hread.BorderRouter.AddExternalRoute array:byte:0x00,0x11 byte:0x01 uint16:byte:bool:bool:0x1111:0x01:0x00:0x00
Error org.freedesktop.DBus.Error.NoReply: Message recipient disconnected from message bus without replying

not implemented error for PermitUnsecureJoin

dbus-send --system --print-reply --dest=io.openthread.BorderRouter.wpan0 /io/openthread/BorderRouter/wpan0 io.openth
read.BorderRouter.PermitUnsecureJoin uint16:0x01243 uint32:0x20
Error io.openthread.Error.NotImplemented: io.openthread.Error.NotImplemented

from ot-br-posix.

superwhd avatar superwhd commented on June 11, 2024

@gadekula1 I think your payload is different from the expected type. The prefix byte array (array:byte:0x00,0x11) and the prefix length (byte:0x01) should be wrapped into a struct. However, I'm not sure how to send a struct as argument via dbus-send.

For your reference, here's how I called AddExternalRoute via gdbus

$ sudo gdbus call --system --dest io.openthread.BorderRouter.wpan0 --method=io.openthread.BorderRouter.AddExternalRoute --object-path /io/openthread/BorderRouter/wpan0 "(([0xfd,0x11,0x12,0x13,0x13,0x14,0x15,0x16], 64),0x5343, 0x01, false,false)"

from ot-br-posix.

gadekula1 avatar gadekula1 commented on June 11, 2024

@superwhd, Thanks, applied #2128 locally, now no crash observed for AddExternalRoute and AddOnMeshPrefix methods

dbus-send --system --print-reply --dest=io.openthread.BorderRouter.wpan0 /io/openthread/BorderRouter/wpan0
io.openthread.BorderRouter.AddExternalRoute array:byte:0x00,0x11 byte:0x01 uint16:byte:bool:bool:0x1111:0x01:0x00:0x00
Error io.openthread.Error.InvalidArgs: io.openthread.Error.InvalidArgs

dbus-send --system --print-reply --dest=io.openthread.BorderRouter.wpan0 /io/openthread/BorderRouter/wpan0
io.openthread.BorderRouter.AddOnMeshPrefix array:byte:0xfd,0x11,0x00,0x22,0x00,0x00,0x00,0x00 byte:0x64 uint16:0x15360 byte:0x00 boo
lean:true boolean:true boolean:false boolean:false boolean:true boolean:true boolean:true boolean:false boolean:false
Error io.openthread.Error.InvalidArgs: io.openthread.Error.InvalidArgs

from ot-br-posix.

jwhui avatar jwhui commented on June 11, 2024

Resolved by #2128

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.