bugGNU Octave - Bugs: bug #33669, Test of get_first_help_sentence...

 
 

bug #33669: Test of get_first_help_sentence fails on MinGW

Submitted by:  Tatsuro MATSUOKA <tmacchant>
Submitted on:  Wed 29 Jun 2011 03:12:49 AM UTC  
 
Category: InterpreterSeverity: 5 - Blocker
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 30 Nov 2011 12:07:09 AM UTC, comment #19:

With the latest dev. source (after cb15c5185b6a ),

octave:1> test get_first_help_sentence
PASSES 7 out of 7 tests

The problem is now fixed so that this post can be closed.

Tatsuro MATSUOKA <tmacchant>
Tue 29 Nov 2011 09:48:09 AM UTC, comment #18:

I checked in the following change:

http://hg.savannah.gnu.org/hgweb/octave/rev/cb15c5185b6a

It seems to fix the problem for me with Octave cross-compiled for Windows using MinGW and tested with a copy of Windows 7 running in a virtual machine. Let me know if the problem is not fixed for you.

John W. Eaton <jwe>
Project Administrator
Mon 28 Nov 2011 11:32:52 PM UTC, comment #17:

I have attached the patch (file #24480)

scripts\help\get_first_help_sentence.m ................. PASS 6/7 FAIL 1

The situation is the same as that when the previous patch (file #24431) is applied.

Tatsuro MATSUOKA <tmacchant>
Mon 28 Nov 2011 08:31:37 AM UTC, comment #16:

OK, I'm attaching another patch, this time using mkostemp so that the mkstemp function can open files in binary mode. Does this work?

(file #24480)

John W. Eaton <jwe>
Project Administrator
Mon 28 Nov 2011 06:02:01 AM UTC, comment #15:

Perhaps fdopen is not able to rebind a file from text mode to binary mode? Some googling of the question didn't help much. All of the documentation I can find says only that the mode in fdopen must be consistent with the mode used to open the original file. So, if the original file was opened with append you can't rebind to just 'w'.

So, unfortunately the situation is back to using a hack in the .m file or integrating mkostemp from gnulib.

Rik <rik5>
Project Administrator
Thu 24 Nov 2011 04:39:16 AM UTC, comment #14:

I have attached the patch (file #24431)

The result is
scripts\help\get_first_help_sentence.m ................. PASS 6/7 FAIL 1

Tatsuro MATSUOKA <tmacchant>
Wed 23 Nov 2011 06:56:42 AM UTC, comment #13:

Looking at this now, I don't think we need to use mkostemp. How about the attached change? Does it solve the problem? It simply adds "b" to the mode argument of the call to fdopen in the mkstemp function in file-io.cc.

(file #24431)

John W. Eaton <jwe>
Project Administrator
Wed 23 Nov 2011 04:41:51 AM UTC, comment #12:

Upgrading to blocker for 3.6.0 release. Either the submitted patch should be applied or mkostemp should be used. In either case this bug should be resolved and closed.

Rik <rik5>
Project Administrator
Tue 04 Oct 2011 04:06:25 AM UTC, comment #11:

I think I'd rather extend mkstemp to accept options, probably by using mkostemp internally. Let me see if I can do that quickly. If not, then I'll apply the other patch.

John W. Eaton <jwe>
Project Administrator
Tue 04 Oct 2011 03:58:28 AM UTC, comment #10:

It is natural the patch by Rik (file #24074) works for me.

Tatsuro MATSUOKA <tmacchant>
Sun 02 Oct 2011 06:07:27 AM UTC, comment #9:

John,

I amended your patch so that it only applies to Windows systems and the other operating systems get to use a real mkstemp. If you think it is fine then please commit it.

(file #24074)

Rik <rik5>
Project Administrator
Wed 29 Jun 2011 09:31:20 PM UTC, comment #8:

I applied your patch.

Problem seems to be fixed.

Thanks!

Please pushed patch to both the stable and development brances.

Tatsuro MATSUOKA <tmacchant>
Wed 29 Jun 2011 03:13:08 PM UTC, comment #7:

Does the change attached in diffs-2.txt fix the problem for you?

I don't think this is the best fix, but if it works, I think I understand the problem, which is that mkstemp uses text mode to open files by default. I guess we need to use mkostemp instead and specify the mode as binary. But Octave doesn't currently have a binding for mkostemp.

(file #23587)

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

>If you apply the attached patch, what is the output from running
>on your system?


Tatsuro MATSUOKA <tmacchant>
Wed 29 Jun 2011 04:51:27 AM UTC, comment #5:

That looks normal, with no CR characters. So how do they get added?

If you apply the attached patch, what is the output from running

on your system?

(file #23586)

John W. Eaton <jwe>
Project Administrator
Wed 29 Jun 2011 04:42:40 AM UTC, comment #4:

>What is the output of
>[ht, fmt] = get_help_text ('get_first_help_sentence');
>toascii (ht(1:250))
>on your system?


The result is

Tatsuro MATSUOKA <tmacchant>
Wed 29 Jun 2011 04:26:10 AM UTC, comment #3:

OK, so the first six characters are a combination of CR and SPC, so I guess we are not handling CR somewhere that we should. I tried adding CR to the ends of the lines of a function file on my system but I don't see this result.

What is the output of

on your system?

John W. Eaton <jwe>
Project Administrator
Wed 29 Jun 2011 04:12:56 AM UTC, comment #2:

Thanks for your reply.

>It looks like you have some extra space at the beginning of the line.
>What is the output of
>toascii (get_first_help_sentence ('get_first_help_sentence'))
>on your system?


The below is the result

Tatsuro MATSUOKA <tmacchant>
Wed 29 Jun 2011 03:52:12 AM UTC, comment #1:

It looks like you have some extra space at the beginning of the line.

What is the output of

on your system?

John W. Eaton <jwe>
Project Administrator
Wed 29 Jun 2011 03:12:49 AM UTC, original submission:

Test of get_first_help_sentence fails on MinGW.

get_first_help_sentence('get_first_help_sentence') seems not to return simple strings. Am I right?

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 #24480:  diffs-4.txt added by jwe (2KiB - text/plain)
file #24431:  diffs-3.txt added by jwe (304B - text/plain)
file #24074:  firsthelp.patch added by rik5 (1KiB - text/x-diff)
file #23587:  diffs-2.txt added by jwe (468B - text/plain)
file #23586:  diffs.txt added by jwe (556B - text/plain)

 

Depends on the following items: None found

Digest:
   bug dependencies.

 

Carbon-Copy List
  • -unavailable- added by rik5 (Updated the item)
  • -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 12 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 29 Nov 2011 09:48:09 AM UTCjweStatusPatch Submitted=>Fixed
      Open/ClosedOpen=>Closed
    Mon 28 Nov 2011 08:31:37 AM UTCjweAttached File-=>Added diffs-4.txt, #24480
    Wed 23 Nov 2011 06:56:42 AM UTCjweAttached File-=>Added diffs-3.txt, #24431
    Wed 23 Nov 2011 04:41:51 AM UTCrik5Severity3 - Normal=>5 - Blocker
    Mon 03 Oct 2011 10:18:20 PM UTCrik5Dependencies-=>bugs #34280 is dependent
    Sun 02 Oct 2011 06:07:27 AM UTCrik5Attached File-=>Added firsthelp.patch, #24074
      StatusNeed Info=>Patch Submitted
    Wed 29 Jun 2011 03:13:07 PM UTCjweAttached File-=>Added diffs-2.txt, #23587
    Wed 29 Jun 2011 04:51:27 AM UTCjweAttached File-=>Added diffs.txt, #23586
    Wed 29 Jun 2011 03:52:12 AM UTCjweStatusNone=>Need Info
    Wed 29 Jun 2011 03:12:49 AM UTCtmacchantCarbon-Copy-=>Added "benjamin lindner"

    Back to the top


    Powered by Savane 3.1-cleanup1