bugGNU Octave - Bugs: bug #54398, Windows: dev Octave opens file in...

 
 

bug #54398: Windows: dev Octave opens file in GUI editor multiple times when debugging

Submitter:  Philip Nienhuis <philipnienhuis>
Submitted:  Fri 27 Jul 2018 10:08:46 PM UTC
   
 
Category:  GUI Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Philip Nienhuis Open/Closed:  * Closed
Release:  * dev Operating System:  * Microsoft Windows
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Wed 01 Aug 2018 06:20:37 PM UTC, comment #25: 

Thanks Markus

Philip Nienhuis <philipnienhuis>
Group Member
Wed 01 Aug 2018 05:36:16 PM UTC, comment #24: 

I pushed the patch here:
http://hg.savannah.gnu.org/hgweb/octave/rev/ad0b4817c09d

Closing as fixed.

Markus Mützel <mmuetzel>
Group administrator
Wed 01 Aug 2018 04:57:22 PM UTC, comment #23: 

reopening, I still can't push, hopefully another dev can

Philip Nienhuis <philipnienhuis>
Group Member
Tue 31 Jul 2018 07:30:49 PM UTC, comment #22: 

I've rebuilt a nsis-installer and now that works fine.

Closing report.

@Markus, would you please push? My .hg setup got issues.

Philip Nienhuis <philipnienhuis>
Group Member
Tue 31 Jul 2018 03:51:54 PM UTC, comment #21: 

That's exactly what I did and 7-unzipped it works OK.
But I want to know what is happening. The built Octave modules (.exe and .dll) are exactly the same, installed through the NSIS installer and unpacked through 7zip.

This doesn't look related to the bug you fixed but I'd like to be sure.

Philip Nienhuis <philipnienhuis>
Group Member
Tue 31 Jul 2018 10:37:28 AM UTC, comment #20: 

I usually never build the installer but unpack a 7z-dist.
I'll try if I can see any difference when using the installer.

Markus Mützel <mmuetzel>
Group administrator
Mon 30 Jul 2018 09:46:13 PM UTC, comment #19: 

Hmmm, I got some interesting outcome here.

Running the crossbuilt octave directly from the Linux $HOME/.../dist/octave directory, all works well.
But running the installed (on Windows 7) binary, I see the same issues.

I'm out of time for tonight, tomorrow night I'll check some more.

Philip Nienhuis <philipnienhuis>
Group Member
Mon 30 Jul 2018 07:43:55 PM UTC, comment #18: 

@Markus:
That fixes it. Thanks very much.
Reading the patch it's a bit of black magic to me :-) but it works. The COM error is also fixed, nice!

I'll try to make a complete crossbuild now with all my local mods; if that also works fine I'll push and close the bug, OK?

Then:
MXE completed compilation over night.
In return a hint for you, or maybe you already do it:

Im my mxe-octave setups the pkg/ subdir is really a symlink to a pkg subdir outside mxe. In that downloaded-package subdir, octave-5.0.0.tar.lz is again a symlink to the .lz dist archive in Octave's native build dir (on Linux).
I refresh (re-clone and configure) my mxe-octave about every 2 months and hg pull/ && hg update it about every other week.

That way, when I want to build a new installer, I only have to build the dist archive on the Linux side and then, in mxe-octave, just run:
rm -f installed-packages/default-octave && make nsis-installer JOBS=5

That way, cross-building a complete octave setup (in dist/octave/) just takes 20 minutes, generating the installer another 10 minutes (I usually interrupt it when it says "generating installer").

On the Windows side I have read-only access to my Linux $HOME dir using ext2fsd and I can run Octave directly from the mxe-octave/dist/octave subdir.
(BTW to that end I renamed the dist/octave/ subdir in binary-dist-rules.mk by eliminating the date/time suffix cruft.)

All in all generating a new crossbuild just for testing only takes me 20 minutes excl. the Linux rebuild time + reboot time.

ATM I'm busy setting up a Win10 test environment in VirtualBox. MS offers free time-bombed Win10 builds for trying MS-Edge in a.o., VirtualBox, and that runs fine on Linux as well. In Windows 7 I have such a test Win10 running in VB and through shared folders + the ex2fsd setup on Win7 I can run the Octave cross-build on the Linux side as well - no need to install Octave in the Win10 guest OS.
On Linux I'm just stuck setting up shared folders (no time/priority now to investigate), but once there I don't even have to reboot into Windows anymore to test crossbuilds. (Except for Win7-specific issues like the one here).

Philip Nienhuis <philipnienhuis>
Group Member
Mon 30 Jul 2018 04:32:45 AM UTC, comment #17: 

MXE completed compilation over night.

Can you try with the attached changeset whether the issues still occur?

(file #44656)

Markus Mützel <mmuetzel>
Group administrator
Sun 29 Jul 2018 06:17:04 PM UTC, comment #16: 

Markus, if still helpful: The comparison between the file that should be opened and already existing editor tabs is done in


QWidget * file_editor::find_tab_widget (const QString& file)


by means of the function


same_file ()


Torsten Lilge <ttl>
Group Member
Sun 29 Jul 2018 11:09:08 AM UTC, comment #15: 

I have an idea what might be wrong. That could be the same lifetime issue that caused bug #54299.
Will post a changeset as soon as I know it compiles and doesn't break anything else.

Markus Mützel <mmuetzel>
Group administrator
Sun 29 Jul 2018 11:04:32 AM UTC, comment #14: 

Just FTR, this cset is also the one that breaks some functionality of the OF windows package:

io_xls_testscript ("com", "io-tst.xlsx')

(a command that invokes MS-Excel behind the scenes)

leads to a crash of Octave at step 3 of this test script.

I cannot track it down but there may be code inside the _COM_.cc of _COM_.h files (windows package) that directly or ultimately calls functions in the sysdep module.

Philip Nienhuis <philipnienhuis>
Group Member
Sun 29 Jul 2018 10:49:26 AM UTC, comment #13: 

OK, found it.
cset 197126863d95 "sysdep.cc: Use wide character versions of Windows API functions (bug #49118)." from Sat, 30 Jun 2018 is the cset that causes this bug.

Philip Nienhuis <philipnienhuis>
Group Member
Sun 29 Jul 2018 10:24:46 AM UTC, comment #12: 

I don't have any computer running Windows 7. So it will be difficult for me to debug. Unless we can pinpoint to an exact changeset and there is something obvious.

At around the same time window we updated the Qt5 version in MXE Octave. Maybe that could also be a candidate to look at. (Just a wild guess.)

@Torsten: Where exactly in the code occurs the comparison between paths with forward and backward slashes. Maybe we can track backward from there which functions are involved in generating and passing the path...

Markus Mützel <mmuetzel>
Group administrator
Sat 28 Jul 2018 10:09:23 PM UTC, comment #11: 

Remarkable - on Windows 10 a build from July 17 works fine, while that same build doesn't work (has this bug, plus the COM one I mentioned in comment #3) on Windows 7.

Go figure ... it seems M$ pulled another trick here.

Philip Nienhuis <philipnienhuis>
Group Member
Sat 28 Jul 2018 09:56:01 PM UTC, comment #10: 

Markus:
I'll try (to try) building revisions before and with 7fb40efda31f somewhere tomorrow, weekend leisure activities permitting :-)
As it is from soon after the last 'working' build I have it sure looks like a candidate (see comment #4).

With today's up-to-date build (rev. 038fb01854a0 ) I see forward slashes in the editor tabs.

BTW how can I search in the log for those hash revision numbers (on http://hg.savannah.gnu.org/hgweb/octave I mean) so that they show up in a time line?
As those hashes are meaningless on purpose I have a hard time finding in the log when those csets were pushed relative to others.

And I'll try Windows 10 - only if the bug doesn't show up there I'll post again tonight.

Philip Nienhuis <philipnienhuis>
Group Member
Sat 28 Jul 2018 09:27:16 PM UTC, comment #9: 

Hg id 7fb40efda31f (2018-06-27) changed to the Unicode WinAPI for querying the current directory.
@Philip or Torsten: Could you try whether you see the issue already with this revision?

Markus Mützel <mmuetzel>
Group administrator
Sat 28 Jul 2018 09:08:20 PM UTC, comment #8: 

During debugging, I get backward slashes "\" for "dbstack".

Markus Mützel <mmuetzel>
Group administrator
Sat 28 Jul 2018 09:05:51 PM UTC, comment #7: 

The tooltip on the tabs show forward slashes ('/') for me.

Markus Mützel <mmuetzel>
Group administrator
Sat 28 Jul 2018 08:58:55 PM UTC, comment #6: 

I was able to reproduce the issue on Windows 7.

Markus and Philip, what are you seeing in the editor tabs: "/" or "\" as path seperator?

Torsten Lilge <ttl>
Group Member
Sat 28 Jul 2018 08:48:13 PM UTC, comment #5: 

I can't reproduce the issue with a cross-build from 2018-07-26 (hg id 4596a80cbc18). That is after the date Philip pointed out.

I tried the procedure from comment #0 both with a function and with a script file in case that would make any difference.

Do you have further clues that might help me reproduce the issue? Since I can't reproduce, I also cannot help pinpoint the changeset.

I am using Windows 10 1804 with 64bit Octave if that should matter.

Markus Mützel <mmuetzel>
Group administrator
Sat 28 Jul 2018 08:08:24 PM UTC, comment #4: 

Candidate csets, from perusing the log:

7fb40efda31f  Use wide character Windows API for operations on folders (bug #49118). (M Muetzel)

8945a6a6c0eb  Add Unicode support for getting directory listing in Windows (bug #49118). (M Muetzel)  (I see a mention of "directory_path::path_sep_str ()" in that cset)

7fbc39a46be8  Add wrapper to fopen for files with non-ASCII chars in path on Windows (bug #49118).  (M Muetzel)

+ a lot more by Markus Mützel. I'll cc him anyway, maybe he has a clue.




Philip Nienhuis <philipnienhuis>
Group Member
Sat 28 Jul 2018 07:56:10 PM UTC, comment #3: 

I've tried a few cross-build installers I keep archived.

The last one that works OK is from June 27. After that I went on vacation, the first build after that, from July 8, has the bug.

My Windows crossbuilds always have the latest fixes for the dates mentioned (say ~noon US time), so that gives a time bracket on where to search for the offending cset.

[OT} maybe coincidence, who knows, but I also see a crash with the of-windows package when trying to invoke Excel; that issue must have popped up in the same period.

status -> confirmed as per comment #1

Philip Nienhuis <philipnienhuis>
Group Member
Sat 28 Jul 2018 05:19:45 PM UTC, comment #2: 

thanks, that explains why I didn't see it on Linux.

Between the scenes I was backtracking which cset(s) could be the cause (loosely doing "hg update -r <some older revision)>".

Result until now: it must be from before "Accept case insensitive second argument to typecast for Matlab compatibility (bug #54313)" by Rik on July 14. But it just occurred to me that I think I saw this in a build from early July, maybe even from before June 27.

Philip Nienhuis <philipnienhuis>
Group Member
Sat 28 Jul 2018 05:00:40 PM UTC, comment #1: 

Confirmed. The file name that should be opened is passed to the editor with "\" in the path. The internal names of already opened files (also the titles in the tab bars) always us "/" as path separator.

I do not know the cause for the different path separator strings, which most probably also prevent octave from finding the file in the current path. I am not aware of changes in the gui, were there any related changes in the way octave is handling file paths on windows?

Torsten Lilge <ttl>
Group Member
Fri 27 Jul 2018 10:08:46 PM UTC, original submission:  

Steps to reproduce;

  • start Octave (GUI)


  • open an .m file in the GUI editor from the current directory


  • add a breakpoint by clicking left of a line number. ==> Octave asks to add the directory to the load path (wrong IMO as it is "." which should be in the load path)


  • When stepping to the file, after each debug step a new file tab is opened with the same file.


Philip Nienhuis <philipnienhuis>
Group Member

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #44656:  bug54398_cstr_lifetime.patch added by mmuetzel (1KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mmuetzel (Posted a comment)
  • -email is unavailable- added by philipnienhuis
  • -email is unavailable- added by ttl (Posted a comment)
  • -email is unavailable- added by philipnienhuis (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 10 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-08-01 mmuetzel StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2018-08-01 philipnienhuis StatusFixed Ready For Test
        Open/ClosedClosed Open
    2018-07-31 philipnienhuis StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2018-07-30 philipnienhuis StatusConfirmed Ready For Test
    2018-07-30 mmuetzel Attached File- Added bug54398_cstr_lifetime.patch, #44656
    2018-07-28 philipnienhuis Carbon-Copy- Added mmuetzel
    2018-07-28 philipnienhuis StatusNone Confirmed

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code