After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 701744 - [review] dcbw/bt-hwaddr: assertion `ifindex > 0' failed when creating PAN connection
[review] dcbw/bt-hwaddr: assertion `ifindex > 0' failed when creating PAN con...
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: NetworkManager maintainer(s)
NetworkManager maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2013-06-06 15:03 UTC by Emilio Pozuelo Monfort
Modified: 2013-07-22 20:55 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Emilio Pozuelo Monfort 2013-06-06 15:03:24 UTC
Running NM from git master, bluetoothd from bluez 4.101 with 666dd92b683971aaf74398a4c1639f0a033853b2 backported, and gnome-bluetooth/gnome-control-center 3.8.0

I have paired a PAN device (Nexus 4) with bluetooth-wizard. Then at the end of the pairing process in the wizard, or from gnome-control-center's bluetooth panel, there is a checkbox to "use [my] mobile phone as a network device (PAN/NAP). If I enable the checkbox, NM creates the connection but asserts (twice) like this:

NetworkManager[23563]: nm_device_update_hw_address: assertion `ifindex > 0' failed

Program received signal SIGTRAP, Trace/breakpoint trap.
g_logv (log_domain=0x0, log_level=G_LOG_LEVEL_CRITICAL, 
    format=<optimized out>, args=args@entry=0x7fffffffca98) at gmessages.c:981
981		  g_private_set (&g_log_depth, GUINT_TO_POINTER (depth));
(gdb) bt
  • #0 g_logv
    at gmessages.c line 981
  • #1 g_log
    at gmessages.c line 1010
  • #2 g_return_if_fail_warning
    at gmessages.c line 1019
  • #3 nm_device_update_hw_address
    at devices/nm-device.c line 6219
  • #4 constructed
    at devices/nm-device.c line 544
  • #5 constructed
    at devices/nm-device-bt.c line 1168
  • #6 g_object_new_with_custom_constructor
    at gobject.c line 1713
  • #7 g_object_new_internal
    at gobject.c line 1736
  • #8 g_object_new_valist
    at gobject.c line 1994
  • #9 g_object_new
    at gobject.c line 1551
  • #10 nm_device_bt_new
    at devices/nm-device-bt.c line 1126
  • #11 bluez_manager_bdaddr_added_cb
  • #12 ffi_call_unix64
    from /usr/lib/x86_64-linux-gnu/libffi.so.6
  • #13 ffi_call
    from /usr/lib/x86_64-linux-gnu/libffi.so.6
  • #14 g_cclosure_marshal_generic_va
    at gclosure.c line 1550
  • #15 _g_closure_invoke_va
    at gclosure.c line 840
  • #16 g_signal_emit_valist
    at gsignal.c line 3234
  • #17 g_signal_emit
    at gsignal.c line 3384
  • #18 emit_bdaddr_added
    at bluez-manager/nm-bluez-manager.c line 63
  • #19 g_cclosure_marshal_VOID__OBJECTv
    at gmarshal.c line 1312
  • #20 _g_closure_invoke_va
    at gclosure.c line 840
  • #21 g_signal_emit_valist
    at gsignal.c line 3234
  • #22 g_signal_emit
    at gsignal.c line 3384
  • #23 g_closure_invoke
  • #24 signal_emit_unlocked_R
    at gsignal.c line 3584
  • #25 g_signal_emit_valist
    at gsignal.c line 3328
  • #26 g_signal_emit
    at gsignal.c line 3384
  • #27 g_object_dispatch_properties_changed
    at gobject.c line 1042
  • #28 g_object_notify_by_spec_internal
    at gobject.c line 1136
  • #29 g_object_notify
    at gobject.c line 1178
  • #30 g_closure_invoke
    at gclosure.c line 777
  • #31 signal_emit_unlocked_R
    at gsignal.c line 3584
  • #32 g_signal_emit_valist
    at gsignal.c line 3328
  • #33 g_signal_emit_by_name
  • #34 claim_connection
    at settings/nm-settings.c line 876
  • #35 add_new_connection
    at settings/nm-settings.c line 937
  • #36 pk_add_cb
    at settings/nm-settings.c line 1029
  • #37 auth_chain_finish
    at nm-manager-auth.c line 87
  • #38 g_main_dispatch
    at gmain.c line 3058
  • #39 g_main_context_dispatch
    at gmain.c line 3634
  • #40 g_main_context_iterate
    at gmain.c line 3705
  • #41 g_main_loop_run
    at gmain.c line 3899
  • #42 main
    at main.c line 600
  • #0 g_logv
    at gmessages.c line 981
  • #1 g_log
    at gmessages.c line 1010
  • #2 g_return_if_fail_warning
    at gmessages.c line 1019
  • #3 nm_device_update_hw_address
    at devices/nm-device.c line 6219
  • #4 nm_device_hw_bring_up
    at devices/nm-device.c line 4466
  • #5 nm_device_bring_up
    at devices/nm-device.c line 4528
  • #6 nm_device_state_changed
    at devices/nm-device.c line 5486
  • #7 nm_device_set_manager_managed
    at devices/nm-device.c line 5800
  • #8 add_device
    at nm-manager.c line 1927
  • #9 ffi_call_unix64
    from /usr/lib/x86_64-linux-gnu/libffi.so.6
  • #10 ffi_call
    from /usr/lib/x86_64-linux-gnu/libffi.so.6
  • #11 g_cclosure_marshal_generic_va
    at gclosure.c line 1550
  • #12 _g_closure_invoke_va
    at gclosure.c line 840
  • #13 g_signal_emit_valist
    at gsignal.c line 3234
  • #14 g_signal_emit
    at gsignal.c line 3384
  • #15 emit_bdaddr_added
    at bluez-manager/nm-bluez-manager.c line 63
  • #16 g_cclosure_marshal_VOID__OBJECTv
    at gmarshal.c line 1312
  • #17 _g_closure_invoke_va
    at gclosure.c line 840
  • #18 g_signal_emit_valist
    at gsignal.c line 3234
  • #19 g_signal_emit
    at gsignal.c line 3384
  • #20 g_closure_invoke
    at gclosure.c line 777
  • #21 signal_emit_unlocked_R
    at gsignal.c line 3584
  • #22 g_signal_emit_valist
    at gsignal.c line 3328
  • #23 g_signal_emit
  • #24 g_object_dispatch_properties_changed
    at gobject.c line 1042
  • #25 g_object_notify_by_spec_internal
    at gobject.c line 1136
  • #26 g_object_notify
    at gobject.c line 1178
  • #27 g_closure_invoke
    at gclosure.c line 777
  • #28 signal_emit_unlocked_R
    at gsignal.c line 3584
  • #29 g_signal_emit_valist
    at gsignal.c line 3328
  • #30 g_signal_emit_by_name
    at gsignal.c line 3424
  • #31 claim_connection
    at settings/nm-settings.c line 876
  • #32 add_new_connection
    at settings/nm-settings.c line 937
  • #33 pk_add_cb
    at settings/nm-settings.c line 1029
  • #34 auth_chain_finish
  • #35 g_main_dispatch
    at gmain.c line 3058
  • #36 g_main_context_dispatch
    at gmain.c line 3634
  • #37 g_main_context_iterate
    at gmain.c line 3705
  • #38 g_main_loop_run
    at gmain.c line 3899
  • #39 main
    at main.c line 600
Continuing.
NetworkManager[23563]: <info> (10:68:3F:BA:C6:16): device state change: unavailable -> disconnected (reason 'none') [20 30 0]
Comment 1 Dan Winship 2013-06-06 19:16:43 UTC
can you try the danw/hwlen branch (which I've just now updated) and if that fixes it, mark this a dup of 701675?
Comment 2 Emilio Pozuelo Monfort 2013-06-07 18:39:25 UTC
Sure will do that soon.
Comment 3 Emilio Pozuelo Monfort 2013-06-08 17:35:56 UTC
I also get this with that branch.

Let me know if you need any further info.
Comment 4 Dan Williams 2013-07-19 17:07:19 UTC
NMDeviceBt knows the HW_ADDR at construct time, and sends that to g_object_new() as a property.  After that, it shouldn't ever change, and calling  nm_device_update_hw_address() is pretty pointless.  Unfortunately nm_device_update_hw_address() assumes that if the device subclass implements get_hw_address_length that it'll have a valid ifindex, which won't be the case for the Bluetooth device as its not actually a netdevice and thus has no ifindex.  Yet it does have a hardware address, and it's already been set.

(NMDeviceAdsl gets around this because it doesn't provide an HW_ADDR unless a 'nas' interface is used, which is a netdev, and which does have an ifindex)

Some solutions:

1) some kind of flag/property/function indicating that the address shouldn't ever be changed?

2) add an "out" argument to the get_hw_address_length() class method that indicates that the address shouldn't be changed?

3) just return if we don't have a valid ifindex

I think #2 is probably the easiest/cleanest, because #3 might mask some actual errors we're interested in.

Pushed #2 as dcbw/bt-hwaddr, please review?
Comment 5 Dan Williams 2013-07-22 20:55:00 UTC
Pushed to git master after review by danw.