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

stlink-gui: failed to allocate 139988352155568 bytes #1356

Closed
4 tasks done
rcubee opened this issue Nov 14, 2023 · 1 comment
Closed
4 tasks done

stlink-gui: failed to allocate 139988352155568 bytes #1356

rcubee opened this issue Nov 14, 2023 · 1 comment

Comments

@rcubee
Copy link
Contributor

rcubee commented Nov 14, 2023

  • made serious effort to avoid creating duplicate or nearly similar issue
  • Operating system and version: linux 6.1.38
  • stlink tools version and/or git commit hash: v1.7.0-316-g31c7fc6-dirty
  • stlink commandline tool name: stlink-gui

Commandline output:

$ ./stlink-gui 

(stlink-gui:25286): GLib-ERROR **: 10:38:03.866: ../glib-2.78.1/glib/gmem.c:136: failed to allocate 139988352155568 bytes
Trace/breakpoint trap

The program crashes after opening a file.

Commit 3343078 seems to be the villain. Why g_malloc(<pointer_casted_to_gsize>) instead of the previous g_malloc(g_file_info_get_size(file_info))?

Changing line 311 from gui->file_mem.size = (gsize) file_info; to gui->file_mem.size = file_size; fixed the issue and I was able to flash the device.

@Nightwalker-87
Copy link
Member

@rcubee That's a good question, I need to check.

@Nightwalker-87 Nightwalker-87 added this to To do in Release v1.8.0 via automation Nov 21, 2023
@Nightwalker-87 Nightwalker-87 added this to the v1.8.0 milestone Nov 21, 2023
@Nightwalker-87 Nightwalker-87 self-assigned this Nov 21, 2023
@Nightwalker-87 Nightwalker-87 moved this from To do to In progress in Release v1.8.0 Nov 21, 2023
@Nightwalker-87 Nightwalker-87 moved this from In progress to Review in progress in Release v1.8.0 Nov 24, 2023
@Nightwalker-87 Nightwalker-87 moved this from Review in progress to Reviewer approved in Release v1.8.0 Nov 24, 2023
Release v1.8.0 automation moved this from Reviewer approved to Done Nov 24, 2023
@stlink-org stlink-org locked as resolved and limited conversation to collaborators Nov 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
No open projects
Development

No branches or pull requests

2 participants