2019-08-25 06:01 AEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0000269mercuryBugpublic2012-12-07 14:24
Reportergloomdemon 
Assigned Towangp 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformwindowsOSwindows 32/64OS Versionany
Product Version 
Target VersionFixed in Version 
Summary0000269: unicode path handling in dir module
Descriptiondir.recursive_foldl2 failed on directory with unicode name QQ菜单

Uncaught Mercury exception:
Software Error: string.unsafe_index: illegal sequence
Stack dump not available in this grade.

This problem is possible in dir.make_path_name function with incorrect work of function string.length or string.unsafe_index
Steps To Reproduceunpack utf_dir_small.rar with rar, compile and run 'bugu' program in dir with 'yjkj' directory
Additional Information
:- module bugu.
:- interface.

:- import_module io.

:- pred main(io::di, io::uo) is det.

:- implementation.

:- import_module require, dir, list, bool.

main(!IO) :-
    Ps = (
        pred(DN::in, BN::in, FT::in, C::out, Di::in, Do::out, !.IO::di, !:IO::uo) is det :-
            C = yes,
            io.write_strings([DN, " ", BN, "\n"], !IO),
            Do = Di
    ),
    dir.recursive_foldl2(Ps, ".", no, [], MaybeResult, !IO),
    (
        MaybeResult = error(_, Err),
        error(io.error_message(Err)) % exception
    ;
        MaybeResult = ok(_)
    ).
TagsNo tags attached.
Attached Files

-Relationships
+Relationships

-Notes

~0000482

gloomdemon (reporter)

compilers versions:

$ mmc --version
Mercury Compiler, version rotd-2012-02-17, configured for i686-pc-mingw32
Copyright (C) 1993-2012 The University of Melbourne

$ gcc --version
gcc.exe (GCC) 4.6.1
Copyright (C) 2011 Free Software Foundation, Inc.

~0000483

wangp (developer)

Thanks, fixed committed.
+Notes

-Issue History
Date Modified Username Field Change
2012-12-07 06:27 gloomdemon New Issue
2012-12-07 06:27 gloomdemon File Added: utf_dir_small.rar
2012-12-07 06:35 gloomdemon Note Added: 0000482
2012-12-07 10:33 wangp Assigned To => wangp
2012-12-07 10:33 wangp Status new => assigned
2012-12-07 14:23 wangp Note Added: 0000483
2012-12-07 14:24 wangp Status assigned => resolved
2012-12-07 14:24 wangp Resolution open => fixed
+Issue History