Hi Hamish, >We've noticed a serious crash in geda (the project manager) >on x86 on Debian. There is a simple way to reproduce this: > >Create a new project; >Import a file (eg the TwoStageAmp example); >Go to the files pane and double-right click on the file. > >In the Status page, I see > >Open: TwoStageAmp.sch >sh: Open:: command not found > >The next click on the GUI (eg the Project tab) makes geda disappear with >a segfault.
Yeah, okay, reproduced here, and now partially fixed in CVS. Attached is the patch to geda/src/task.c to fix the first seg fault. The second segfault (related to "Create PCB...") is still a little mysterious. The method of creating a PCB that geda is using is a little dated. Please try out the patch and let me know if it helps. Note, geda (gManager) doesn't work so great with files that have been imported (at least for me). I need to look into why this isn't working, but it shouldn't segfault anymore. The more I think about it, the more I'm beginning to think that geda (gManager) should be pulled from Debian as it has gotten a little dated and it is not being maintained as agressively as it used to be. >Another bug: if you open a project then hit OK without actually >selecting a file, geda hangs consuming 100% of cpu. I haven't been able to reproduce this problem here. How do you want to handle this fix? Do you want to patch 20050313 yourself or do you want me to respin a new tarball. I doubt you want me to re-release a brand new set of tarballs for everything (new version). Thanks for the bug report. -Ales -- Cut here -- Index: task.c =================================================================== RCS file: /home/cvspsrv/cvsroot/eda/geda/devel/geda/src/task.c,v retrieving revision 1.6 retrieving revision 1.7 diff -c -r1.6 -r1.7 *** task.c 22 Feb 2005 22:45:14 -0000 1.6 --- task.c 11 May 2005 03:27:11 -0000 1.7 *************** *** 1,4 **** ! /* $Id: task.c,v 1.6 2005/02/22 22:45:14 danmc Exp $ */ /*******************************************************************************/ /* */ --- 1,4 ---- ! /* $Id: task.c,v 1.7 2005/05/11 03:27:11 ahvezda Exp $ */ /*******************************************************************************/ /* */ *************** *** 70,76 **** static int NewIntCmd(const char *szFilename, struct Action_s *pAction); static int NewExtCmd(const char *szFilename, struct Action_s *pAction); static int NewImport(const char *szFilename, struct Action_s *pAction); ! static void StrReplace(char *szString, const char *szFrom, const char *szTo); --- 70,76 ---- static int NewIntCmd(const char *szFilename, struct Action_s *pAction); static int NewExtCmd(const char *szFilename, struct Action_s *pAction); static int NewImport(const char *szFilename, struct Action_s *pAction); ! static char* StrReplace(char *szString, const char *szFrom, const char *szTo); *************** *** 411,420 **** return FAILURE; } strcpy(pTask->szValue, pAction->szCommand); ! StrReplace((char *) pTask->szValue, "%FILENAME%", (char *) FileGetName(szFilename)); ! StrReplace((char *) pTask->szValue, "%FILEEXT%", (char *) FileGetExt(szFilename)); ! StrReplace((char *) pTask->szValue, "%FILEDIR%", (char *) FileGetDir(szFilename)); ! StrReplace((char *) pTask->szValue, "%FILEREL%", (char *) FileGetRel(szFilename)); /* display message box if task blocking */ if (pTask->fFlags & TASK_BLOCKING) --- 411,420 ---- return FAILURE; } strcpy(pTask->szValue, pAction->szCommand); ! pTask->szValue = StrReplace((char *) pTask->szValue, "%FILENAME%", (char *) FileGetName(szFilename)); ! pTask->szValue = StrReplace((char *) pTask->szValue, "%FILEEXT%", (char *) FileGetExt(szFilename)); ! pTask->szValue = StrReplace((char *) pTask->szValue, "%FILEDIR%", (char *) FileGetDir(szFilename)); ! pTask->szValue = StrReplace((char *) pTask->szValue, "%FILEREL%", (char *) FileGetRel(szFilename)); /* display message box if task blocking */ if (pTask->fFlags & TASK_BLOCKING) *************** *** 479,488 **** return FAILURE; } strcpy(pTask->szValue, pAction->szImport); ! StrReplace((char *) pTask->szValue, "%FILENAME%", (char *) FileGetName(szFilename)); ! StrReplace((char *) pTask->szValue, "%FILEEXT%", (char *) FileGetExt(szFilename)); ! StrReplace((char *) pTask->szValue, "%FILEDIR%", (char *) FileGetDir(szFilename)); ! StrReplace((char *) pTask->szValue, "%FILEREL%", (char *) FileGetRel(szFilename)); pTask->pMenuItem = MenuWindowNew(pAction->szName); pTask->Id = 0; --- 479,488 ---- return FAILURE; } strcpy(pTask->szValue, pAction->szImport); ! pTask->szValue = StrReplace((char *) pTask->szValue, "%FILENAME%", (char *) FileGetName(szFilename)); ! pTask->szValue = StrReplace((char *) pTask->szValue, "%FILEEXT%", (char *) FileGetExt(szFilename)); ! pTask->szValue = StrReplace((char *) pTask->szValue, "%FILEDIR%", (char *) FileGetDir(szFilename)); ! pTask->szValue = StrReplace((char *) pTask->szValue, "%FILEREL%", (char *) FileGetRel(szFilename)); pTask->pMenuItem = MenuWindowNew(pAction->szName); pTask->Id = 0; *************** *** 503,516 **** ! static void StrReplace(char *szString, const char *szFrom, const char *szTo) { char *szBegin, *szTemp; int i; szTemp = (void *) malloc(strlen(szString) + 1); if (szTemp == NULL) ! return; for (szBegin = strstr(szString, szFrom); szBegin != NULL; szBegin = strstr(szString, szFrom)) { --- 503,516 ---- ! static char* StrReplace(char *szString, const char *szFrom, const char *szTo) { char *szBegin, *szTemp; int i; szTemp = (void *) malloc(strlen(szString) + 1); if (szTemp == NULL) ! return NULL; for (szBegin = strstr(szString, szFrom); szBegin != NULL; szBegin = strstr(szString, szFrom)) { *************** *** 520,530 **** strcpy(szString, szTemp); szString[i] = 0; ! ! realloc(szString, strlen(szString) + strlen(szTo) + strlen(szBegin + strlen(szFrom)) + 1); strcat(szString, szTo); strcat(szString, szBegin + strlen(szFrom)); } free((void *) szTemp); } --- 520,537 ---- strcpy(szString, szTemp); szString[i] = 0; ! ! /* realloc can change the modified pointer completely, so */ ! /* it needs to be assigned. Not doing this caused a nasty */ ! /* bug on some architectures/machines. */ ! szString = realloc(szString, strlen(szString) + strlen(szTo) + strlen(szBegin + strlen(szFrom)) + 1); strcat(szString, szTo); strcat(szString, szBegin + strlen(szFrom)); } free((void *) szTemp); + + /* You must return the pointer since realloc might have completely */ + /* changed the pointer. */ + return szString; }