Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Null pointer reference in GPAC at src/filter_core/filter_pid.c:5394 #1906

Closed
3 tasks done
AntsKnows opened this issue Sep 1, 2021 · 4 comments
Closed
3 tasks done

Comments

@AntsKnows
Copy link

Thanks for reporting your issue. Please make sure these boxes are checked before submitting your issue - thank you!

  • I looked for a similar issue and couldn't find any.
  • I tried with the latest version of GPAC. Installers available at http://gpac.io/downloads/gpac-nightly-builds/
  • I give enough information for contributors to reproduce my issue (meaningful title, github labels, platform and compiler, command-line ...)

Step to reproduce:

1.get latest commit code (GPAC version 1.1.0-DEV-rev1170-g592ba2689-master)
2.compile with --enable-sanitizer
3.run  ./gpac nhmlr:reframe=1:gpac:index=1.0:gpac:src=

Im not sure if it's a correct usage of "nhmlr filter" , or by which way could i parse nhml file?

Env:
Ubunut 20.04 , clang 12.0.1

ASAN report

==2311904==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7fa16d0fb321 bp 0x7fff730acdb0 sp 0x7fff730acc20 T0)
==2311904==The signal is caused by a READ memory access.
==2311904==Hint: address points to the zero page.
    #0 0x7fa16d0fb321 in gf_filter_pid_get_packet /home/lly/pro/gpac_public/src/filter_core/filter_pid.c:5394:6
    #1 0x7fa16d22468a in nhmldmx_process /home/lly/pro/gpac_public/src/filters/dmx_nhml.c:1320:8
    #2 0x7fa16d15a431 in gf_filter_process_task /home/lly/pro/gpac_public/src/filter_core/filter.c:2441:7
    #3 0x7fa16d13d2a7 in gf_fs_thread_proc /home/lly/pro/gpac_public/src/filter_core/filter_session.c:1640:3
    #4 0x7fa16d13c850 in gf_fs_run /home/lly/pro/gpac_public/src/filter_core/filter_session.c:1877:2
    #5 0x4d12ed in gpac_main /home/lly/pro/gpac_public/applications/gpac/main.c:2254:7
    #6 0x7fa16c0210b2 in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:308:16
    #7 0x41fe0d in _start (/home/lly/pro/gpac_public/bin/gcc/gpac+0x41fe0d)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /home/lly/pro/gpac_public/src/filter_core/filter_pid.c:5394:6 in gf_filter_pid_get_packet
@jeanlf jeanlf closed this as completed in 44fdc3d Sep 1, 2021
@jeanlf
Copy link
Member

jeanlf commented Sep 1, 2021

Thanks for the report, we had a bug triggering filter process on non source filters when "src" was set.
The proper way to use the filter for your case is simply
gpac -i file.nhml:reframe=1 ...

@AntsKnows
Copy link
Author

AntsKnows commented Sep 7, 2021

Thanks for the report, we had a bug triggering filter process on non source filters when "src" was set.
The proper way to use the filter for your case is simply
gpac -i file.nhml:reframe=1 ...

Hello @jeanlf,
I've tried your suggestion, but failed with a message

"No filter chain found for PID test.nhml in filter fin to any loaded filters - NOT CONNECTED"
"Argument ":reframe" was set but not used by any filter"

And i tried
gpac -i test.nhml nhmlr:reframe=1:gpac:index=1.0 -o /dev/null
got:

"No filter chain found for PID test_export.nhml in filter nhmlr to any loaded filters - NOT CONNECTED"

My purpose is touching the code in function nhmldmx_send_sample() at src/filters/dmx_nhml.c:929, could u please help me the right command line?

@jeanlf
Copy link
Member

jeanlf commented Sep 7, 2021

if you try:
gpac -i test.nhml:reframe=1:index=1.0 inspect:deep
you should see the content of your nhml file

Using either of the following

gpac -i test.nhml:reframe=1:index=1.0 -o /dev/null
gpac -i test.nhml nhmlr:reframe=1:gpac:index=1.0 -o /dev/null

simply forward fin (raw file) to /dev/null because no extension/format is provided on the output, hence the message. You can check this adding -graph to your command line.

If you use:

gpac -i test.nhml:reframe=1:index=1.0 -o /dev/null:ext=mp4
gpac -i test.nhml nhmlr:reframe=1:gpac:index=1.0 -o /dev/null:ext=mp4

then a mp4 muxer will be loaded.

Otherwise you will need to force fout to only use inputs from nhmlr using link directives (here, '@'):

gpac -i test.nhml nhmlr:reframe=1 @ -o /dev/null:ext=mp4

@AntsKnows
Copy link
Author

Truly appreciate it, i've tried commands above.It does work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants