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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
No open projects
Status: Done
Development

No branches or pull requests

2 participants