<commit_before>#include "engine/allocators.h"
#include "engine/debug.h"
#include "engine/atomic.h"
#include "engine/string.h"
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <execinfo.h>

static bool g_is_crash_reporting_enabled = false;


namespace Lumix {


namespace debug {


static Lumix::DefaultAllocator stack_node_allocator;


void debugOutput(const char* message) {
	printf("%s", message);
}


void debugBreak() {
	abort();
}


int StackTree::s_instances = 0;


struct StackNode {
	~StackNode() {
		delete m_next;
		delete m_first_child;
	}

	void* m_instruction;
	StackNode* m_next;
	StackNode* m_first_child;
	StackNode* m_parent;
};


StackTree::StackTree() {}
StackTree::~StackTree() {}
void StackTree::refreshModuleList() {}


int StackTree::getPath(StackNode* node, Span<StackNode*> output) {
	u32 i = 0;
	while (i < output.length() && node) {
		output[i] = node;
		i++;
		node = node->m_parent;
	}
	return i;
}


StackNode* StackTree::getParent(StackNode* node) {
	return node ? node->m_parent : nullptr;
}


bool StackTree::getFunction(StackNode* node, Span<char> out, int& line) {
	char** str = backtrace_symbols(&node->m_instruction, 1);
	if (!str) return false;

	copyString(out, *str);
	free(str);<commit_msg>linux crash fix<commit_after>#include "engine/allocators.h"
#include "engine/debug.h"
#include "engine/atomic.h"
#include "engine/string.h"
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <execinfo.h>

static bool g_is_crash_reporting_enabled = false;


namespace Lumix {


namespace debug {


static Lumix::DefaultAllocator stack_node_allocator;


void debugOutput(const char* message) {
	printf("%s", message);
}


void debugBreak() {
	abort();
}


int StackTree::s_instances = 0;


struct StackNode {
	~StackNode() {
		delete m_next;
		delete m_first_child;
	}

	void* m_instruction;
	StackNode* m_next;
	StackNode* m_first_child;
	StackNode* m_parent;
};


StackTree::StackTree()
	: m_root(nullptr)
{}

StackTree::~StackTree() {}

void StackTree::refreshModuleList() {}


int StackTree::getPath(StackNode* node, Span<StackNode*> output) {
	u32 i = 0;
	while (i < output.length() && node) {
		output[i] = node;
		i++;
		node = node->m_parent;
	}
	return i;
}


StackNode* StackTree::getParent(StackNode* node) {
	return node ? node->m_parent : nullptr;
}


bool StackTree::getFunction(StackNode* node, Span<char> out, int& line) {
	char** str = backtrace_symbols(&node->m_instruction, 1);
	if (!str) return false;

	copyString(out, *str);
	free(str);
{'fraction_non_alphanumeric': 0.14739769566944774, 'fraction_numerical': 0.003972983710766786, 'mean_word_length': 5.295, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4121040', 'n_tokens_mistral': 967, 'n_tokens_neox': 917, 'n_words': 206}