-
-
Notifications
You must be signed in to change notification settings - Fork 382
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
Custom systems segfault when you attempt to view them in the map #5857
Comments
OK, so the crash is with a mod. Looks like pretty much every characteristic of that system has divide by zero?
Where did you get this system from?
|
Warning: Caught error in Lua UI code:
[T] pigui/views/map-sector-view.lua:224: bad argument #1 to 'text' (string expected, got nil)
Thread 1 "pioneer" received signal SIGSEGV, Segmentation fault.
0x0000555555981ab2 in ImDrawList::_CalcCircleAutoSegmentCount (this=0x55555b316700, radius=2.1545943e+09) at /home/zonkmachine/builds/pioneer/contrib/imgui/imgui_draw.cpp:572
572 return _Data->CircleSegmentCounts[radius_idx]; // Use cached value
(gdb) bt full
#0 0x0000555555981ab2 in ImDrawList::_CalcCircleAutoSegmentCount (this=0x55555b316700, radius=2.1545943e+09) at /home/zonkmachine/builds/pioneer/contrib/imgui/imgui_draw.cpp:572
radius_idx = -2147483648
#1 0x0000555555983a5a in ImDrawList::_PathArcToFastEx (this=0x55555b316700, center=..., radius=2.1545943e+09, a_min_sample=a_min_sample@entry=0, a_max_sample=a_max_sample@entry=48, a_step=a_step@entry=0)
at /home/zonkmachine/builds/pioneer/contrib/imgui/imgui_draw.cpp:1066
sample_range = <optimized out>
a_next_step = <optimized out>
samples = <optimized out>
extra_max_sample = <optimized out>
out_ptr = <optimized out>
sample_index = <optimized out>
#2 0x0000555555986857 in ImDrawList::AddCircleFilled (num_segments=0, col=2147483647, radius=<optimized out>, center=..., this=0x55555b316700)
at /home/zonkmachine/builds/pioneer/contrib/imgui/imgui_draw.cpp:1515
No locals.
#3 ImDrawList::AddCircleFilled (this=this@entry=0x55555b316700, center=..., radius=<optimized out>, col=2147483647, num_segments=num_segments@entry=0)
at /home/zonkmachine/builds/pioneer/contrib/imgui/imgui_draw.cpp:1507
a_max = <optimized out>
#4 0x00005555557c0f56 in SectorMap::StarLabel::Draw (this=0x55556c15b860, dl=..., hovered=<optimized out>) at /home/zonkmachine/builds/pioneer/src/SectorMap.cpp:146
box = <optimized out>
font = <optimized out>
#5 0x00005555557b8485 in SectorMap::DrawLabelsInternal (this=0x555556eabe00, interactive=<optimized out>, imagePos=...) at /home/zonkmachine/builds/pioneer/src/SectorMap.cpp:779
hovered = @0x55556c15b860: {_vptr.Label = 0x555555b0cdc8 <vtable for SectorMap::StarLabel+16>, pos = {x = 639.999939, y = 359.999939, z = -0.0357779004}, color = 4291611852, host = @0x555556eac118}
NOT_FOUND = <optimized out>
hovered_i = 0
drawData = {Valid = false, CmdListsCount = 1135968256, TotalIdxCount = 1432398800, TotalVtxCount = 21845, CmdLists = {Size = 1818829472, Capacity = 21845,
Data = 0x5555556d8870 <PiGui::Instance::NewFrame()+944>}, DisplayPos = {x = 2.77916261e+13, y = 3.0611365e-41}, DisplaySize = {x = 1.54392834e+13, y = 3.0611365e-41}, FramebufferScale = {x = 2.04011909e+17, y = 3.0611365e-41},
OwnerViewport = 0x555555bcf7e0}
dl = <optimized out>
#6 0x0000555555614cf3 in SectorView::DrawPiGui (this=<optimized out>) at /home/zonkmachine/builds/pioneer/src/SectorView.cpp:280
No locals.
#7 0x0000555555607fc2 in GameLoop::Update (this=0x555555bcf7e0, deltaTime=0.0166593846) at /home/zonkmachine/builds/pioneer/src/Pi.cpp:1039
step = <optimized out> |
I have a system like that and it's the .json version of sol00 created with the system editor. If I remove it I still get the segfault. #0 0x0000555555981ab2 in ImDrawList::_CalcCircleAutoSegmentCount (this=0x55555c6efaf0, radius=2.21812864e+09) at /home/zonkmachine/builds/pioneer/contrib/imgui/imgui_draw.cpp:572
radius_idx = -2147483648 |
@Web-eWorks any clue what's going on here? |
Hmm... not off the top of my head, I'll have to take a look at it during the day sometime and dig into the crash. I did notice some weird behavior when I was loading a moderately complicated custom system I created on my own, but never got a chance to find the culprit (and it was having issues in mission Lua code, besides). |
I remember just git cloning Pioneer and running cmake... is there a way to check for mods and remove them? I don't remember having any. Also, I generated that with the system editor. |
@a-random-lemurian The json system you provided is a mod, so you've made it or someone else, it's not in master. |
So how do I check mods, if any, and remove them? |
@a-random-lemurian how did you get the position of the star within the sector to be a negative value? It's not responsible for the crash, but the UI shouldn't let you do that directly. The crash is a simple one - the system editor wasn't generating a needed piece of metadata (a list of stars in the system), and as a result the game thought the system had no stars. I've included some fixes to those conditions in an upcoming PR, so it should be a bit safer to run the game with a custom system that has no stars. |
The issue should be fixed once the linked PR is merged. You'll need to load and re-save the system file for the fix to take effect. |
Observed behaviour
Expected behaviour
I see the custom system in the view and I can spawn in it.
Steps to reproduce
data/systems/custom
: segfault-star.jsonMy pioneer version (and OS):
Git commit d5e3147
Xubuntu 24.04
My output.txt (required) and game save (optional, but recommended)
output.txt
The text was updated successfully, but these errors were encountered: