WerWolv / ImHex

🔍 A Hex Editor for Reverse Engineers, Programmers and people who value their retinas when working at 3 AM.
https://imhex.werwolv.net
GNU General Public License v2.0
42.45k stars 1.87k forks source link

[Bug] Crash when filename contains too many non-ASCII characters #1028

Open scientificworld opened 1 year ago

scientificworld commented 1 year ago

Operating System

MacOS

What's the issue you encountered?

When filename contains too many non-ASCII characters, the program will trigger a SIGSEGV and crash.

How can the issue be reproduced?

Create a file with many non-ASCII characters in its name, e.g. ののののののののののの

ImHex Version

1.28.0

ImHex Build Type

Installation type

Homebrew Cask

Additional context?

No response

Calcoph commented 3 months ago

Cannot reproduce this issue on windows.

imhex 1.33.0 a7033b6

scientificworld commented 3 months ago

Cannot reproduce this issue on windows.

imhex 1.33.0 a7033b6

I just tried to open the file in GUI, and it didn't crash.

But when I try to pass the file as argument on command line, it still crashes.

Stack trace:

[10:55:54] [FATAL] [main | Main]               ImHex crashed during initial setup!
Error: Received signal 'SIGSEGV' (11)
[10:55:55] [FATAL] [main | Main]                 0   imhex                               0x000000010464b4ac _ZN3hex10stacktrace13getStackTraceEv + 64
[10:55:55] [FATAL] [main | Main]                 1   imhex                               0x00000001046433b8 _ZN3hex5crash11handleCrashERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE + 44
[10:55:55] [FATAL] [main | Main]                 2   imhex                               0x0000000104644524 _ZN3hex5crashL13signalHandlerEiRKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE + 232
[10:55:55] [FATAL] [main | Main]                 3   imhex                               0x000000010464441c _ZZN3hex5crash18setupCrashHandlersEvEN3$_08__invokeEi + 60
[10:55:55] [FATAL] [main | Main]                 4   libsystem_platform.dylib            0x000000018a24b4a4 _sigtramp + 56
[10:55:55] [FATAL] [main | Main]                 5   builtin.hexplug                     0x000000010d208ae8 _ZN3hex2ui10ToastErrorC2ENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE + 52
[10:55:55] [FATAL] [main | Main]                 6   builtin.hexplug                     0x000000010d2088cc _ZN3hex5ToastINS_2ui10ToastErrorEE4openIJNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEEEEEvDpOT_ + 80
[10:55:55] [FATAL] [main | Main]                 7   builtin.hexplug                     0x000000010d23f9c8 _ZN3hex6plugin7builtinL8openFileERKNSt3__14__fs10filesystem4pathE + 956
[10:55:55] [FATAL] [main | Main]                 8   imhex                               0x000000010465505c _ZNK3hex4impl5EventIJNSt3__14__fs10filesystem4pathEEEclENS2_17basic_string_viewIcNS2_11char_traitsIcEEEES5_ + 76
[10:55:55] [FATAL] [main | Main]                 9   imhex                               0x000000010466bd2c _ZN3hex12EventManager4postINS_15RequestOpenFileEJRNSt3__14__fs10filesystem4pathEEEEvDpOT0_ + 240
[10:55:55] [FATAL] [main | Main]                 10  imhex                               0x000000010466b784 _ZN3hex4init21handleFileOpenRequestEv + 40
[10:55:55] [FATAL] [main | Main]                 11  imhex                               0x000000010466bed0 _ZN3hex4init8runImHexEv + 296
[10:55:55] [FATAL] [main | Main]                 12  imhex                               0x000000010462f9d0 main + 408
[10:55:55] [FATAL] [main | Main]                 13  dyld                                0x00000001049cd08c start + 520

imhex 1.33.2 8802a8e