mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-07 17:10:21 +01:00
dhcp-manager: Keep size of PID consistent
Things explode on i386 when marshalling a 32-bit value when a 64-bit one is expected: Program received signal SIGSEGV, Segmentation fault. __memset_sse2 () at ../sysdeps/i386/i686/multiarch/memset-sse2.S:242 242 movdqu %xmm0, (%edx) Missing separate debuginfos, use: debuginfo-install nss-mdns-0.10-15.fc21.i686 (gdb) bt #0 0xffffffff in __memset_sse2 () at ../sysdeps/i386/i686/multiarch/memset-sse2.S:242 #1 0xffffffff in g_hash_table_remove_all_nodes (__len=<optimized out>, __ch=0, __dest=<optimized out>) at /usr/include/bits/string3.h:84 #2 0xffffffff in g_hash_table_remove_all_nodes (hash_table=hash_table@entry=0x82ee250<error reading variable: Cannot access memory at address 0x8dbaacd6>, notify=notify@entry=1) at ghash.c:481 #3 0xffffffff in g_hash_table_unref (hash_table=0x82ee250<error reading variable: Cannot access memory at address 0x8dbaacd6>) at ghash.c:1042 #4 0xffffffff in _g_type_boxed_free (type=136861824, value=0x82ee250) at gtype.c:4262 #5 0xffffffff in boxed_proxy_value_free (value=0xbfffe8ec) at gboxed.c:209 #6 0xffffffff in g_value_unset (value=value@entry=0xbfffe8ec) at gvalue.c:272 #7 0xffffffff in g_signal_emit_valist (instance=instance@entry=0x82492b8, signal_id=signal_id@entry=125, detail=detail@entry=0, var_args=<optimized out>, var_args@entry=0xbfffea4c "\030\342.\bL#") at gsignal.c:3338 #8 0xffffffff in g_signal_emit (instance=0x82492b8, signal_id=125, detail=0) at gsignal.c:3365 #9 0x0809c05d in handle_event (proxy=0xb5d012e8 [DBusGProxy], options=0x82eb640 = {...}, user_data=0x82492b8) at dhcp-manager/nm-dhcp-listener.c:146 #10 0xffffffff in g_cclosure_marshal_VOID__BOXED (closure=0x82bf270, return_value=0x0, n_param_values=2, param_values=0x82c60c0, invocation_hint=0xbfffec68, marshal_data=0x0) at gmarshal.c:1120 #11 0xffffffff in marshal_dbus_message_to_g_marshaller () at /lib/libdbus-glib-1.so.2 #15 0xffffffff in <emit signal received:org-freedesktop-nm_dhcp_client-Event on instance 0xb5d012e8 [DBusGProxy]> (instance=0xb5d012e8, signal_id=19, detail=915) at gsignal.c:3365 #12 0xffffffff in g_closure_invoke (closure=0x82bf270, return_value=return_value@entry=0x0, n_param_values=n_param_values@entry=3, param_values=param_values@entry=0xbfffecc0, invocation_hint=invocation_hint@entry=0xbfffec68) at gclosure.c:768 #13 0xffffffff in signal_emit_unlocked_R (node=node@entry=0x8263660, detail=detail@entry=915, instance=0xb5d012e8, emission_return=emission_return@entry=0x0, instance_and_params=0xbfffecc0) at gsignal.c:3553 #14 0xffffffff in g_signal_emit_valist (instance=instance@entry=0xb5d012e8, signal_id=signal_id@entry=19, detail=detail@entry=915, var_args=0xbfffee34 "\340\370.\b\004", var_args@entry=0xbfffee2c "\340\370.\b\300\303/\b\340\370.\b\004") at gsignal.c:3309 #16 0xffffffff in dbus_g_proxy_manager_filter () at /lib/libdbus-glib-1.so.2 #17 0xffffffff in dbus_connection_dispatch () at /lib/libdbus-1.so.3 #18 0xffffffff in message_queue_dispatch () at /lib/libdbus-glib-1.so.2 #19 0xffffffff in g_main_context_dispatch (context=0x8246720) at gmain.c:3111 #20 0xffffffff in g_main_context_dispatch (context=context@entry=0x8246720) at gmain.c:3710 #21 0xffffffff in g_main_context_iterate (context=0x8246720, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3781 #22 0xffffffff in g_main_loop_run (loop=0x8246798) at gmain.c:3975 #23 0x08070c09 in main (argc=1, argv=0xbffff2b4) at main.c:479 (gdb) PIDs use native word width, a gint seems more suitable than gint32 or gint64. https://bugzilla.gnome.org/show_bug.cgi?id=739861
This commit is contained in:
parent
ba7f17a02b
commit
a14bc5f67c
3 changed files with 6 additions and 6 deletions
|
|
@ -717,7 +717,7 @@ copy_option (const char * key,
|
|||
gboolean
|
||||
nm_dhcp_client_handle_event (gpointer unused,
|
||||
const char *iface,
|
||||
gint64 pid,
|
||||
gint pid,
|
||||
GHashTable *options,
|
||||
const char *reason,
|
||||
NMDhcpClient *self)
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ void nm_dhcp_client_set_state (NMDhcpClient *self,
|
|||
|
||||
gboolean nm_dhcp_client_handle_event (gpointer unused,
|
||||
const char *iface,
|
||||
gint64 pid,
|
||||
gint pid,
|
||||
GHashTable *options,
|
||||
const char *reason,
|
||||
NMDhcpClient *self);
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ handle_event (DBusGProxy *proxy,
|
|||
char *iface = NULL;
|
||||
char *pid_str = NULL;
|
||||
char *reason = NULL;
|
||||
gint32 pid;
|
||||
gint pid;
|
||||
gboolean handled = FALSE;
|
||||
|
||||
iface = get_option (options, "interface");
|
||||
|
|
@ -131,8 +131,8 @@ handle_event (DBusGProxy *proxy,
|
|||
}
|
||||
|
||||
pid_str = get_option (options, "pid");
|
||||
pid = (gint32) nm_utils_ascii_str_to_int64 (pid_str, 10, 0, G_MAXINT32, -1);
|
||||
if (pid == -1 || pid != (GPid) pid) {
|
||||
pid = nm_utils_ascii_str_to_int64 (pid_str, 10, 0, G_MAXINT32, -1);
|
||||
if (pid == -1) {
|
||||
nm_log_warn (LOGD_DHCP, "DHCP event: couldn't convert PID '%s' to an integer", pid_str ? pid_str : "(null)");
|
||||
goto out;
|
||||
}
|
||||
|
|
@ -283,7 +283,7 @@ nm_dhcp_listener_class_init (NMDhcpListenerClass *listener_class)
|
|||
G_TYPE_BOOLEAN, /* listeners return TRUE if handled */
|
||||
4,
|
||||
G_TYPE_STRING, /* iface */
|
||||
G_TYPE_INT64, /* pid */
|
||||
G_TYPE_INT, /* pid */
|
||||
G_TYPE_HASH_TABLE, /* options */
|
||||
G_TYPE_STRING); /* reason */
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue