Ask coding questions

← Back to all posts
sf::RenderWindow causes segfault in SFML... Maybe a problem on Replits side?
MatthewWesolows (35)

After struggling with keeping framerate high in my game engine for a couple days, I decided to take a week-or-so break. I later come back to find that creating a renderwindow causes a segmentation fault, which happens when an invalid memory operation happens. This is probably not a problem on my side, because I ran an older version of the code that worked fine when I released it, and it still segfaulted. I may be completely wrong and it may be a problem on my side, but I don't think thats likely. Any ideas/help would be greatly appreciated.

Thanks in advance!

Coder100 (18876)

ah yes blame the library before blaming yourself

in all seriousness though, segmentation faults are very finicky -- they sometimes happen and they sometimes don't. Check your code to make sure you have allocated all the memory required to make all operations.

MatthewWesolows (35)

@Coder100 The code was working fine until I got back from my week long break. As I said on the post, the old code was working fine a week or so ago, but once I ran it recently, I got a segfault. It's not only me, I checked @SPQR repl I forked to get SFML running from and it also segfaulted.

Coder100 (18876)

hm, would you click the get help button to get help? @MatthewWesolows

CSharpIsGud (1070)

This is the case where you blame the library before you blame yourself.

MatthewWesolows (35)

@Coder100 Sorry for the late reply, I submitted a bug report a while ago. I described that the problem is also happening with other repls as well as mine.

MatthewWesolows (35)

@CSharpIsGud Sorry, ignore my last reply. I remember looking around reddit yesterday, and I did see posts from a couple months ago complaining about Fluxbox. Fluxbox was just added this January. It may be the cause, as the segfaults only started to happen once the little workspace toolbar popped up. The strange thing is that the workstation option only showed up a couple weeks ago... Even though Fluxbox was added since the beginning of the year... I poked around the Fluxbox webpage, but was unable to find anything that might help. Any ideas?