octave-maintainers
[Top][All Lists]
Advanced

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

Re: find first and last


From: Bill Denney
Subject: Re: find first and last
Date: Tue, 26 Sep 2006 10:49:23 -0400 (EDT)

On Tue, 26 Sep 2006, David Bateman wrote:

Bill Denney wrote:
BTW, a bit more detail on where the problems occur:
1) if you use the second argument and not the third arg, it will
seg-fault.
2) if you use the third arg at all, it prints the usage.

Try running "valgrind --tool=memcheck octave" and running your oct-file.
This should identify exactly the line on which the seg-fault is
happening on together with the line that allocates the block in which
the seg-fault is happening was allocated..

OK, I tried that, but I couldn't interpret the output. As I read it, there should be an error in ov.h line 227 (which, as far as I know, has nothing to do with my changes).

I also looked at my changes line 227, but that was a line with just a } on it. I tried rewriting the if statement around there, but that didn't fix it either.

Bill

octave:3> find(1:10 > 5, 1)
==30346==
==30346== Invalid read of size 4
==30346==    at 0x515736E: Ffind(octave_value_list const&, int) (ov.h:227)
==30346== by 0x4415213: octave_builtin::do_multi_index_op(int, octave_value_list const&) (ov-builtin.cc:104) ==30346== by 0x7F6B7DD: octave_dispatch::do_multi_index_op(int, octave_value_list const&) (dispatch.cc:273) ==30346== by 0x7F6AFD8: octave_dispatch::subsref(std::string const&, std::list<octave_value_list, std::allocator<octave_value_list> > const&, int) (dispatch.cc:144) ==30346== by 0x43D70E5: octave_value::subsref(std::string const&, std::list<octave_value_list, std::allocator<octave_value_list> > const&, int) (ov.cc:734) ==30346== by 0x451E993: tree_index_expression::rvalue(int) (pt-idx.cc:352) ==30346== by 0x453BBC4: tree_statement::eval(bool, int, bool) (pt-stmt.cc:133) ==30346== by 0x453C044: tree_statement_list::eval(bool, int) (pt-stmt.cc:190)
==30346==    by 0x4339E71: main_loop() (toplev.cc:225)
==30346==    by 0x42C1F38: octave_main (octave.cc:766)
==30346==    by 0x8048657: main (main.c:36)
==30346==  Address 0x75FA728 is 0 bytes after a block of size 8 alloc'd
==30346== at 0x401C8C7: operator new(unsigned) (vg_replace_malloc.c:163) ==30346== by 0x451E8AB: tree_index_expression::rvalue(int) (new_allocator.h:88) ==30346== by 0x453BBC4: tree_statement::eval(bool, int, bool) (pt-stmt.cc:133) ==30346== by 0x453C044: tree_statement_list::eval(bool, int) (pt-stmt.cc:190)
==30346==    by 0x4339E71: main_loop() (toplev.cc:225)
==30346==    by 0x42C1F38: octave_main (octave.cc:766)
==30346==    by 0x8048657: main (main.c:36)
==30346==
==30346== Invalid read of size 4
==30346==    at 0x5157371: Ffind(octave_value_list const&, int) (ov.h:228)
==30346== by 0x4415213: octave_builtin::do_multi_index_op(int, octave_value_list const&) (ov-builtin.cc:104) ==30346== by 0x7F6B7DD: octave_dispatch::do_multi_index_op(int, octave_value_list const&) (dispatch.cc:273) ==30346== by 0x7F6AFD8: octave_dispatch::subsref(std::string const&, std::list<octave_value_list, std::allocator<octave_value_list> > const&, int) (dispatch.cc:144) ==30346== by 0x43D70E5: octave_value::subsref(std::string const&, std::list<octave_value_list, std::allocator<octave_value_list> > const&, int) (ov.cc:734) ==30346== by 0x451E993: tree_index_expression::rvalue(int) (pt-idx.cc:352) ==30346== by 0x453BBC4: tree_statement::eval(bool, int, bool) (pt-stmt.cc:133) ==30346== by 0x453C044: tree_statement_list::eval(bool, int) (pt-stmt.cc:190)
==30346==    by 0x4339E71: main_loop() (toplev.cc:225)
==30346==    by 0x42C1F38: octave_main (octave.cc:766)
==30346==    by 0x8048657: main (main.c:36)
==30346==  Address 0x4 is not stack'd, malloc'd or (recently) free'd
panic: Segmentation fault -- stopping myself...
attempting to save variables to `octave-core'...
save to `octave-core' complete
==30346==
==30346== ERROR SUMMARY: 20 errors from 8 contexts (suppressed: 43 from 1)
==30346== malloc/free: in use at exit: 18,334,274 bytes in 76,922 blocks.
==30346== malloc/free: 1,004,361 allocs, 927,439 frees, 49,763,244 bytes allocated.
==30346== For counts of detected errors, rerun with: -v
==30346== searching for pointers to 76,922 not-freed blocks.
==30346== checked 4,361,396 bytes.
==30346==
==30346== LEAK SUMMARY:
==30346==    definitely lost: 1,411 bytes in 79 blocks.
==30346==      possibly lost: 1,537,744 bytes in 3,877 blocks.
==30346==    still reachable: 16,795,119 bytes in 72,966 blocks.
==30346==         suppressed: 0 bytes in 0 blocks.
==30346== Use --leak-check=full to see details of leaked memory.
Segmentation fault

--
"My favorite weapon is the look in your eyes."  -- Ministry



reply via email to

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