Ticket #684 (closed defect: fixed)

Opened 3 weeks ago

Last modified 10 days ago

Warning: thread ID overflows thread_id data type.

Reported by: stefan Owned by: alexander
Priority: major Milestone: Linux 64bit
Component: startstop Version:
Keywords: Cc:

Description

Messages StartThreadWithArg?: Warning: thread ID overflows thread_id data type. appear all over the startstop console. Fine to record these messages, but put in a log file instead.

Change History

comment:1 Changed 2 weeks ago by alexander

  • Owner changed from somebody to alexander
  • Status changed from new to assigned

comment:2 Changed 2 weeks ago by alexander

  • Status changed from assigned to closed
  • Resolution set to fixed

Closing ticket, resolved issue on Linux 64 bit.

comment:3 Changed 10 days ago by baker

I had forgotten just how many files are affected by this bug. :) I think you missed some declarations that should be ew_thread_id's:

  • src/data_exchange/coaxtoring/coaxtoring.c
  • src/data_exchange/ew2ringserver/ew2ringserver.c
  • src/seismic_processing/ew2rsam/ew2rsam.c
  • src/reporting/nq2gif/externs.h
  • src/data_sources/nq2ring/externs.h
  • src/archiving/nq2wws/externs.h

There are several instances where (ew_thread_id) -1 or 0 is assigned to the thread ID or compared to the thread ID, e.g.:

  • src/data_exchange/liss2ew_scnl/liss2ew_scnl.cpp
  • src/data_sources/k2ew/terminat.c

pthread_t's (the thread ID in POSIX Threads) are an opaque data type and cannot be compared using C. From the pthread_self man page:

Therefore, variables of type pthread_t can't portably be compared using the C equality operator (==); use pthread_equal(3) instead.

Function calls should not cast a thread ID argument to a (ew_thread_id) or a (ew_thread_id*); that prevents the function prototypes from catching coding errors.

Be sure to consider the comments in ticket 666. Most of these issues are discussed there.

comment:4 Changed 10 days ago by alexander

  • Status changed from closed to reopened
  • Resolution fixed deleted

Reopening ticket to address issues raised by Mr. Baker above (thanks for the heads up!)

comment:5 Changed 10 days ago by alexander

  • Status changed from reopened to closed
  • Resolution set to fixed

Closing again after committing revision 7787

Note: See TracTickets for help on using tickets.