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] Sometimes, Dynamic collections fail to insert items. #3888

Open
ruvasqm opened this issue Dec 17, 2024 · 2 comments
Open

[BUG] Sometimes, Dynamic collections fail to insert items. #3888

ruvasqm opened this issue Dec 17, 2024 · 2 comments
Labels
bug Something isn't working mojo-repo Tag all issues with this label

Comments

@ruvasqm
Copy link

ruvasqm commented Dec 17, 2024

Bug description

I was doing AoC in mojo this year and two times I got .value() on Optional and ptr != list->Next() when inserting a new value.

  • I managed to solve it once by reserving space before using the list
  • This time that also failed and the list or dict is not even big
  • I tried removing other collections I wasn't deleting yet at that point but the problem persists

Steps to reproduce

  • Include relevant code snippet or link to code that did not work as expected.
1
src/thread_cache.h:394] ptr != list->Next()
[33498:33498:20241217,022134.518945:ERROR elf_dynamic_array_reader.h:64] tag not found
[33498:33498:20241217,022134.519172:ERROR elf_dynamic_array_reader.h:64] tag not found
[33498:33498:20241217,022134.519869:ERROR elf_dynamic_array_reader.h:64] tag not found
[33498:33498:20241217,022134.519989:ERROR elf_dynamic_array_reader.h:64] tag not found
Please submit a bug report to https://github.com/modularml/mojo/issues and include the crash backtrace along with all the relevant source codes.
Stack dump:
0.      Program arguments: mojo 2024_12.mojo
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  mojo                        0x00005f4a2887447b
1  mojo                        0x00005f4a288723d9
2  mojo                        0x00005f4a28874b1d
3  libc.so.6                   0x00007a500d842520
4  libc.so.6                   0x00007a500d8969fc pthread_kill + 300
5  libc.so.6                   0x00007a500d842476 raise + 22
6  libc.so.6                   0x00007a500d8287f3 abort + 211
7  libAsyncRTRuntimeGlobals.so 0x00007a500dd8711b
8  libAsyncRTRuntimeGlobals.so 0x00007a500dd8fb31
9  libKGENCompilerRTShared.so  0x00007a500ce5a414 KGEN_CompilerRT_AlignedFree + 116
10 libKGENCompilerRTShared.so  0x00007a4fa0009b47 KGEN_CompilerRT_AlignedFree + 18446744071882602407
mojo crashed!
Please file a bug report.
[1]    33491 IOT instruction (core dumped)  mojo 2024_12.mojo

That first line "1" is this on my code print(len(regions[parents[i - n - n]].els)) which at that moment was 1

  • Include anything else that might help us debug the issue.

    • Honestly, I pushed Lists/Dicts before a lot more and was able to find an alternate solution
    • My system crashed once and had to REISUB and recover my BIOS while trying to compile a recursive function with parameters. Maybe said system is missing something that llvm needs?
    • When I built the program and ran the executable it managed to complete but the output was messing with other panes in my tmux, not going to redo it but let's say it wrote over another pane that had neovim on it
  • Where can I see these elf array readers and src/thread_cache.h files?

System information

- What OS did you do install Mojo on ?

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.5 LTS"
PRETTY_NAME="Ubuntu 22.04.5 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.5 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy

- Provide version information for Mojo by pasting the output of `mojo -v`
```bash
mojo 24.5.0 (e8aacb95)
  • Provide Magic CLI version by pasting the output of magic -V or magic --version
magic 0.5.1 - (based on pixi 0.37.0)
  • Optionally, provide more information with magic info.
     Magic version: 0.5.1
System
------------
      Pixi version: 0.37.0
          Platform: linux-64
  Virtual packages: __unix=0=0
                  : __linux=6.8.0=0
                  : __glibc=2.35=0
                  : __archspec=1=excavator
         Cache dir: /home/ruvasqm/.cache/rattler/cache
      Auth storage: /home/ruvasqm/.rattler/credentials.json
  Config locations: No config files found

Global
------------
           Bin dir: /home/ruvasqm/.modular/bin
   Environment dir: /home/ruvasqm/.modular/envs
      Manifest dir: /home/ruvasqm/.modular/manifests/pixi-global.toml

Project
------------
              Name: AoC
           Version: 0.1.0
     Manifest file: /home/ruvasqm/dev/aoc/mojo/mojoproject.toml
      Last updated: 05-12-2024 16:45:47

Environments
------------
       Environment: default
          Features: default
          Channels: conda-forge, https://conda.modular.com/max
  Dependency count: 1
      Dependencies: max
  Target platforms: linux-64
@ruvasqm ruvasqm added bug Something isn't working mojo-repo Tag all issues with this label labels Dec 17, 2024
@soraros
Copy link
Contributor

soraros commented Dec 19, 2024

Could you provide a minimal reproducible example?

@ruvasqm
Copy link
Author

ruvasqm commented Dec 19, 2024

The example is too contrived and it is tightly coupled with this type of implementation. I'm sorry, what I can tell you is that it is a loop whose main flow doesn't depend on the list/dict and said collection is modified very quickly in a short period of time (appended, popped and mutated). This is as to maintain a certain state whose space was hard to describe statically.

You mantainers have a lot to work on at the moment and can close this up until I find a good and concise example of what is happening. The only thing I ask is, can I look at those header files that show up on the error? I don't know how to find them, are they llvm-related? Can I help my mojo installation be more concise on stack traces configuring the llvm-symbolizer ? How can I do so? the recommendations on the error don't seem to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working mojo-repo Tag all issues with this label
Projects
None yet
Development

No branches or pull requests

2 participants