This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 3/3] Add test for fetching TLS from core file


On 2017-10-23 19:42, Maciej W. Rozycki wrote:
You can't guarantee overall a test program won't hang, loop, etc. due to a bug somewhere. The issue of lingering processes should IMHO be handled by assigning software run on the target a new session and then killing the process group on completion. I believe this is actually done already, as this is how expect's `spawn' works and I think we also have it handled for
the remote case in the `gdbserver' test harness (but I'd love to get a
confirmation here).

 How do you propose anyway, in the absence of an infinite wait/loop, to
ensure that the process does not terminate before the test harness has
done its processing?

Ah sorry, I saw the while (1) loop in the thread function, and thought that the main function waited for the threads to complete. But it doesn't, it would exit right away after creating the threads.

What I meant was to try to avoid infinite loops.  Instead of

  while (1)
    sleep (1);

you can generally do

  for (int i = 0; i < 100; i++)
    sleep (1);

So that if the process runs free, it will eventually exit by itself.

Simon


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]