Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Crash when trying to import a modified file #2170

Open
1 task done
Civil opened this issue Mar 16, 2025 · 1 comment
Open
1 task done

[Bug] Crash when trying to import a modified file #2170

Civil opened this issue Mar 16, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@Civil
Copy link

Civil commented Mar 16, 2025

Operating System

MacOS

What's the issue you encountered?

When I was trying to import a modified file, ImHex crashed with following stack trace:

[01:27:37] [DEBUG] [main | Processing]         Event posted: 'hex::EventDataChanged'
[01:27:37] [DEBUG] [main | Processing]         Event posted: 'hex::EventProviderDataModified'
[01:27:37] [DEBUG] [main | Processing]         Event posted: 'hex::EventDataChanged'
[01:27:37] [DEBUG] [main | Processing]         Event posted: 'hex::EventProviderDataModified'
[01:27:37] [FATAL] [main | Main]               Received signal 'SIGSEGV' (11)
[01:27:37] [INFO]  [main | Main]               Wrote crash.json file to /Users/civil/Library/Application Support/imhex/config/crash.json
[01:27:37] [DEBUG] [main | Processing]         Event posted: 'hex::EventDataChanged'
[01:27:37] [FATAL] [main | Main]               Printing stacktrace using implementation 'execinfo'
[01:27:37] [FATAL] [main | Main]                 (imhex) | hex::stacktrace::getStackTrace()
[01:27:37] [FATAL] [main | Main]                 (imhex) | hex::crash::printStackTrace()
[01:27:37] [FATAL] [main | Main]                 (imhex) | hex::crash::handleCrash(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&)
[01:27:37] [FATAL] [main | Main]                 (imhex) | hex::crash::signalHandler(int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&)
[01:27:37] [FATAL] [main | Main]                 (imhex) | hex::crash::setupCrashHandlers()::$_0::operator()(int) const
[01:27:37] [FATAL] [main | Main]                 (imhex) | hex::crash::setupCrashHandlers()::$_0::__invoke(int)
[01:27:37] [FATAL] [main | Main]                 (libsystem_platform.dylib) | _sigtramp
[01:27:37] [FATAL] [main | Main]                 (builtin.hexplug) | hex::plugin::builtin::ViewPatches::ViewPatches()::$_3::operator()(unsigned long long, unsigned char const*, unsigned long, bool) const
[01:27:37] [FATAL] [main | Main]                 (builtin.hexplug) | decltype(std::declval<hex::plugin::builtin::ViewPatches::ViewPatches()::$_3&>()(std::declval<unsigned long long>(), std::declval<unsigned char const*>(), std::declval<unsigned long>(), std::declval<bool>())) std::__1::__invoke[abi:de190107]<hex::plugin::builtin::ViewPatches::ViewPatches()::$_3&, unsigned long long, unsigned char const*, unsigned long, bool>(hex::plugin::builtin::ViewPatches::ViewPatches()::$_3&, unsigned long long&&, unsigned char const*&&, unsigned long&&, bool&&)
[01:27:37] [FATAL] [main | Main]                 (builtin.hexplug) | std::__1::optional<unsigned int> std::__1::__invoke_void_return_wrapper<std::__1::optional<unsigned int>, false>::__call[abi:de190107]<hex::plugin::builtin::ViewPatches::ViewPatches()::$_3&, unsigned long long, unsigned char const*, unsigned long, bool>(hex::plugin::builtin::ViewPatches::ViewPatches()::$_3&, unsigned long long&&, unsigned char const*&&, unsigned long&&, bool&&)
[01:27:37] [FATAL] [main | Main]                 (builtin.hexplug) | std::__1::__function::__alloc_func<hex::plugin::builtin::ViewPatches::ViewPatches()::$_3, std::__1::allocator<hex::plugin::builtin::ViewPatches::ViewPatches()::$_3>, std::__1::optional<unsigned int> (unsigned long long, unsigned char const*, unsigned long, bool)>::operator()[abi:de190107](unsigned long long&&, unsigned char const*&&, unsigned long&&, bool&&)
[01:27:37] [FATAL] [main | Main]                 (builtin.hexplug) | std::__1::__function::__func<hex::plugin::builtin::ViewPatches::ViewPatches()::$_3, std::__1::allocator<hex::plugin::builtin::ViewPatches::ViewPatches()::$_3>, std::__1::optional<unsigned int> (unsigned long long, unsigned char const*, unsigned long, bool)>::operator()(unsigned long long&&, unsigned char const*&&, unsigned long&&, bool&&)
[01:27:37] [FATAL] [main | Main]                 (builtin.hexplug) | std::__1::__function::__value_func<std::__1::optional<unsigned int> (unsigned long long, unsigned char const*, unsigned long, bool)>::operator()[abi:de190107](unsigned long long&&, unsigned char const*&&, unsigned long&&, bool&&) const
[01:27:37] [FATAL] [main | Main]                 (builtin.hexplug) | std::__1::function<std::__1::optional<unsigned int> (unsigned long long, unsigned char const*, unsigned long, bool)>::operator()(unsigned long long, unsigned char const*, unsigned long, bool) const
[01:27:37] [FATAL] [main | Main]                 (builtin.hexplug) | hex::plugin::builtin::ViewHexEditor::ViewHexEditor()::$_1::operator()(unsigned long long, unsigned char const*, unsigned long) const
[01:27:37] [FATAL] [main | Main]                 (builtin.hexplug) | decltype(std::declval<hex::plugin::builtin::ViewHexEditor::ViewHexEditor()::$_1&>()(std::declval<unsigned long long>(), std::declval<unsigned char const*>(), std::declval<unsigned long>())) std::__1::__invoke[abi:de190107]<hex::plugin::builtin::ViewHexEditor::ViewHexEditor()::$_1&, unsigned long long, unsigned char const*, unsigned long>(hex::plugin::builtin::ViewHexEditor::ViewHexEditor()::$_1&, unsigned long long&&, unsigned char const*&&, unsigned long&&)
[01:27:37] [FATAL] [main | Main]                 (builtin.hexplug) | std::__1::optional<unsigned int> std::__1::__invoke_void_return_wrapper<std::__1::optional<unsigned int>, false>::__call[abi:de190107]<hex::plugin::builtin::ViewHexEditor::ViewHexEditor()::$_1&, unsigned long long, unsigned char const*, unsigned long>(hex::plugin::builtin::ViewHexEditor::ViewHexEditor()::$_1&, unsigned long long&&, unsigned char const*&&, unsigned long&&)
[01:27:37] [FATAL] [main | Main]                 (builtin.hexplug) | std::__1::__function::__alloc_func<hex::plugin::builtin::ViewHexEditor::ViewHexEditor()::$_1, std::__1::allocator<hex::plugin::builtin::ViewHexEditor::ViewHexEditor()::$_1>, std::__1::optional<unsigned int> (unsigned long long, unsigned char const*, unsigned long)>::operator()[abi:de190107](unsigned long long&&, unsigned char const*&&, unsigned long&&)
[01:27:37] [FATAL] [main | Main]                 (builtin.hexplug) | std::__1::__function::__func<hex::plugin::builtin::ViewHexEditor::ViewHexEditor()::$_1, std::__1::allocator<hex::plugin::builtin::ViewHexEditor::ViewHexEditor()::$_1>, std::__1::optional<unsigned int> (unsigned long long, unsigned char const*, unsigned long)>::operator()(unsigned long long&&, unsigned char const*&&, unsigned long&&)
[01:27:37] [FATAL] [main | Main]                 (ui.hexpluglib) | std::__1::__function::__value_func<std::__1::optional<unsigned int> (unsigned long long, unsigned char const*, unsigned long)>::operator()[abi:de190107](unsigned long long&&, unsigned char const*&&, unsigned long&&) const
[01:27:37] [FATAL] [main | Main]                 (ui.hexpluglib) | std::__1::function<std::__1::optional<unsigned int> (unsigned long long, unsigned char const*, unsigned long)>::operator()(unsigned long long, unsigned char const*, unsigned long) const
[01:27:37] [FATAL] [main | Main]                 (ui.hexpluglib) | hex::ui::HexEditor::drawEditor(ImVec2 const&)
[01:27:37] [FATAL] [main | Main]                 (ui.hexpluglib) | hex::ui::HexEditor::draw(float)
[01:27:37] [FATAL] [main | Main]                 (builtin.hexplug) | hex::plugin::builtin::ViewHexEditor::drawContent()
[01:27:37] [FATAL] [main | Main]                 (builtin.hexplug) | hex::View::Window::draw()
[01:27:37] [FATAL] [main | Main]                 (imhex) | hex::Window::frame()
[01:27:37] [FATAL] [main | Main]                 (imhex) | hex::Window::fullFrame()
[01:27:37] [FATAL] [main | Main]                 (imhex) | hex::Window::loop()
[01:27:37] [FATAL] [main | Main]                 (imhex) | hex::init::runImHex()
[01:27:37] [FATAL] [main | Main]                 (imhex) | main
[01:27:37] [FATAL] [main | Main]                 (dyld) | start
[01:27:37] [DEBUG] [main | Main]               Event posted: 'hex::EventAbnormalTermination'
[01:27:37] [DEBUG] [main | Processing]         Task 'hex.ui.common.processing' finished
[01:27:39] [DEBUG] [main | Main]               Event posted: 'hex::EventImHexClosing'
[01:27:39] [INFO]  [main | Main]               Exit task 'Prepare exit' finished successfully
[01:27:39] [INFO]  [main | Main]               Exit task 'Unloading plugins' finished successfully
[01:27:39] [INFO]  [main | Main]               Exit task 'Deleting old files' finished successfully
Trace/BPT trap: 5

Crash.json doesn't have anything useful (see attachment)

crash.json

How can the issue be reproduced?

(That is not exactly what I was trying to do, but a reliable way to reproduce the crash):

  1. Go to https://network.nvidia.com/support/firmware/bluefield2/
  2. Download any two firmware for similar products (I've used MBF2M345A-HECO and -HESO)
  3. Unzip them
  4. Open the first file
  5. Import the second file as a "modified version"

ImHex Version

1.38.0 WIP (c0a2226)

ImHex Build Type

  • Nightly or built from sources

Installation type

Latest release pkg, and built from source

Additional context?

In my case those are not the firmware I was trying to investigate, but it was also 32 MB in size with relatively small diff (O(100KB)).

Last working release for me is v1.36.2

I've tried to bisect the change, but there were other crashes with different stack traces, so I wasn't able to figure out exact commit within reasonable time. What I know, that 021206e was working, and I think 0dc1af0 was already crashing, but reverting it on master branch haven't fixed the issue.

@Civil Civil added the bug Something isn't working label Mar 16, 2025
@Civil
Copy link
Author

Civil commented Mar 16, 2025

And a small addition - 1.36.2 works fine on the test files that I gave link to, the file I'm doing a diff for is larger and 1.36.2 crashes on it with same stacktrace.

Actual test case is to diff a file from here: https://archive.org/details/mbf-2-m-345-a-venot-es-ax-24.40.1000

With any of the firmware by the link (e.x. for a HECO).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant