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

Melt SIGSEGV when using the -chain flag #975

Closed
bojidar-bg opened this issue Mar 13, 2024 · 5 comments
Closed

Melt SIGSEGV when using the -chain flag #975

bojidar-bg opened this issue Mar 13, 2024 · 5 comments

Comments

@bojidar-bg
Copy link

I'm probably using melt's -chain flag incorrectly, but just using it naively, e.g. as a first argument instead of -producer, currently produces a SIGSEGV. (7.22.0 / Arch Linux)

$ melt -producer x.mkv -consumer xml
(normal-looking MTL file)

$ melt -chain x.mkv -consumer xml
Segmentation fault (core dumped)

$ melt -chain -consumer xml
(normal-looking MTL file, though, no <chain> element is generated)

$ melt --version
melt 7.22.0
(...)

$ uname -a
Linux BojidarPC 6.7.9-arch1-1 #1 SMP PREEMPT_DYNAMIC Fri, 08 Mar 2024 01:59:01 +0000 x86_64 GNU/Linux
GDB backtrace (using Arch Linux debuginfod)
Thread 1 "melt" received signal SIGSEGV, Segmentation fault.
mlt_service_close (self=0x55555597d680) at /usr/src/debug/mlt/mlt-7.22.0/src/framework/mlt_service.c:864
864                     if (base->in[i] != NULL)                                                                                                                                            
(gdb) bt
#0  mlt_service_close (self=0x55555597d680) at /usr/src/debug/mlt/mlt-7.22.0/src/framework/mlt_service.c:864
#1  mlt_service_close (self=0x55555597d680) at /usr/src/debug/mlt/mlt-7.22.0/src/framework/mlt_service.c:850
#2  0x00007ffff7f4bf64 in mlt_producer_close (self=0x55555597d680) at /usr/src/debug/mlt/mlt-7.22.0/src/framework/mlt_producer.c:1116
#3  mlt_producer_close (self=0x55555597d680) at /usr/src/debug/mlt/mlt-7.22.0/src/framework/mlt_producer.c:1092
#4  0x00007ffff7f450a7 in mlt_chain_close (self=0x555555979a80) at /usr/src/debug/mlt/mlt-7.22.0/src/framework/mlt_chain.c:398
#5  mlt_chain_close (self=0x555555979a80) at /usr/src/debug/mlt/mlt-7.22.0/src/framework/mlt_chain.c:389
#6  0x00007ffff7f57bd8 in clear_property (self=self@entry=0x55555658f370) at /usr/src/debug/mlt/mlt-7.22.0/src/framework/mlt_property.c:113
#7  0x00007ffff7f5823d in mlt_property_close (self=0x55555658f370) at /usr/src/debug/mlt/mlt-7.22.0/src/framework/mlt_property.c:884
#8  0x00007ffff7f582f2 in mlt_properties_close (self=0x55555598b5b0) at /usr/src/debug/mlt/mlt-7.22.0/src/framework/mlt_properties.c:1508
#9  mlt_properties_close (self=0x55555598b5b0) at /usr/src/debug/mlt/mlt-7.22.0/src/framework/mlt_properties.c:1480
#10 0x00007ffff7f4bf64 in mlt_producer_close (self=0x55555598b5b0) at /usr/src/debug/mlt/mlt-7.22.0/src/framework/mlt_producer.c:1116
#11 mlt_producer_close (self=0x55555598b5b0) at /usr/src/debug/mlt/mlt-7.22.0/src/framework/mlt_producer.c:1092
#12 0x00007ffff7f4c171 in mlt_playlist_close (self=0x5555559702c0) at /usr/src/debug/mlt/mlt-7.22.0/src/framework/mlt_playlist.c:2103
#13 mlt_playlist_close (self=0x5555559702c0) at /usr/src/debug/mlt/mlt-7.22.0/src/framework/mlt_playlist.c:2096
#14 0x00007ffff7f61bf0 in mlt_service_close (self=0x555555976520) at /usr/src/debug/mlt/mlt-7.22.0/src/framework/mlt_service.c:865
#15 mlt_service_close (self=0x555555976520) at /usr/src/debug/mlt/mlt-7.22.0/src/framework/mlt_service.c:850
#16 0x00007ffff7f4bf64 in mlt_producer_close (self=0x555555976520) at /usr/src/debug/mlt/mlt-7.22.0/src/framework/mlt_producer.c:1116
#17 mlt_producer_close (self=self@entry=0x555555976520) at /usr/src/debug/mlt/mlt-7.22.0/src/framework/mlt_producer.c:1092
#18 0x00007ffff7f4c0cc in mlt_multitrack_close (self=<optimized out>) at /usr/src/debug/mlt/mlt-7.22.0/src/framework/mlt_multitrack.c:637
#19 mlt_multitrack_close (self=0x555555976520) at /usr/src/debug/mlt/mlt-7.22.0/src/framework/mlt_multitrack.c:623
#20 0x00007ffff7f57bd8 in clear_property (self=self@entry=0x5555559793c0) at /usr/src/debug/mlt/mlt-7.22.0/src/framework/mlt_property.c:113
#21 0x00007ffff7f5823d in mlt_property_close (self=0x5555559793c0) at /usr/src/debug/mlt/mlt-7.22.0/src/framework/mlt_property.c:884
#22 0x00007ffff7f582f2 in mlt_properties_close (self=0x555555973920) at /usr/src/debug/mlt/mlt-7.22.0/src/framework/mlt_properties.c:1508
#23 mlt_properties_close (self=0x555555973920) at /usr/src/debug/mlt/mlt-7.22.0/src/framework/mlt_properties.c:1480
#24 0x00007ffff7f4bf64 in mlt_producer_close (self=0x555555973920) at /usr/src/debug/mlt/mlt-7.22.0/src/framework/mlt_producer.c:1116
#25 mlt_producer_close (self=0x555555973920) at /usr/src/debug/mlt/mlt-7.22.0/src/framework/mlt_producer.c:1092
#26 0x00007ffff7f61b39 in mlt_tractor_close (self=0x555555973920) at /usr/src/debug/mlt/mlt-7.22.0/src/framework/mlt_tractor.c:652
#27 mlt_tractor_close (self=0x555555973920) at /usr/src/debug/mlt/mlt-7.22.0/src/framework/mlt_tractor.c:648
#28 0x0000555555556aa0 in main (argc=5, argv=0x7fffffffdf88) at /usr/src/debug/mlt/mlt-7.22.0/src/melt/melt.c:943
@bojidar-bg bojidar-bg changed the title Melt SIGSEGV when creating a chain Melt SIGSEGV when using the -chain flag Mar 13, 2024
@bmatherly
Copy link
Member

bmatherly commented Mar 13, 2024 via email

@bojidar-bg
Copy link
Author

Mm.. huh. But when I write the chain I want as an .XML file, the mlt_service of my chain is again avformat, not timeremap?, e.g.

<?xml version="1.0" encoding="utf-8"?>
<mlt LC_NUMERIC="C" version="7.22.0" root="(..snip..)">
  <profile description="automatic" (..snip..)/>
  <chain id="producer0" out="00:04:13.033">
    <property name="length">16263</property>
    <property name="eof">pause</property>
    <property name="resource">x.mkv</property>
    (..snip..)
    <property name="mlt_service">avformat</property>
    <link id="link0">
      <property name="mlt_service">timeremap</property>
      <property name="pitch">1</property>
      <property name="image_mode">nearest</property>
      <property name="time_map">:0.713021=0.713021;(..snip..);:252.921815=269.964000;</property>
    </link>
  </chain>
  <playlist id="playlist0">
    <entry producer="producer0" in="0" out="00:04:13.033"/>
  </playlist>
  <tractor id="tractor0" title="x.mkv" in="0" out="00:04:13.033">
    <track producer="playlist0"/>
  </tractor>
</mlt>

Meanwhile, timeremap is a link, not a chain? (:

In either case, that does not really work 😅:

$ melt -chain timeremap x.mkv -consumer xml
Failed to load "timeremap"
The futex facility returned an unexpected error code.
fish: Job 1, 'melt -chain timeremap x.mkv -co…' terminated by signal SIGABRT (Abort)
(OR:)
Failed to load "timeremap"
(hangs forever -- inside a futex_wait)

$ melt -chain avformat x.mkv -consumer xml
Failed to load "avformat"
(hangs forever -- inside same futex_wait)

$ melt -chain avformat:x.mkv -consumer xml
double free or corruption (!prev)
fish: Job 1, 'melt -chain avformat:x.mkv -con…' terminated by signal SIGABRT (Abort)
(OR:)
fish: Job 1, 'melt -chain avformat:x.mkv -con…' terminated by signal SIGSEGV (Address boundary error)

$ melt -chain avformat resource=x.mkv -consumer xml
Failed to load "avformat"
Failed to load "avformat"
(usage info)

$ melt -chain avformat resource=x.mkv -link timeremap -consumer xml
Failed to load "avformat"
A link can only be added to a chain with a producer.
Failed to load "timeremap"
Failed to load "avformat"
A link can only be added to a chain with a producer.
Failed to load "timeremap"

$ melt -chain avformat:x.mkv -link timeremap -consumer xml
(same crash as in the original post)

@ddennedy
Copy link
Member

From melt --help
-chain id[:arg] [name=value]* Add a producer as a chain

So, I would expect the reported to work. The problem is that in mlt_service_close() base->in is NULL when checking if (base->in[i] != NULL).

@bmatherly
Copy link
Member

bmatherly commented Mar 14, 2024 via email

@bojidar-bg
Copy link
Author

Oop. That was a fast fix.

I can confirm the latest Git version works for me now!

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

3 participants