Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rr does not play nice with SDL2 #1578

Closed
janisozaur opened this issue Nov 4, 2015 · 3 comments
Closed

rr does not play nice with SDL2 #1578

janisozaur opened this issue Nov 4, 2015 · 3 comments

Comments

@janisozaur
Copy link
Contributor

Possibly related to #1577, I have a sample test case which trips rr on my two machines, both running Arch, fully updated.

Using SDL2 2.0.3, I get two different failures

machine 'klapaucjusz':

  • intel i5
  • intel hd gpu
  • 4.2.5-1-ARCH
  • mesa 11.0.4

error:

$ rr ./sdl-test 

rr: Warning: Your CPU frequency governor is 'powersave'.  rr strongly
    recommends that you use the 'performance' governor.  Not using the
    'performance' governor can cause rr to be at least 2x slower
    on laptops.

    On Fedora-based systems, you can enable the 'performance' governor
    by running the following commands:

    $ sudo yum install kernel-tools
    $ sudo cpupower frequency-set -g performance

rr: Saving the execution of `./sdl-test' to trace directory `/home/janisozaur/.rr/sdl-test-2'.
[FATAL /tmp/packerbuild-1000/rr/rr/src/rr-4.0.1/src/record_syscall.cc:3046:rec_process_syscall_arch() errno: 0 'Success'] 
 (task 23291 (rec:23291) at time 2432)
 ->  Assertion `t->regs().syscall_result_signed() == -syscall_state.expect_errno' failed to hold. Expected ENOSYS for 'readlinkat' but got result 47; execution of syscall unsupported by rr
Launch gdb with
  gdb /home/janisozaur/workspace/sdl-test/sdl-test
and attach to the rr debug server with:
  target remote :23291

backtrace:

#0  0x70000018 in ?? ()
#1  0xf773a207 in _traced_raw_syscall () at /tmp/packerbuild-1000/rr/rr/src/rr-4.0.1/build/32/traced_syscall_shared.S:38
#2  0xf7737c75 in traced_raw_syscall (call=call@entry=0xff972e64) at /tmp/packerbuild-1000/rr/rr/src/rr-4.0.1/build/32/preload.c:312
#3  0xf7738dc7 in syscall_hook_internal (call=0xff972e64) at /tmp/packerbuild-1000/rr/rr/src/rr-4.0.1/build/32/preload.c:1994
#4  syscall_hook (call=0xff972e64) at /tmp/packerbuild-1000/rr/rr/src/rr-4.0.1/build/32/preload.c:2002
#5  0xf773a252 in _syscall_hook_trampoline () at /tmp/packerbuild-1000/rr/rr/src/rr-4.0.1/build/32/syscall_hook.S:59
#6  0xf72fd0ce in readlinkat () from /usr/lib32/libc.so.6
#7  0xf6d5a4e4 in ?? () from /usr/lib32/libudev.so.1
#8  0xf6d5edb9 in ?? () from /usr/lib32/libudev.so.1
#9  0xf6d5f382 in ?? () from /usr/lib32/libudev.so.1
#10 0xf6d5fd3d in ?? () from /usr/lib32/libudev.so.1
#11 0xf6d51c10 in udev_device_new_from_devnum () from /usr/lib32/libudev.so.1
#12 0xf6e6dc8c in ?? () from /usr/lib32/libGL.so.1
#13 0xf6e6cafd in ?? () from /usr/lib32/libGL.so.1
#14 0xf6e41050 in ?? () from /usr/lib32/libGL.so.1
#15 0xf6e3d04e in ?? () from /usr/lib32/libGL.so.1
#16 0xf6e3d1f2 in glXChooseVisual () from /usr/lib32/libGL.so.1
#17 0xf7696af5 in X11_GL_GetVisual (_this=0x8321b90, display=0x83222b8, screen=0) at /tmp/packerbuild-1000/lib32-sdl2/lib32-sdl2/src/SDL2-2.0.3/src/video/x11/SDL_x11opengl.c:525
#18 0xf7696d50 in X11_GL_InitExtensions (_this=0x8321b90) at /tmp/packerbuild-1000/lib32-sdl2/lib32-sdl2/src/SDL2-2.0.3/src/video/x11/SDL_x11opengl.c:323
#19 X11_GL_LoadLibrary (_this=0x8321b90, path=<optimized out>) at /tmp/packerbuild-1000/lib32-sdl2/lib32-sdl2/src/SDL2-2.0.3/src/video/x11/SDL_x11opengl.c:218
#20 0xf7689e70 in SDL_GL_LoadLibrary_REAL (path=0x0) at /tmp/packerbuild-1000/lib32-sdl2/lib32-sdl2/src/SDL2-2.0.3/src/video/SDL_video.c:2401
#21 0xf768be06 in SDL_CreateWindow_REAL (title=0xf76af9b2 "OpenGL test", x=-32, y=-32, w=32, h=32, flags=10) at /tmp/packerbuild-1000/lib32-sdl2/lib32-sdl2/src/SDL2-2.0.3/src/video/SDL_video.c:1240
#22 0xf768baab in ShouldUseTextureFramebuffer () at /tmp/packerbuild-1000/lib32-sdl2/lib32-sdl2/src/SDL2-2.0.3/src/video/SDL_video.c:192
#23 SDL_VideoInit_REAL (driver_name=<optimized out>) at /tmp/packerbuild-1000/lib32-sdl2/lib32-sdl2/src/SDL2-2.0.3/src/video/SDL_video.c:506
#24 0xf75e36aa in SDL_InitSubSystem_REAL (flags=16416) at /tmp/packerbuild-1000/lib32-sdl2/lib32-sdl2/src/SDL2-2.0.3/src/SDL.c:173
#25 0xf7612a11 in SDL_Init_DEFAULT (a=32) at /tmp/packerbuild-1000/lib32-sdl2/lib32-sdl2/src/SDL2-2.0.3/src/dynapi/SDL_dynapi_procs.h:89
#26 0xf7612d47 in SDL_Init (a=32) at /tmp/packerbuild-1000/lib32-sdl2/lib32-sdl2/src/SDL2-2.0.3/src/dynapi/SDL_dynapi_procs.h:89
#27 0x0804941f in main ()

machine 'trurl':

  • intel i7
  • nvidia gf gtx
  • 4.2.5-1-ARCH
  • nvidia 355.11

error:

$ rr ./sdl-test

rr: Warning: Your CPU frequency governor is 'powersave'.  rr strongly
    recommends that you use the 'performance' governor.  Not using the
    'performance' governor can cause rr to be at least 2x slower
    on laptops.

    On Fedora-based systems, you can enable the 'performance' governor
    by running the following commands:

    $ sudo yum install kernel-tools
    $ sudo cpupower frequency-set -g performance

rr: Saving the execution of `./sdl-test' to trace directory `/home/janisozaur/.rr/sdl-test-1'.
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  154 (GLX)
  Minor opcode of failed request:  3 (X_GLXCreateContext)
  Value in failed request:  0x0
  Serial number of failed request:  86
  Current serial number in output stream:  87

no backtrace available.

I'm happy to provide more logs or debug if needed, just let me know.

Test case that I used: https://github.com/janisozaur/rr-sdl-test-case

@dannas
Copy link
Contributor

dannas commented Nov 4, 2015

 ->  Assertion `t->regs().syscall_result_signed() == -syscall_state.expect_errno' failed to hold.       
 Expected ENOSYS for 'readlinkat' but got result 47; execution of syscall unsupported by rr

Looks like the system call readlinkat is unsupported by rr. I can take a stab at adding it (unless you would like to try - in that case search the git logs for patches adding support for other syscalls for examples).

@janisozaur
Copy link
Contributor Author

Sure, I think I'll take a look over the weekend.

@janisozaur
Copy link
Contributor Author

There's more discussion about SDL/GL support in #1579 but I think this one can be closed now that readlinkat support is done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants