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

Stonesense On-Screen Display hidden by default in config. #119

Merged
merged 7 commits into from
Jan 16, 2025

Conversation

realSquidCoder
Copy link
Contributor

this might crash on Linux, but i cant check and it's probably an allegro issue.

this might crash on linux, but i cant check and it's probably an allegro issue
resources/init.txt Outdated Show resolved Hide resolved
@realSquidCoder realSquidCoder marked this pull request as ready for review December 26, 2024 18:21
@realSquidCoder
Copy link
Contributor Author

hey i just marked this ready for review but i also just remembered i wanted to ask if we should hide the names by default too. or should this be a seperate PR?

realSquidCoder added a commit to SquidCoderIndustries/dfhack that referenced this pull request Dec 26, 2024
this is the new config file for stonesense. it does NOT have the changes i made in DFHack/stonesense#119
Copy link
Member

@myk002 myk002 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, this insta-crashes on Linux:

[DFHack]# ssense
Stonesense launched
Using allegro version 5.0.10 r1
New image: stonesense/objects.png
New image: stonesense/creatures.png
[DFHack]# 
          Thread 12 "dwarfort" received signal SIGSEGV, Segmentation fault.
                                                                           [Switching to Thread 0x7fffe4bfc6c0 (LWP 7087)]
__strlen_avx2 () at ../sysdeps/x86_64/multiarch/strlen-avx2.S:76
76              VPCMPEQ (%rdi), %ymm0, %ymm1
(gdb) bt
#0  __strlen_avx2 () at ../sysdeps/x86_64/multiarch/strlen-avx2.S:76
#1  0x00007ffff74f4b69 in __printf_buffer (buf=buf@entry=0x7fffe4bfb650, format=format@entry=0x7fffed519c79 "New image: %s\n", ap=ap@entry=0x7fffe4bfb758, 
    mode_flags=mode_flags@entry=2) at /usr/src/debug/sys-libs/glibc-2.39-r6/glibc-2.39/stdio-common/vfprintf-process-arg.c:435
#2  0x00007ffff74f5189 in __vfprintf_internal (s=0x7fffc0b32fa0, format=0x7fffed519c79 "New image: %s\n", ap=0x7fffe4bfb758, mode_flags=2) at vfprintf-internal.c:1559
#3  0x00007fffed50b3ca in LogVerbose(char const*, ...) () from /home/myk/.local/share/Steam/steamapps/common/Dwarf Fortress/hack/plugins/stonesense.plug.so
#4  0x00007fffed4e2c13 in loadImgFile(char const*) () from /home/myk/.local/share/Steam/steamapps/common/Dwarf Fortress/hack/plugins/stonesense.plug.so
#5  0x00007fffed4e3838 in load_from_path(ALLEGRO_PATH*, char const*, ALLEGRO_BITMAP*&) ()
   from /home/myk/.local/share/Steam/steamapps/common/Dwarf Fortress/hack/plugins/stonesense.plug.so
#6  0x00007fffed4e38d6 in loadGraphicsFromDisk() () from /home/myk/.local/share/Steam/steamapps/common/Dwarf Fortress/hack/plugins/stonesense.plug.so
#7  0x00007fffed50bf38 in stonesense_thread(ALLEGRO_THREAD*, void*) ()
   from /home/myk/.local/share/Steam/steamapps/common/Dwarf Fortress/hack/plugins/stonesense.plug.so
#8  0x00007fffed06292a in ?? () from hack/liballegro.so.5.0
#9  0x00007fffed09e26e in ?? () from hack/liballegro.so.5.0
#10 0x00007ffff7521419 in start_thread (arg=<optimized out>) at pthread_create.c:447
#11 0x00007ffff758d52c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78

The setfault is in strlen, which frankly sounds like an unterminated buffer that should be causing problems all the time. Let's put this PR on hold until we track that one down.

@myk002
Copy link
Member

myk002 commented Dec 27, 2024

separating names from the other OSD elements would be useful, but totally in a separate PR. That will be a much larger scale and riskier change.

@realSquidCoder
Copy link
Contributor Author

oh no i meant just hiding them by default, which i think i did in #120 (tho it can still be turned back on with stoneinit.txt and keybind too

@myk002
Copy link
Member

myk002 commented Dec 27, 2024

no need to hide them by default -- they'll be hidden anyway since the osd is off

@myk002
Copy link
Member

myk002 commented Dec 27, 2024

Better stack trace with more debug symbols:

[DFHack]# ssense
Stonesense launched
Using allegro version 5.0.10 r1
New image: stonesense/objects.png
New image: stonesense/creatures.png
[DFHack]# 
          Thread 12 "dwarfort" received signal SIGSEGV, Segmentation fault.
                                                                           [Switching to Thread 0x7fff996706c0 (LWP 11316)]
__strlen_avx2 () at ../sysdeps/x86_64/multiarch/strlen-avx2.S:76
76              VPCMPEQ (%rdi), %ymm0, %ymm1
(gdb) bt
#0  __strlen_avx2 () at ../sysdeps/x86_64/multiarch/strlen-avx2.S:76
#1  0x00007ffff74f4b69 in __printf_buffer (buf=buf@entry=0x7fff9966f700, format=format@entry=0x7fffeec15c78 "New image: %s\n", ap=ap@entry=0x7fff9966f808, 
    mode_flags=mode_flags@entry=2) at /usr/src/debug/sys-libs/glibc-2.39-r6/glibc-2.39/stdio-common/vfprintf-process-arg.c:435
#2  0x00007ffff74f5189 in __vfprintf_internal (s=0x7fffc8b32fa0, format=0x7fffeec15c78 "New image: %s\n", ap=0x7fff9966f808, mode_flags=2) at vfprintf-internal.c:1559
#3  0x00007fffeec0a75a in vfprintf (__ap=0x7fff9966f808, __fmt=0x7fffeec15c78 "New image: %s\n", __stream=0x7fffc8b32fa0) at /usr/include/bits/stdio2.h:109
#4  LogVerbose (msg=msg@entry=0x7fffeec15c78 "New image: %s\n") at /home/myk/src/dfhack/plugins/stonesense/main.cpp:130
#5  0x00007fffeebeb52d in loadImgFile (filename=0x7fffc8a46dd0 "stonesense/creatures.png") at /home/myk/src/dfhack/plugins/stonesense/GUI.cpp:1451
#6  0x00007fffeebec088 in load_from_path (p=p@entry=0x7fffc90c2800, filename=filename@entry=0x7fffeec15cac "creatures.png", imgd=@0x7fffeec2e3e8: 0x0)
    at /home/myk/src/dfhack/plugins/stonesense/GUI.cpp:1231
#7  0x00007fffeebec126 in loadGraphicsFromDisk () at /home/myk/src/dfhack/plugins/stonesense/GUI.cpp:1245
#8  0x00007fffeec0b2a0 in stonesense_thread (main_thread=0x7fffd81f0830, parms=<optimized out>) at /home/myk/src/dfhack/plugins/stonesense/main.cpp:543
#9  0x00007fffed26292a in ?? () from hack/liballegro.so.5.0
#10 0x00007fffed29e26e in ?? () from hack/liballegro.so.5.0
#11 0x00007ffff7521419 in start_thread (arg=<optimized out>) at pthread_create.c:447
#12 0x00007ffff758d52c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78

@realSquidCoder
Copy link
Contributor Author

realSquidCoder commented Dec 27, 2024

no need to hide them by default -- they'll be hidden anyway since the osd is off

they wont, actually. those arent linked. also i was asked to hide them as a feature request and it lines up with everything hidden by default

@myk002
Copy link
Member

myk002 commented Dec 27, 2024

ah ok, then hiding them is good. I was mistaken about how it worked

@myk002
Copy link
Member

myk002 commented Dec 28, 2024

As per the discussion on Discord (https://discord.com/channels/793331351645323264/1321200750000341034/1322057323606310912), this change is unsafe to merge until issues with deferred bitmap drawing mode are solved

@myk002
Copy link
Member

myk002 commented Jan 12, 2025

this still causes issues, even with updated allegro. I do think we still need to address the threading issues before we can merge this.

@myk002
Copy link
Member

myk002 commented Jan 16, 2025

Can be merged after #140 goes in

@myk002
Copy link
Member

myk002 commented Jan 16, 2025

needs changelog entry

docs/changelog.txt Outdated Show resolved Hide resolved
@myk002 myk002 merged commit 5838a5e into DFHack:master Jan 16, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants