Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 5372 - Joe coredumps when using big files
Summary: Joe coredumps when using big files
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: joe
Version: 6.0
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Cristian Gafton
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 1999-09-26 08:17 UTC by Pekka Savola
Modified: 2008-05-01 15:37 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2000-03-31 19:50:34 UTC


Attachments (Terms of Use)

Description Pekka Savola 1999-09-26 08:17:13 UTC
joe-2.8-22

Joe seems seems to segfault when exiting (Save+exit or
just exit) from editing/viewing a really big file.  I tested
several files, and it seems the limit for safe use is 4
megabytes (or something between 100,000 and 110,000 lines).

Comment 1 Chih-Chung Chang 2000-03-31 17:52:59 UTC
The problem is vclose() uses vsrm() to free vfile->name allocated from mktmp(),
vclose() should use free() to free it.
here is a patch:

--- vfile.c~    Thu Oct  6 14:20:35 1994
+++ vfile.c     Fri Mar 31 23:27:31 2000
@@ -255,7 +255,7 @@
 {
 struct stat buf;
 VFILE *new=(VFILE *)malloc(sizeof(VFILE));
-new->name=vsncpy(NULL,0,sz(name));
+new->name=strdup(name);
 new->fd=open(name,O_RDWR);
 if(!new->fd)
  {
@@ -288,7 +288,7 @@
  {
  if(vfile->flags) unlink(vfile->name);
  else vflshf(vfile);
- vsrm(vfile->name);
+ free(vfile->name);
  }
 if(vfile->fd) close(vfile->fd);
 free(deque(VFILE,link,vfile));

Comment 2 Bill Nottingham 2000-03-31 19:50:59 UTC
Thanks for the patch!

Fixed in joe-2.8-25.


Note You need to log in before you can comment on or make changes to this bug.