Skip to content

Instantly share code, notes, and snippets.

View hardening's full-sized avatar

David Fort hardening

View GitHub Profile
@hardening
hardening / gist:5693565
Created June 2, 2013 12:53
valgrind callstack for an invalid read access
==9341== Invalid read of size 4
==9341== at 0x40A508: weston_surface_from_global_float (compositor.c:774)
==9341== by 0x40A64C: weston_surface_from_global_fixed (compositor.c:803)
==9341== by 0x40AC36: weston_compositor_pick_surface (compositor.c:959)
==9341== by 0x40E251: default_grab_focus (input.c:109)
==9341== by 0x40E614: notify_motion_absolute (input.c:663)
==9341== by 0x88444EB: xf_mouseEvent (compositor-rdp.c:771)
==9341== by 0x8CA39EA: fastpath_recv_inputs (in /home/david/dev/install/lib/x86_64-linux-gnu/libfreerdp-core.so.1.1.0)
==9341== by 0x8CADB7E: peer_recv_pdu (in /home/david/dev/install/lib/x86_64-linux-gnu/libfreerdp-core.so.1.1.0)
==9341== by 0x8CADFFF: peer_recv_callback (in /home/david/dev/install/lib/x86_64-linux-gnu/libfreerdp-core.so.1.1.0)
@hardening
hardening / gist:5717415
Created June 5, 2013 21:19
Valgrind callback with some activity on windows headers
==15082== Invalid read of size 4
==15082== at 0x40A558: weston_surface_from_global_float (compositor.c:772)
==15082== by 0x40A69C: weston_surface_from_global_fixed (compositor.c:801)
==15082== by 0x40AC86: weston_compositor_pick_surface (compositor.c:957)
==15082== by 0x40E2F1: default_grab_focus (input.c:109)
==15082== by 0x40E6B4: notify_motion_absolute (input.c:663)
==15082== by 0x88445FF: xf_mouseEvent (compositor-rdp.c:770)
==15082== by 0x8CA3A1A: fastpath_recv_inputs (in /home/david/dev/install/lib/x86_64-linux-gnu/libfreerdp-core.so.1.1.0)
==15082== by 0x8CADBAE: peer_recv_pdu (in /home/david/dev/install/lib/x86_64-linux-gnu/libfreerdp-core.so.1.1.0)
==15082== by 0x8CAE04F: peer_recv_callback (in /home/david/dev/install/lib/x86_64-linux-gnu/libfreerdp-core.so.1.1.0)
==30277== Invalid read of size 8
==30277== at 0x4E3DE50: wl_list_insert (wayland-util.c:45)
==30277== by 0x412BE4: bind_seat (input.c:1268)
==30277== by 0x6455C17: ffi_call_unix64 (in /usr/lib/x86_64-linux-gnu/libffi.so.6.0.1)
==30277== by 0x645557F: ffi_call (in /usr/lib/x86_64-linux-gnu/libffi.so.6.0.1)
==30277== by 0x4E3D962: wl_closure_invoke (connection.c:919)
==30277== by 0x4E3A339: wl_client_connection_data (wayland-server.c:307)
==30277== by 0x4E3C1A2: wl_event_loop_dispatch (event-loop.c:421)
==30277== by 0x4E3A8F4: wl_display_run (wayland-server.c:836)
==30277== by 0x40FDF3: main (compositor.c:3423)
@hardening
hardening / gist:6084144
Created July 25, 2013 21:56
wl_bind_seat with full debug
[115262.022] -> wl_registry@2.global(16, "wl_seat", 2)
[115264.417] -> wl_registry@2.global(17, "wl_input_method", 1)
[23:51:21.943] launching '/home/david/dev/install/libexec/weston-keyboard'
[115269.835] wl_registry@2.global(16, "wl_seat", 2)
[115269.870] -> wl_registry@2.bind(16, "wl_seat", 1, new id [unknown]@18)
[115269.884] -> wl_data_device_manager@6.get_data_device(new id wl_data_device@22, wl_seat@18)
[115269.892] -> wl_compositor@3.create_surface(new id wl_surface@21)
[115269.903] wl_registry@2.global(17, "wl_input_method", 1)
[115273.990] -> wl_registry@2.global(18, "wl_seat", 2)
[115274.335] -> wl_registry@2.global(19, "wl_input_method", 1)
@hardening
hardening / gist:6630794
Created September 19, 2013 22:34
backtrace of a strange weston_mode_switch()
(gdb) bt
#0 weston_output_switch_mode (output=0x642590, mode=0x0, scale=1, op=WESTON_MODE_SWITCH_RESTORE_NATIVE)
at ../../src/compositor.c:108
#1 0x00007ffff018af01 in restore_output_mode (output=0x642590) at ../../src/shell.c:1632
#2 0x00007ffff018af38 in restore_all_output_modes (compositor=0x6412d0) at ../../src/shell.c:1644
#3 0x00007ffff018e2b0 in activate (shell=0x643770, es=0x6c9f70, seat=0x694a08) at ../../src/shell.c:3097
#4 0x00007ffff018f300 in map (shell=0x643770, surface=0x6c9f70, width=806, height=491, sx=0, sy=0)
at ../../src/shell.c:3573
#5 0x00007ffff018f5fe in shell_surface_configure (es=0x6c9f70, sx=0, sy=0, width=806, height=491)
at ../../src/shell.c:3660
@hardening
hardening / gist:7272918
Created November 1, 2013 22:22
FreeRDS compilation
-- The C compiler identification is GNU 4.7.3
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.26")
CMake Error at CMakeLists.txt:39 (include):
include could not find load file:
CheckCmakeCompat
@hardening
hardening / gist:091c05ea93d6b97abbe901dc0cb6dee4
Created October 23, 2020 12:47
android compilation error
[ 2%] Building C object winpr/libwinpr/CMakeFiles/winpr.dir/clipboard/posix.c.o
In file included from /home/david/dev/git/FreeRDP/winpr/libwinpr/clipboard/posix.c:40:
/home/david/dev/git/FreeRDP/winpr/include/winpr/shell.h:41:2: error: unknown type name 'CLSID'
CLSID clsid;
^
/home/david/dev/git/FreeRDP/winpr/include/winpr/shell.h:42:2: error: unknown type name 'SIZEL'
SIZEL sizel;
^
/home/david/dev/git/FreeRDP/winpr/include/winpr/shell.h:43:2: error: unknown type name 'POINTL'
POINTL pointl;
diff --git a/winpr/libwinpr/synch/timer.c b/winpr/libwinpr/synch/timer.c
index bb2fb5444..4204f59ef 100644
--- a/winpr/libwinpr/synch/timer.c
+++ b/winpr/libwinpr/synch/timer.c
@@ -344,6 +344,7 @@ HANDLE CreateWaitableTimerA(LPSECURITY_ATTRIBUTES lpTimerAttributes, BOOL bManua
#if defined(TIMER_IMPL_DISPATCH) || defined(TIMER_IMPL_POSIX)
if (!winpr_event_init(&timer->event))
goto fail;
+ timer->fd = timer->event.fds[0];
#endif
98%] Building C object client/X11/CMakeFiles/xfreerdp-client.dir/xf_client.c.o
/Users/freerdp/ci.freerdp.com/workspace/osx/CMAKE_GENERATOR/Make/label/macosx/source/client/X11/xf_client.c:1660:15: warning: result of comparison of constant 258 with expression of type 'BOOL' (aka 'signed char') is always true [-Wtautological-constant-out-of-range-compare]
if ((status != WAIT_TIMEOUT) && (waitStatus == WAIT_OBJECT_0))
~~~~~~ ^ ~~~~~~~~~~~~
1 warning generated.
[ 98%] Building C object client/X11/CMakeFiles/xfreerdp-client.dir/xf_client.c.o
/Users/freerdp/ci.freerdp.com/workspace/osx/CMAKE_GENERATOR/Unix Makefiles/label/macosx/source/client/X11/xf_client.c:1639:15: warning: result of comparison of constant 258 with expression of type 'BOOL' (aka 'signed char') is always true [-Wtautological-constant-out-of-range-compare]
if ((status != WAIT_TIMEOUT) && (waitStatus == WAIT_OBJECT_0))
~~~~~~ ^ ~~~~~~~~~~~~
1 warning generated.