Guest User

Untitled

a guest
Jan 17th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. ==29304== Thread 1:
  2. ==29304== 72 bytes in 18 blocks are definitely lost in loss record 55 of 89
  3. ==29304== at 0x402641D: operator new(unsigned int) (vg_replace_malloc.c:255)
  4. ==29304== by 0x4032BBC: GmpPipePlayer::GmpPipePlayer(IOBase*, Referee*, unsigned char, int, DataBoard const*, int, char const*, int) (unixgmppipe.cpp:126)
  5. ==29304== by 0x40329F9: GmpPipePlayer::CreateFunc(IOBase*, Referee*, unsigned char, int, DataBoard const*, void*) (unixgmppipe.cpp:55)
  6.  
  7. pipe(down);
  8. pipe(up);
  9.  
  10. _pid = fork();
  11.  
  12. if (_pid < 0)
  13. exit(1);
  14.  
  15.  
  16. if (_pid == 0)
  17. {
  18. close(down[1]);
  19. close(up[0]);
  20.  
  21. dup2(down[0], 0);
  22. dup2(up[1], 1);
  23.  
  24. execl("/bin/sh", "sh", "-c", cmd_line, NULL);
  25.  
  26. _exit(1);
  27. }
  28.  
  29. close(down[0]);
  30. close(up[1]);
  31. _down = down[1];
  32. _up = up[0];
  33.  
  34. _reader_thd = new Thread(reader_wrapper, this); //here is the error happening.
  35.  
  36. THREAD_Return GmpPipePlayer::reader_wrapper(void *p)
  37.  
  38. {
  39. GmpPipePlayer *t = (GmpPipePlayer *)p;
  40.  
  41. t->reader_fn();
  42.  
  43. return NULL;
  44. }
  45.  
  46. if (_pid > 0)
  47. {
  48. kill(_pid, SIGTERM);
  49. _pid = 0;
  50. }
  51.  
  52. if (_up)
  53. {
  54. close(_up);
  55. _up = 0;
  56. }
  57.  
  58. if (_down)
  59. {
  60. close(_down);
  61. _down = 0;
  62. }
Add Comment
Please, Sign In to add comment