bugGNU Octave - Bugs: bug #33652, tmpfile () does not work on MinGW

 
 

bug #33652: tmpfile () does not work on MinGW

Submitted by:  Tatsuro MATSUOKA <tmacchant>
Submitted on:  Sun 26 Jun 2011 10:10:16 PM UTC  
 
Category: InterpreterSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: None
Originator Name: Open/Closed: Closed
Release: devOperating System: Microsoft Windows

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Wed 29 Jun 2011 08:37:29 AM UTC, comment #8:

>copy the gnulib directory from the development sources to your 3.4.2 directory tree.
>Run autogen.sh --force


Worked! Thanks!

Tatsuro MATSUOKA <tmacchant>
Wed 29 Jun 2011 03:47:33 AM UTC, comment #7:

I checked in the changeset on the stable branch.

If you want to get the fix with a 3.4.x tarfile distribution, you can try the following:

copy the gnulib directory from the development sources to your 3.4.2 directory tree.

Run autogen.sh --force

Then you can run configure and make as you normally do.

I'm not sure this procedure will always work properly, but I think it will in this case.

John W. Eaton <jwe>
Project Administrator
Wed 29 Jun 2011 12:27:35 AM UTC, comment #6:

Hello John
I have attached your patch to the development source.

The result is

octave.exe:1> tmpfile()
ans = 3

and test for 'pr-output.cc' was successful.

Please push the patch to the development source.

BTW, if possible, please tell me the way to this for 3.2.4 source.
Change in src/file-io.cc is easy but I cannot find out how to change gnulib related tmpfile.

1. copy libgnu/tmpfile from created in dev-source tree to
octave-3.4 2 libgnu directory.

2. modify bootstrap.conf (add 'tmpfile')
3. execute autogen.sh at 3.4.2 source root directory.

Am I right?

Tatsuro MATSUOKA <tmacchant>
Tue 28 Jun 2011 02:31:46 AM UTC, comment #5:

Oops, I think my first attempt at a patch was incomplete. Try the changeset in diffs-2.txt instead.

(file #23578)

John W. Eaton <jwe>
Project Administrator
Tue 28 Jun 2011 02:12:07 AM UTC, comment #4:

Looking here:

http://msdn.microsoft.com/en-us/library/x8x7sakw%28v=vs.80%29.aspx

I see

Do you have permission to write in the "root directory"?

Also, why isn't the tmpfile function from gnulib being used? There seems to be a version there for Windows, so I'm surprised that it is not used.

Hmm, maybe it is because we aren't asking for it. Can you please try the attached changeset and see if it helps? You'll need to run autogen and configure again after applying it

(file #23577)

John W. Eaton <jwe>
Project Administrator
Tue 28 Jun 2011 01:28:25 AM UTC, comment #3:

>>Can you run Octave with gdb and set a breakpoint in the gnulib tmpfile function and find out why it is failing for you?


Results are

$ ./run-octave -g

<snip>

(gdb) break tmpfile
Function "tmpfile" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (tmpfile) pending.

<snip>

(gdb) run

<snip>

<snip>

octave.exe:1> tmpfile()

octave.exe:1> tmpfile()

Breakpoint 1, 0x662ac2b8 in tmpfile () from e:\usr\Tatsu\mingwhome\octaves\OctBuild\octave-3.4.2\src\.libs\liboctinterp-0.dll
(gdb) step
Single stepping until exit from function tmpfile,
which has no line number information.
0x77339581 in tmpfile () from C:\Windows\syswow64\msvcrt.dll
(gdb) step
Single stepping until exit from function tmpfile,
which has no line number information.
0x77339340 in tmpnam () from C:\Windows\syswow64\msvcrt.dll
(gdb) step
Single stepping until exit from function tmpnam,
which has no line number information.
ans = -1

***********************

This error might be win64 specific. (While gcc-4.5.2 is 32bit compiler).

I will work another machine. (Win XP 32 bit)

I will

Tatsuro MATSUOKA <tmacchant>
Mon 27 Jun 2011 05:36:19 PM UTC, comment #2:

Looking at the tmpfile function in file-io.cc, it just calls

to do the real work, and that is a function that on Windows systems you should be getting from gnulib. Can you run Octave with gdb and set a breakpoint in the gnulib tmpfile function and find out why it is failing for you?

John W. Eaton <jwe>
Project Administrator
Sun 26 Jun 2011 10:17:31 PM UTC, comment #1:

I have tested further.

*********************************
octave:3> [FID, MSG] = tmpfile ()
FID = -1
MSG = Permission denied
*********************************

My environments is windows 7 Home Premium 64 bit.

Tatsuro MATSUOKA <tmacchant>
Sun 26 Jun 2011 10:10:16 PM UTC, original submission:

Hello

In the 'make check' test, the below occurred.
pr-output.cc PASS 0/1 FAIL 1

>>>>> pr-output.cc

***** test
format short
fd = tmpfile ();
for r = [0, Inf -Inf, NaN]
for i = [0, Inf -Inf, NaN]
fdisp (fd, complex (r, i));
endfor
endfor
fclose (fd);
!!!!! test failed
fdisp: invalid stream number = -1

I have execute
*********************************
octave.exe:1> fd = tmpfile ()
fd = -1
octave.exe:2> fdisp(fd,1)
error: fdisp: invalid stream number = -1
**********************************

This happens octave-dev source on 201-06-24 and 3.2.4rc2.

Tatsuro MATSUOKA <tmacchant>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #23578:  diffs-2.txt added by jwe (797B - text/plain)
file #23577:  diffs.txt added by jwe (525B - text/plain)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jwe (Posted a comment)
  • -unavailable- added by tmacchant (Submitted the item)
  • -unavailable- added by tmacchant
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 29 Jun 2011 03:47:33 AM UTCjweStatusNeed Info=>Fixed
      Open/ClosedOpen=>Closed
    Tue 28 Jun 2011 02:31:46 AM UTCjweAttached File-=>Added diffs-2.txt, #23578
    Tue 28 Jun 2011 02:12:07 AM UTCjweAttached File-=>Added diffs.txt, #23577
    Mon 27 Jun 2011 05:36:31 PM UTCjweStatusNone=>Need Info
    Sun 26 Jun 2011 10:10:16 PM UTCtmacchantCarbon-Copy-=>Added -unavailable-

    Back to the top


    Powered by Savane 3.1-cleanup1