Skip to content

Commit

Permalink
Enable debug.
Browse files Browse the repository at this point in the history
  • Loading branch information
sobomax committed Sep 4, 2024
1 parent 3d9f57b commit 0ca6a5b
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions scripts/fuzz/fuzz_command_parser.options
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ detect_leaks=0
max_len=8192
print_final_stats=1
use_value_profile=1
max_total_time=180
1 change: 1 addition & 0 deletions scripts/fuzz/fuzz_rtcp_parser.options
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
max_len=8192
print_final_stats=1
use_value_profile=1
max_total_time=180
1 change: 1 addition & 0 deletions scripts/fuzz/fuzz_rtp_parser.options
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
max_len=8192
print_final_stats=1
use_value_profile=1
max_total_time=180
8 changes: 7 additions & 1 deletion scripts/fuzz/fuzz_rtp_session.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ proc_foreach(void *dp, void *ap)
struct sockaddr *rap;
struct rtp_packet *pktp = rtp_packet_alloc();
assert (pktp != NULL);
//CALL_SMETHOD(pktp->rcnt, traceen, HEREVAL);
void *olddata = CALL_SMETHOD(pktp->rcnt, getdata);
CALL_SMETHOD(pktp->rcnt, attach, wpd_f, olddata);
rap = sstosa(&pktp->raddr);
Expand All @@ -132,7 +133,9 @@ proc_foreach(void *dp, void *ap)
.strmp_out = ostp,
.rsp = fap->rsp,
.pktp = pktp};
CALL_SMETHOD(istp->pproc_manager, handleat, &pktx, _PPROC_ORD_EMPTY);
struct pproc_act r;
r = CALL_SMETHOD(istp->pproc_manager, handleat, &pktx, _PPROC_ORD_EMPTY);
assert(r.a == PPROC_ACT_TAKE_v || r.a == PPROC_ACT_DROP_v);
fap->nwait += 1;
}
return (RTPP_HT_MATCH_CONT);
Expand All @@ -155,6 +158,9 @@ LLVMFuzzerTestOneInput(const char *data, size_t size)
if (size < 2)
return (0);

fprintf(stderr, "LLVMFuzzerTestOneInput(data=%p, size=%lu)\n", data,
(unsigned long)size);
fflush(stderr);
op_flags.value = data[0];
data += 1;
size -= 1;
Expand Down
1 change: 1 addition & 0 deletions scripts/fuzz/fuzz_rtp_session.options
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ detect_leaks=0
max_len=8192
print_final_stats=1
use_value_profile=1
max_total_time=7200
1 change: 1 addition & 0 deletions src/rtpp_command.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ create_twinlistener(unsigned int port, void *ap)
SA_AF2STR(ctap->ia));
goto failure;
}
//CALL_SMETHOD(ctap->fds[i]->rcnt, traceen);
memcpy(&iac, ctap->ia, SA_LEN(ctap->ia));
satosin(&iac)->sin_port = htons(port);
if (CALL_SMETHOD(ctap->fds[i], bind2, sstosa(&iac), SA_LEN(ctap->ia)) != 0) {
Expand Down
1 change: 1 addition & 0 deletions src/rtpp_command_reply.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ rtpc_reply_ctor(const struct rtpp_command_ctx *ctx)
pvt->pub.smethods = rtpc_reply_smethods;
#endif
CALL_SMETHOD(pvt->pub.rcnt, use_stdfree, pvt);
CALL_SMETHOD(pvt->pub.rcnt, traceen, HEREVAL);
return ((&pvt->pub));

e0:
Expand Down
1 change: 1 addition & 0 deletions src/rtpp_module_if.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ rtpp_module_if_ctor(const char *mpath)
pvt->pub.get_mconf = &rtpp_mif_get_mconf;
pvt->pub.ul_subc_handle = &rtpp_mif_ul_subc_handle;
pvt->pub.kaput = &rtpp_mif_kaput;
//CALL_SMETHOD(pvt->pub.rcnt, traceen, HEREVAL);
CALL_SMETHOD(pvt->pub.rcnt, attach, (rtpp_refcnt_dtor_t)&rtpp_mif_dtor,
pvt);
return ((&pvt->pub));
Expand Down
3 changes: 3 additions & 0 deletions src/rtpp_refcnt.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@
#include "rtpp_refcnt.h"
#include "rtpp_refcnt_fin.h"

#undef RTPP_DEBUG_refcnt
#define RTPP_DEBUG_refcnt 1

#if RTPP_DEBUG_refcnt
#include <stdio.h>
#ifdef RTPP_DEBUG
Expand Down

0 comments on commit 0ca6a5b

Please sign in to comment.