Re: [Flightgear-devel] Re: [BUG] environemnt_ctrl.cxx: exception triggers SGThread assert()

2005-11-15 Thread Erik Hofman

Melchior FRANZ wrote:


  Error fetching live weather data: More than 10 stale METAR messages in a row.
  Stop fetching data permanently.
  fgfs: /usr/local/include/simgear/threads/SGThread.hxx:150: void \
  SGThread::join(): Assertion `status == 0' failed.
  /home/m/bin/fgfs: line 239: 18187 Aborted (core dumped) 


Same for me on Linux.
Next stop: IRIX.

Erik

___
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


Re: [Flightgear-devel] Re: [BUG] environemnt_ctrl.cxx: exception triggers SGThread assert()

2005-11-15 Thread Erik Hofman

Erik Hofman wrote:


Next stop: IRIX.


Same problem.

Erik

___
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


[Flightgear-devel] Re: [BUG] environemnt_ctrl.cxx: exception triggers SGThread assert()

2005-11-15 Thread Melchior FRANZ
* Melchior FRANZ -- Monday 14 November 2005 22:29:
 The strange thing is, that the return value that triggers assert()
 is 35, or EAGAIN (Linux). This makes no sense. It's neither described
 on the pthread_join manpage, nor is it used in any implementation that
 I found on the net.

BS! I've no idea where I looked that up. 35 is EDEADLK (deadlock:
Resource deadlock would occur). Reason according to man pthread_join:

  EDEADLK
 The th argument refers to the calling thread.

So this code is trying to join itself?

m.

___
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


[Flightgear-devel] Re: [BUG] environemnt_ctrl.cxx: exception triggers SGThread assert()

2005-11-14 Thread Melchior FRANZ
* Harald JOHNSEN -- Saturday 12 November 2005 17:09:
 Melchior FRANZ wrote:
  I've just implemented the check for stale METAR reports (to stop
  fetching after 10 stale reports). This triggers an assert in
  SGThread:

 It's perhaps because of the PTHREAD_CREATE_DETACHED attribute of the thread.

Yes, that's very likely the case, according to the man-pages. So, how
should the fix look like?

- do not create the thread with PTHREAD_CREATE_DETACHED, or
- do not try to join threads

m.

___
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


Re: [Flightgear-devel] Re: [BUG] environemnt_ctrl.cxx: exception triggers SGThread assert()

2005-11-14 Thread Erik Hofman

Melchior FRANZ wrote:

* Harald JOHNSEN -- Saturday 12 November 2005 17:09:

Melchior FRANZ wrote:

I've just implemented the check for stale METAR reports (to stop
fetching after 10 stale reports). This triggers an assert in
SGThread:



It's perhaps because of the PTHREAD_CREATE_DETACHED attribute of the thread.


Yes, that's very likely the case, according to the man-pages. So, how
should the fix look like?

- do not create the thread with PTHREAD_CREATE_DETACHED, or
- do not try to join threads


If it's causing any troubles I would remove the first three lined of 
SGThread::start() since we've done without it for many years.


Erik

___
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


[Flightgear-devel] Re: [BUG] environemnt_ctrl.cxx: exception triggers SGThread assert()

2005-11-14 Thread Melchior FRANZ
* Erik Hofman -- Monday 14 November 2005 18:47:
 If it's causing any troubles I would remove the first three lined of 
 SGThread::start() since we've done without it for many years.

It is causing troubles: the pthread_join manpage says:

  The joined thread th must be in the joinable state: it must not
  have been detached using pthread_detach(3) or the PTHREAD_CREATE_DETACHED
  attribute to pthread_create(3).

And environment_ctrl.cxx *is* trying to join such an unjoinable thread,
and makes fgfs abort. Fortunately, I'm quite clueless about threads and
don't have to decide what to do.  :-)

m.

___
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


[Flightgear-devel] Re: [BUG] environemnt_ctrl.cxx: exception triggers SGThread assert()

2005-11-14 Thread Melchior FRANZ
Unfortunately, reverting the recent changes (that caused the thread
to be created with detached state) wasn't enough to fix the problem.
The strange thing is, that the return value that triggers assert()
is 35, or EAGAIN (Linux). This makes no sense. It's neither described
on the pthread_join manpage, nor is it used in any implementation that
I found on the net. Also, if I take it literally and try again in
an endless loop, I get endless 35 codes.

Maybe I've got a broken libpthread or something. Could someone try
to reproduce it?

  $ fgfs --aircraft=ufo --prop:/environment/params/metar-max-age-min=1 
--log-level=warn

Then fly to another airport, say KOAK and wait. After one minute
fgfs starts to fetch METAR reports for KOAK, but they are most
likely older than one minute, so it fetches the next, and next,
until it throws an exception after ten failed attempts. And this
causes an abortion here:

  Error fetching live weather data: More than 10 stale METAR messages in a row.
  Stop fetching data permanently.
  fgfs: /usr/local/include/simgear/threads/SGThread.hxx:150: void \
  SGThread::join(): Assertion `status == 0' failed.
  /home/m/bin/fgfs: line 239: 18187 Aborted (core dumped) 

m.

___
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


[Flightgear-devel] Re: [BUG] environemnt_ctrl.cxx: exception triggers SGThread assert()

2005-11-14 Thread Melchior FRANZ
* Melchior FRANZ -- Monday 14 November 2005 22:29:
   $ fgfs --aircraft=ufo --prop:/environment/params/metar-max-age-min=1 
 --log-level=warn

I forgot  --enable-real-weather-fetch.

m.

___
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d