Follow-up Comment #8, bug #24935 (project freeciv):

> Is that still server_scan_finish() call
Yes

Using gdb to watch meta_scan, I could see the metaserver thread nulling it
just before the crash. I think what happens is:
- [metaserver thread] server_scan_error() is called
- [meta] server_scan_error() calls server_scan_finish()
- [meta] server_scan_error() locks a mutex
- [main thread] server_scan_finish() is called
- [main] server_scan_finish() tries to lock the mutex, waits
- [meta] server_scan_finish() frees meta_scan, unlocks the mutex
- [main] server_scan_finish() frees meta_scan again
If I'm right, the key problems are:
- if (meta_scan) happens before any mutex is locked
- meta_scan is a pointer and not updated atomically anyway
- meta_scan = NULL happens after all mutexes are unlocked
Does it look realistic ?


    _______________________________________________________

Reply to this item at:

  <http://gna.org/bugs/?24935>

_______________________________________________
  Message posté via/par Gna!
  http://gna.org/


_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to