sox-devel@lists.sourceforge.net unofficial mirror
 help / color / mirror / code / Atom feed
From: Eric Wong <normalperson@yhbt.net>
To: sox-users@lists.sourceforge.net
Cc: sox-devel@lists.sourceforge.net
Subject: Re: [SoX-users] Fwd: Re: sox merge two files of different length
Date: Wed, 4 Sep 2013 07:03:31 +0000	[thread overview]
Message-ID: <20130904070331.GA7053@dcvr.yhbt.net> (raw)
In-Reply-To: <20130904063530.GB30671@www.stare.cz>

Adding sox-devel to Cc:, Jan was able to trigger a segfault on
OpenBSD i386 with the below example on 14.4.1.

Jan Stary <hans@stare.cz> wrote:
> On Sep 04 06:22:25, normalperson@yhbt.net wrote:
> > Can you replace .wav with .sox (or other formats) and reproduce the
> > issue with a different format?
> 
> The same happens with the .sox format:
> 
>   $ sox -n one.sox synth 4.145 sin 440 gain -6                      
>   $ sox -n two.sox synth 5.325 sin 540 gain -6                      
>   $ sox -V "|sox one.sox -p trim 0 -`soxi -D two.sox`" two.sox out.sox
>   sox:      SoX v14.4.1
>   sox INFO formats: detected file format type `sox'
>   sox FAIL trim: Position 2 is before start of audio.
>   sox INFO formats: detected file format type `sox'
>   Segmentation fault (core dumped) 
> 
> 
> > > > > Can you fire up gdb on the core dump and show us the backtrace?
> > > > > (hopefully your sox build has debugging symbols).  Thanks.

> #0  memcpy ()
>     at /usr/src/lib/libc/arch/i386/string/bcopy.S:88
> 88		rep
> (gdb) bt
> #0  memcpy () at /usr/src/lib/libc/arch/i386/string/bcopy.S:88
> #1  0x06c2394b in fread (buf=0xcfbd6e24, size=1, count=4, fp=0x26bb8f98)
>     at /usr/src/lib/libc/stdio/fread.c:69
> #2  0x0506eac1 in lsx_readbuf () from /usr/local/lib/libsox.so.3.0
> #3  0x0506ef00 in lsx_read_dw_buf () from /usr/local/lib/libsox.so.3.0
> #4  0x0506ef91 in lsx_readdw () from /usr/local/lib/libsox.so.3.0
> #5  0x050713af in startread () from /usr/local/lib/libsox.so.3.0
> #6  0x0506d2b7 in open_read () from /usr/local/lib/libsox.so.3.0

OK, based on the above I suspect it's in the pipe handling code and not
a problem with trim itself.  That code (in src/formats.c) contains some
strange OS-specific code for rewinding pipes, and I haven't looked
closely at it.

Can you reproduce the issue by using a temporary file instead of a pipe?
I strongly suspect this is OpenBSD-specific and only to pipes.

> > A system call trace probably isn't going to be useful in this case.
> 
> I was just suspecting some of the time_t related problems
> to possibly show up. But I will stick to gdb then.
> 
> 	Jan
> 
> PS: should we move this to -dev?

Probably, yes.  Cc-ed them.  I'm not a real sox developer :)

------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk

       reply	other threads:[~2013-09-04  7:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20130904053129.GA32359@www.stare.cz>
     [not found] ` <20130904062225.GA16303@dcvr.yhbt.net>
     [not found]   ` <20130904063530.GB30671@www.stare.cz>
2013-09-04  7:03     ` Eric Wong [this message]
2013-09-04  7:17       ` [SoX-users] Fwd: Re: sox merge two files of different length Jan Stary
2013-09-04 17:26         ` Eric Wong
2013-09-04 19:16           ` Jan Stary
2013-09-04 19:40             ` Eric Wong
2013-09-04  7:09     ` Jan Stary

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.sourceforge.net/lists/listinfo/sox-devel

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130904070331.GA7053@dcvr.yhbt.net \
    --to=sox-devel@lists.sourceforge.net \
    --cc=sox-users@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/sox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).