Menu

#14 Openldev: Segmentation fault (core dumped).

Current Release
open
nobody
Interface (6)
5
2007-06-23
2007-06-23
moma
No

Hello all,

I have built OpenLdev on my Ubuntu 7.04 Linux machine. So this is a fresh installment of OpenLdev on this system.

When I start OpenLdev it crashes immediately. The crash happens before I can see the GUI. The output is:

$ openldev
Segmentation fault (core dumped)
-------------------

Well, I opened the openldev/main.cc file and studied how far it runs before the crash.

main.cc makes a call to openldev.cc, function openldev_populate_treeview (openldev);

The "last_project" variable is of course "EMPTY".
This is the very first run.

I can see that it crashes in openldev.cc's function
openldev_populate_treeview (OpenLDev *openldev), at the statement file_browser_populate(browser, openldev->project->location);
--------------------

Reason:
The openldev->project->location variable is undefined. It is neither NULL nor/or a valid pointer.

This is how to fix this error:

Open the "openldev-project.cc" file (in openldev/openldev-settings directory) and nullify the "settings" structure in openldev_project_settings_new() function.

I added this statement to that function:
memset(settings, '\0', sizeof(ProjectSettings));
------------------------------------------
Here is the whole code:

// File: openldev-project.cc
// ...

// Open the project located at the specified file name
ProjectSettings*
openldev_project_settings_new (gchar *filename)
{
ProjectSettings* settings = g_slice_new (ProjectSettings);

// Nullify the structure
memset(settings, '\0', sizeof(ProjectSettings));

settings->open = FALSE;

if (filename == NULL)
settings->name = NULL;
else
openldev_project_settings_load_project_file (settings, filename);

return settings;
}
----------------

:-)
Cheers,
Moma
http://www.futuredesktop.org
http://www.futuredesktop.org/fedora-7.html

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.