Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Thread A:
- Program received signal SIGINT, Interrupt.
- [Switching to Thread 0xf7521b70 (LWP 1884)]
- 0xf7fdf430 in __kernel_vsyscall ()
- (gdb) bt
- #0 0xf7fdf430 in __kernel_vsyscall ()
- #1 0xf7f00e43 in __lll_lock_wait_private ()
- at ../nptl/sysdeps/unix/sysv/linux/i386/i686/../i486/lowlevellock.S:95
- #2 0xf7e960f3 in _L_lock_56 () from /lib32/libc.so.6
- #3 0xf7e8fab3 in ptmalloc_lock_all () at arena.c:288
- #4 0xf7ebd127 in __libc_fork ()
- at ../nptl/sysdeps/unix/sysv/linux/i386/../fork.c:95
- #5 0xf7fb49a4 in __fork () at ../nptl/sysdeps/unix/sysv/linux/pt-fork.c:26
- #6 0x08049a60 in main.main() ()
- #7 0x0804dd81 in tango.core.Thread.Thread.run() ()
- #8 0x0804d2b2 in thread_entryPoint ()
- #9 0xf7faa96e in start_thread (arg=0xf7521b70) at pthread_create.c:300
- #10 0xf7ef3b5e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130
- Thread B:
- #0 0xf7fdf430 in __kernel_vsyscall ()
- #1 0xf7e4ed2e in do_sigsuspend (set=0xf7d21cf8)
- at ../sysdeps/unix/sysv/linux/sigsuspend.c:63
- #2 __sigsuspend (set=0xf7d21cf8)
- at ../sysdeps/unix/sysv/linux/sigsuspend.c:78
- #3 0x0804d3a6 in thread_suspendHandler ()
- #4 <signal handler called>
- #5 0xf7e94c5e in __libc_malloc (bytes=10000) at malloc.c:3657
- #6 0x08049a88 in main.main() ()
- #7 0x0804dd81 in tango.core.Thread.Thread.run() ()
- #8 0x0804d2b2 in thread_entryPoint ()
- #9 0xf7faa96e in start_thread (arg=0xf7d22b70) at pthread_create.c:300
- #10 0xf7ef3b5e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130
- module main;
- import tango.core.Exception;
- import tango.io.Stdout;
- import tango.core.Memory;
- import tango.stdc.stdlib;
- import tango.util.log.Log;
- import tango.sys.Process;
- import tango.core.Thread;
- import tango.stdc.posix.unistd;
- import ocean.util.log.Trace;
- void main()
- {
- void doFork ( )
- {
- while (true)
- {
- Trace.formatln("Suspending");
- thread_suspendAll();
- if ( fork() != 0 )
- {
- Trace.formatln("Forked");
- thread_resumeAll();
- Trace.formatln("Resuming");
- }
- else
- {
- Trace.formatln("Forked-Child, Exiting");
- exit(1);
- }
- }
- }
- void doMalloc ( )
- {
- while ( true)
- {
- Trace.formatln("Malloc, allocating");
- auto mem = malloc(10000);
- Trace.formatln("Malloc, freeing");
- free(mem);
- }
- }
- auto fork = new Thread(&doFork);
- auto malloc = new Thread(&doMalloc);
- malloc.start;
- fork.start;
- }
Add Comment
Please, Sign In to add comment