help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: audio check?


From: Jim Langston
Subject: Re: audio check?
Date: Wed, 05 Sep 2007 14:23:31 -0400
User-agent: Thunderbird 1.5.0.8 (X11/20061204)

Hi John,

Can I change wavread to include prints?

I have not seen the EOF logic get entered. I continually monitor line 80, return c; which is
always 82, the method c_file_ptr_buf::underflow_common is being continually
called

truss output shows

28132:  read(5, 0x087A782C, 8192)                       = 0
28132:  ioctl(5, TCGETA, 0x08045BDC)                    Err#25 ENOTTY
28132: xstat(2, "/usr/local/share/octave/2.9.13/m/audio/wavread.m", 0x08045D04) = 0 28132: xstat(2, "/usr/local/share/octave/2.9.13/m/audio/wavread.m", 0x08045DE4) = 0
28132:  read(5, 0x087A782C, 8192)                       = 0
28132:  ioctl(5, TCGETA, 0x08045BDC)                    Err#25 ENOTTY
28132:  llseek(5, 0, SEEK_CUR)                          = 6153
28132:  close(5)                                        = 0
28132:  xstat(2, "a.wav", 0x0804607C)                   = 0
28132:  open("a.wav", O_RDONLY)                         = 5
28132:  fstat64(5, 0x08044FF0)                          = 0
28132:  fstat64(5, 0x08044F20)                          = 0
28132:  ioctl(5, TCGETA, 0x08044FBC)                    Err#25 ENOTTY
28132:  read(5, " R I F F L\0\0\0 W A V E".., 8192)     = 84
28132:      Received signal #2, SIGINT [caught]


Only one read was attempted, the SIGINT is me stopping the session

bash-3.00$ od -c a.wav
0000000 R I F F L \0 \0 \0 W A V E f m t 0000020 020 \0 \0 \0 001 \0 \n \0 @ 037 \0 \0 \0 q 002 \0
0000040 024  \0 020  \0   d   a   t   a   (  \0  \0  \0 315  \f 232 031
0000060   f   &   3   3  \0   @ 315   L 232   Y   f   f   3   s 377 177
0000100 315  \f 232 031   f   &   3   3  \0   @ 315   L 232   Y   f   f
0000120   3   s 377 177
0000124
bash-3.00$


A little more debugging info, but don't see anything different

(dbx) cont
^Cdbx: warning: Interrupt ignored but forwarded to child.
address@hidden (address@hidden) signal INT (Interrupt) in getc at line 340 in file 
"stdio_iso.h"
 340           return (--_p->_cnt < 0 ? __filbuf(_p) : (int)*_p->_ptr++); }
(dbx) list
 340           return (--_p->_cnt < 0 ? __filbuf(_p) : (int)*_p->_ptr++); }
 341   inline int putc(int _x, FILE *_p) {
 342           return (--_p->_cnt < 0 ? __flsbuf(_x, _p)
 343                   : (int)(*_p->_ptr++ = (unsigned char) _x)); }
 344   }
 345   #else /* __cplusplus >= 199711L */
346 #define getc(p) (--(p)->_cnt < 0 ? __filbuf(p) : (int)*(p)->_ptr++)
 347   #define putc(x, p)      (--(p)->_cnt < 0 ? __flsbuf((x), (p)) \
348 : (int)(*(p)->_ptr++ = (unsigned char) (x)))
 349   #endif /* __cplusplus >= 199711L */
(dbx) step
address@hidden (address@hidden) stopped in getc at line 340 in file 
"stdio_iso.h"
 340           return (--_p->_cnt < 0 ? __filbuf(_p) : (int)*_p->_ptr++); }
(dbx) step
address@hidden (address@hidden) stopped in c_file_ptr_buf::underflow_common at line 72 in file "c-file-ptr-stream.cc"
  72         if (! bump
(dbx) step
address@hidden (address@hidden) stopped in c_file_ptr_buf::underflow_common at line 78 in file "c-file-ptr-stream.cc"
  78           ungetc (c, f);
(dbx) step
address@hidden (address@hidden) stopped in c_file_ptr_buf::underflow_common at line 80 in file "c-file-ptr-stream.cc"
  80         return c;
(dbx) print *f
*f = {
   _cnt          = 84
   _ptr          = 0x87bad24 "RIFFL"
   _base         = 0x87bad24 "RIFFL"
   _flag         = '\t'
   _magic        = '\005'
   __orientation = 0
   __ionolock    = 0
   __seekable    = 1U
   __extendedfd  = 0
   __xf_nocheck  = 0
   __filler      = 0
}
(dbx) print c
c = 82
(dbx) print bump
bump = false
(dbx) list
  80         return c;
  81       }
  82     else
  83   #if defined (CXX_ISO_COMPLIANT_LIBRARY)
  84       return traits_type::eof ();
  85   #else
  86       return EOF;
  87   #endif
  88   }
89 (dbx) print c
c = 82
(dbx) step
address@hidden (address@hidden) stopped in c_file_ptr_buf::underflow_common at line 88 in file "c-file-ptr-stream.cc"
  88   }
(dbx) step
address@hidden (address@hidden) stopped in c_file_ptr_buf::underflow at line 53 in file "c-file-ptr-stream.h"
  53     int_type underflow (void) { return underflow_common (false); }


(dbx) list
  53     int_type underflow (void) { return underflow_common (false); }
54 55 int_type uflow (void) { return underflow_common (true); } 56 57 int_type pbackfail (int_type); 58 59 std::streamsize xsputn (const char*, std::streamsize); 60 61 std::streamsize xsgetn (char *, std::streamsize); 62 (dbx) where
current thread: address@hidden
=>[1] c_file_ptr_buf::underflow(this = 0x87a9810), line 53 in "c-file-ptr-stream.h" [2] std::basic_istream<char,std::char_traits<char> >::read(0x87a79e0, 0x8045ab2, 0x1), at 0xfbf7aaa7 [3] do_read<NDArray,unsigned char>(strm = STRUCT, nr = 4, nc = 1, block_size = 1, skip = 0, do_float_fmt_conv = false, from_flt_fmt = flt_fmt_ieee_little_endian, count = 0), line 3122 in "unknown" [4] octave_stream::read(this = 0x8045d2c, size = CLASS, block_size = 1, input_type = dt_uchar, output_type = dt_double, skip = 0, ffmt = flt_fmt_ieee_little_endian, char_count = 0), line 3327 in "oct-stream.cc" [5] do_fread(os = STRUCT, size_arg = CLASS, prec_arg = CLASS, skip_arg = CLASS, arch_arg = CLASS, count = 0), line 1260 in "file-io.cc"
 [6] Ffread(args = CLASS, _ARG3 = 1), line 1489 in "file-io.cc"
[7] octave_builtin::do_multi_index_op(this = 0x8254b00, nargout = 1, args = CLASS), line 104 in "ov-builtin.cc" [8] octave_builtin::subsref(this = 0x8254b00, type = CLASS, idx = CLASS, nargout = 1), line 54 in "ov-builtin.cc" [9] octave_value::subsref(this = 0x80460c8, type = CLASS, idx = CLASS, nargout = 1), line 723 in "ov.cc" [10] tree_index_expression::rvalue(this = 0x87c6b10, nargout = 1), line 352 in "pt-idx.cc" [11] tree_index_expression::rvalue(this = 0x87c6b10), line 363 in "pt-idx.cc" [12] tree_argument_list::convert_to_const_vector(this = 0x87c4168, object = 0x8046450), line 182 in "pt-arg-list.cc" [13] make_value_list(args = 0x87c4168, arg_nm = CLASS, object = 0x8046450), line 174 in "pt-idx.cc" [14] tree_index_expression::rvalue(this = 0x87c6928, nargout = 1), line 323 in "pt-idx.cc" [15] tree_index_expression::rvalue(this = 0x87c6928), line 363 in "pt-idx.cc" [16] tree_postfix_expression::rvalue(this = 0x87c4190), line 191 in "pt-unop.cc" [17] tree_simple_assignment::rvalue(this = 0x87c7478), line 202 in "pt-assign.cc" [18] tree_simple_assignment::rvalue(this = 0x87c7478, nargout = 0), line 184 in "pt-assign.cc" [19] tree_statement::eval(this = 0x87c6ec0, silent = false, nargout = 0, in_function_body = true), line 133 in "pt-stmt.cc" [20] tree_statement_list::eval(this = 0x87c3ab0, silent = false, nargout = 0), line 190 in "pt-stmt.cc" [21] octave_user_function::do_multi_index_op(this = 0x825baa0, nargout = 3, args = CLASS), line 366 in "ov-usr-fcn.cc" [22] octave_user_function::subsref(this = 0x825baa0, type = CLASS, idx = CLASS, nargout = 3), line 220 in "ov-usr-fcn.cc" [23] octave_value::subsref(this = 0x8046dc8, type = CLASS, idx = CLASS, nargout = 3), line 723 in "ov.cc" [24] tree_index_expression::rvalue(this = 0x83c6fd8, nargout = 3), line 352 in "pt-idx.cc" [25] tree_multi_assignment::rvalue(this = 0x845bec0, _ARG3 = 0), line 362 in "pt-assign.cc" [26] tree_statement::eval(this = 0x84b0a58, silent = false, nargout = 0, in_function_body = false), line 133 in "pt-stmt.cc" [27] tree_statement_list::eval(this = 0x87b7938, silent = false, nargout = 0), line 190 in "pt-stmt.cc"
 [28] main_loop(), line 225 in "toplev.cc"
[29] octave_main(argc = 1, argv = 0x8047364, embedded = 0), line 791 in "octave.cc"
 [30] main(argc = 1, argv = 0x8047364), line 36 in "main.c"
(dbx) thread -info address@hidden
       Thread address@hidden (0xfc312000) at priority 0
       state: active on    address@hidden
       base function: 0x0: 0x00000000() stack: 0x8048000[10485760]
       flags: (none)
       masked signals: (none)
       Currently active in underflow
(dbx) step
^Cdbx: warning: Interrupt ignored but forwarded to child.
address@hidden (address@hidden) signal INT (Interrupt) in _dladdr at 0xfbdbdf94
0xfbdbdf94: _dladdr+0x2df94 [PLT]:      jmp      *0x000000e4(%ebx)
Current function is c_file_ptr_buf::underflow_common
  78           ungetc (c, f);
(dbx) thread -info address@hidden
       Thread address@hidden (0xfc312000) at priority 0
       state: active on    address@hidden
       base function: 0x0: 0x00000000() stack: 0x8048000[10485760]
       flags: (none)
       masked signals: (none)
       Currently active in _dladdr
(dbx) print c
c = 82
(dbx) print *f
*f = {
   _cnt          = 83
   _ptr          = 0x87bad25 "IFFL"
   _base         = 0x87bad24 "RIFFL"
   _flag         = '\t'
   _magic        = '\005'
   __orientation = 0
   __ionolock    = 0
   __seekable    = 1U
   __extendedfd  = 0
   __xf_nocheck  = 0
   __filler      = 0
}
(dbx) cont
^Cdbx: warning: Interrupt ignored but forwarded to child.
address@hidden (address@hidden) signal INT (Interrupt) in getc at line 340 in file 
"stdio_iso.h"
 340           return (--_p->_cnt < 0 ? __filbuf(_p) : (int)*_p->_ptr++); }
(dbx) step
address@hidden (address@hidden) stopped in getc at line 340 in file 
"stdio_iso.h"
 340           return (--_p->_cnt < 0 ? __filbuf(_p) : (int)*_p->_ptr++); }
(dbx) step
address@hidden (address@hidden) stopped in c_file_ptr_buf::underflow_common at line 72 in file "c-file-ptr-stream.cc"
  72         if (! bump
(dbx) step
address@hidden (address@hidden) stopped in c_file_ptr_buf::underflow_common at line 78 in file "c-file-ptr-stream.cc"
  78           ungetc (c, f);
(dbx) step
address@hidden (address@hidden) stopped in c_file_ptr_buf::underflow_common at line 80 in file "c-file-ptr-stream.cc"
  80         return c;
(dbx) step
address@hidden (address@hidden) stopped in c_file_ptr_buf::underflow_common at line 88 in file "c-file-ptr-stream.cc"
  88   }
(dbx) step
address@hidden (address@hidden) stopped in c_file_ptr_buf::underflow at line 53 in file "c-file-ptr-stream.h"
  53     int_type underflow (void) { return underflow_common (false); }
(dbx) step
^Cdbx: warning: Interrupt ignored but forwarded to child.
address@hidden (address@hidden) signal INT (Interrupt) in getc at line 340 in file 
"stdio_iso.h"
 340           return (--_p->_cnt < 0 ? __filbuf(_p) : (int)*_p->_ptr++); }


Jim

//////////////////////////////////

John W. Eaton wrote:
On  5-Sep-2007, Jim Langston wrote:

| It looks like a loop:
| | (dbx) cont
| ^Cdbx: warning: Interrupt ignored but forwarded to child.
| address@hidden (address@hidden) signal INT (Interrupt) in std::char_traits<char>::eof at | 0xfbef0124
| 0xfbef0124: eof       : movl     $0xffffffff,%eax
| Current function is c_file_ptr_buf::underflow_common
|    72         if (! bump
| (dbx) list
|    72         if (! bump
|    73   #if defined (CXX_ISO_COMPLIANT_LIBRARY)
|    74             && c != traits_type::eof ())
|    75   #else
|    76             && c != EOF)
|    77   #endif
|    78           ungetc (c, f);
| 79 | 80 return c;
|    81       }
| (dbx) cont
| ^Cdbx: warning: Interrupt ignored but forwarded to child.
| address@hidden (address@hidden) signal INT (Interrupt) in c_file_ptr_buf::underflow at line 53 | in file "c-file-ptr-stream.h"
|    53     int_type underflow (void) { return underflow_common (false); }
| (dbx) list
|    53     int_type underflow (void) { return underflow_common (false); }
| 54 | 55 int_type uflow (void) { return underflow_common (true); } | 56 | 57 int_type pbackfail (int_type); | 58 | 59 std::streamsize xsputn (const char*, std::streamsize); | 60 | 61 std::streamsize xsgetn (char *, std::streamsize); | 62 | (dbx) cont
| ^Cdbx: warning: Interrupt ignored but forwarded to child.
| address@hidden (address@hidden) signal INT (Interrupt) in _ungetc_unlocked at 
0xfbe151d1
| 0xfbe151d1: _ungetc_unlocked+0x0011:    addl     $0x00069e30,%ebx
| Current function is c_file_ptr_buf::underflow_common
|    78           ungetc (c, f);
| (dbx)

The next question is why is it looping?  Is it at the end of the file?
Are we incorrectly trying to put EOF back on the input stream?  If so,
what is the source of that error?  It looks like this must be
happening in one of the calls to fread in wavread.m.  Can you
determine which call to fread it is, and whether the data that has
been read up to that point is correct?

jwe


--
/////////////////////////////////////////////

Jim Langston
Sun Microsystems, Inc.

(877) 854-5583 (AccessLine)
AIM: jl9594
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]