Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#931 closed defect (fixed)

Logging function may infinitely recursively calls itself on Windows Mobile (thanks Emil Sturniolo for the report)

Reported by: bennylp Owned by: bennylp
Priority: major Milestone: release-1.4
Component: pjlib Version: trunk
Keywords: Cc:
Backport to 1.x milestone: Backported:

Description (last modified by bennylp)

The pj_log() function, the main implementation of logging functionality in PJLIB, calls some other PJLIB APIs such as pj_gettimeofday(). The implementation of these other APIs may in turn call back the pj_log() function, causing infinite recursive calls.

This happens especially on Windows Mobile platform where PJLIB emulates the millisecond resolution of the time function (this feature was added in version 1.2 by ticket #764), depending on the timing when the logging was called.

The corresponding ticket for 1.0 branch is ticket #932

Change History (4)

comment:1 Changed 10 years ago by bennylp

  • Description modified (diff)

comment:2 Changed 10 years ago by bennylp

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

In r2853:

  • Added feature to temporarily suspend the logging facility while we're in the pj_log() function. The suspension will be thread specific if the platform supports it.

comment:3 follow-up: Changed 10 years ago by nanang

In r2868:

  • Fixed logging for non-multithreading platforms.

comment:4 in reply to: ↑ 3 Changed 10 years ago by nanang

Replying to nanang:

In r2868:

  • Fixed logging for non-multithreading platforms.

Details:

  • fixed bug in logging suspension status check.
  • fixed suspend_logging() in storing current pj_log_max_level (should be before setting it to 0).
Note: See TracTickets for help on using tickets.