help-octave
[Top][All Lists]
Advanced

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

Re: problem loading wisdom file w/ 2.9.4 (FC5 rpm)


From: David Bateman
Subject: Re: problem loading wisdom file w/ 2.9.4 (FC5 rpm)
Date: Thu, 30 Mar 2006 14:01:17 +0200
User-agent: Mozilla Thunderbird 1.0.6-7.5.20060mdk (X11/20050322)

Dmitri A. Sergatskov wrote:

>There are some problems with loading fftw wisdom file in octave 2.9.4
>(using Fedora Core 5 rpm).
>
>File wisdom.i created as fftw_wisdom -c -i -o wisdom.i
>"junk" is a non-existing file.
>  
>
I presume thats fftw-wisdom..

>address@hidden wisdom]$ ls -l /home/dima/src/wisdom/wisdom.i
>-rw-rw-r-- 1 dima dima 137187 Mar 29 12:12 /home/dima/src/wisdom/wisdom.i
>
>address@hidden ~]$ octave
>GNU Octave, version 2.9.4 (x86_64-unknown-linux-gnu).
>Copyright (C) 2005 John W. Eaton.
>...<snip>...
>octave:1> fftw_wisdom ("/home/dima/src/wisdom/wisdom.i")
>error: fftw_wisdom: can not import wisdom from file
>  
>

I don't get this behaviour and can correctly import an existing wisdom file.

>octave:1> fftw_wisdom ("/home/dima/src/wisdom/junk")
>panic: Segmentation fault -- stopping myself...
>attempting to save variables to `octave-core'...
>save to `octave-core' complete
>Segmentation fault
>  
>
I do however get this behaviour, and running in gdb and valgrind seems
to indicate that the seg-fault is happening within FFTW itself.
When the file doesn't exist an attempt is made to save the wisdom in
octave itself to this filename. Unfortunately there is a bug in
fftw_wisdom.cc where it attempts to open a filename of the empty string.
I believe the attached patch should fix this, but can't check as I've
left my octave tree in a mess last night and can't easily do a build
till I fix it..

Cheers
David

2006-03-30  David Bateman  <address@hidden>

    * DLD-FUNCTIONS/fftw_wisdom.cc: Don't attempt to save wisdom to
    an empty filename or invalid filename.


-- 
David Bateman                                address@hidden
Motorola Labs - Paris                        +33 1 69 35 48 04 (Ph) 
Parc Les Algorithmes, Commune de St Aubin    +33 6 72 01 06 33 (Mob) 
91193 Gif-Sur-Yvette FRANCE                  +33 1 69 35 77 01 (Fax) 

The information contained in this communication has been classified as: 

[x] General Business Information 
[ ] Motorola Internal Use Only 
[ ] Motorola Confidential Proprietary

*** src/DLD-FUNCTIONS/fftw_wisdom.cc.~1.7.~     2006-03-07 21:42:49.000000000 
+0100
--- src/DLD-FUNCTIONS/fftw_wisdom.cc    2006-03-30 14:00:21.136292006 +0200
***************
*** 108,125 ****
            overwrite = true;
        }
  
        std::string wisdom = octave_env::make_absolute
!       (Vload_path_dir_path.find_first_of (args(0).string_value ()),
!        octave_env::getcwd ());
  
        // XXX FIXME XXX -- should probably protect FILE* resources with
        // auto_ptr or similar...
  
        if (wisdom.empty () || overwrite)
        {
!         FILE *ofile = fopen (wisdom.c_str (), "wb");
!         fftw_export_wisdom_to_file (ofile);
!         fclose (ofile);
        }
        else
        {
--- 108,135 ----
            overwrite = true;
        }
  
+       std::string str = args(0).string_value ();
        std::string wisdom = octave_env::make_absolute
!       (Vload_path_dir_path.find_first_of (str), octave_env::getcwd ());
  
        // XXX FIXME XXX -- should probably protect FILE* resources with
        // auto_ptr or similar...
  
        if (wisdom.empty () || overwrite)
        {
!         if (str.empty ())
!           error ("fftw_wisdom: can not save to file");
!         else
!           {
!             FILE *ofile = fopen (str.c_str (), "wb");
!             if (! FILE)
!               error ("fftw_wisdom: can not save to file %s", str.c_str());
!             else
!               {
!                 fftw_export_wisdom_to_file (ofile);
!                 fclose (ofile);
!               }
!           }
        }
        else
        {

reply via email to

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