You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working on a system that helps me debug student's submissions for programming course assignments. I want to build c code with gcc and run with gdb attached so that I can see memory handling problems my students make. I ran into the following interesting problem. The example below is obviously a wrong program, the issue here is handling the situation by WSL, not with the C code. Standard ubuntu xenial simply fails with a SIGSEGV.
At this point the program hangs, so press ctrl+c to interrupt)
gdb output:
__lll_lock_wait_private () at ../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:95
95 ../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: No such file or directory.
Looking at the stack:
(gdb) bt
#0 __lll_lock_wait_private () at ../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:95
#1 0x00007fffff09d3be in _IO_new_fclose (fp=0x7ffffffde1e0) at iofclose.c:56
#2 0x0000000000400612 in main (argc=1, argv=0x7ffffffde1e8) at test.c:18
This is probably a deadlock with stdout also, because the program above doesn't produce any output on the console though it should print out numbers from 0 to 99.
Expected behavior: instead of hanging at lowlevellock, the process should print output and then fail with segfault.
Version info
Windows 10 Pro 1709 build 16299.431
uname -a reports kernel as Linux XPS 4.4.0-43-Microsoft Will this be Open Source? #1-Microsoft Wed Dec 31 14:42:53 PST 2014 x86_64 x86_64 x86_64 GNU/Linux
I'm working on a system that helps me debug student's submissions for programming course assignments. I want to build c code with gcc and run with gdb attached so that I can see memory handling problems my students make. I ran into the following interesting problem. The example below is obviously a wrong program, the issue here is handling the situation by WSL, not with the C code. Standard ubuntu xenial simply fails with a SIGSEGV.
Program:
I build with symbols:
If I run from the shell, the program hangs:
From withing gdb:
At this point the program hangs, so press ctrl+c to interrupt)
gdb output:
Looking at the stack:
This is probably a deadlock with stdout also, because the program above doesn't produce any output on the console though it should print out numbers from 0 to 99.
Expected behavior: instead of hanging at lowlevellock, the process should print output and then fail with segfault.
Version info