Opened 15 years ago

Last modified 15 years ago

#939 closed defect

Throwing exception inside exception handler will cause infinite loop (thanks Roman Puls for the report) — at Version 2

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

Description (last modified by bennylp)

The following snippet:

void test() 
{
    int id = 101;
    PJ_USE_EXCEPTION;
 
    PJ_TRY {
        PJ_LOG(3, ("", "throwing signal %d now", id));
        PJ_THROW(id);
    } PJ_CATCH_ANY {
        id = PJ_GET_EXCEPTION();
        PJ_LOG(3, ("", "caught and reraising %d", id));
        PJ_THROW(id);
    } PJ_END;
 
    PJ_LOG(3, ("", "Never gets called"));
};

leads to an endless loop:

INFO: 08:58:50.682          throwing signal 101
INFO: 08:58:50.682          caught and reraising 101
INFO: 08:58:50.682          caught and reraising 101
INFO: 08:58:50.682          caught and reraising 101
...

Thanks Roman Puls for the report.

Change History (2)

comment:1 Changed 15 years ago by bennylp

  • Description modified (diff)

comment:2 Changed 15 years ago by bennylp

  • Description modified (diff)
Note: See TracTickets for help on using tickets.