Bug 44318

Summary: icemc port changed to use qt3, now it writes 0 byte file and crashes when saving
Product: Ports & Packages Reporter: brian K. White <brian>
Component: Individual Port(s)Assignee: Adam Weinberger <adamw>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description brian K. White 2002-10-20 22:50:01 UTC
      icemc was working fine, I used it all the time to edit my icewm menu in my home dir. then after a recent cvsup of my ports tree, the icemc port was changed to use qt3.0 instead of qt2.3. the qt23 make deinstall went without incident, (I only had qcad using it, which I don't mind dealing with later), the qt30 make install went without incident, the icemc make deinstall / make install went without incident. the new icemc runs fine right up untill you try to save the menu file. then it writes a zero-byte file _erasing your menu file!!!_ and exits non-gracefully. it leaves a core file.
The last few lines of strace -eall icemc are:

access("/root/.icewm/menu", F_OK)       = 0                                     
access("/root/.icewm/menu", W_OK)       = 0                                     
lstat("/root/.icewm/menu", {st_mode=S_IFREG|0644, st_size=0, ...}) = 0          
access("/root/.icewm", W_OK)            = 0                                     
lstat("/root/.icewm", {st_mode=S_IFDIR|0755, st_size=512, ...}) = 0             
access("/root/.icewm/menu", F_OK)       = 0                                     
open("/root/.icewm/menu", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 8                   
fcntl(8, F_GETFL)                       = 0x1 (flags O_WRONLY)                  
fcntl(8, F_SETFL, O_WRONLY|O_NONBLOCK)  = 0                                     
fstat(8, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0                            
break(0xfa84d000)                       = -1 ENOMEM (Cannot allocate memory)    
--- SIGSEGV (Segmentation fault) ---                                            
--- SIGSEGV (Segmentation fault) ---

How-To-Repeat:       make install qt30 and icemc from ports, be in X, run icemc, file --> save or 'save as', boom. a 0-byte file is created and icemc exits. if you had first opened an existing file, it is overwritted with 0 bytes. Ouch!
Comment 1 Tilman Keskinoz freebsd_committer freebsd_triage 2002-10-20 23:08:10 UTC
Responsible Changed
From-To: freebsd-ports->icemc

Over to Maintainer
Comment 2 Tilman Keskinoz freebsd_committer freebsd_triage 2002-10-20 23:09:17 UTC
Responsible Changed
From-To: icemc->adamw

Ooops..this is the Maintainer
Comment 3 Adam Weinberger freebsd_committer freebsd_triage 2002-11-11 23:10:51 UTC
State Changed
From-To: open->feedback
Comment 4 Adam Weinberger freebsd_committer freebsd_triage 2002-11-11 23:47:59 UTC
The program dies from line 85 of ${WRKSRC}/IceMenuSave.cpp.

The developer has been notified, and I'd like to see a fix
incorporated, rather than having to mark icemc broken.

/Adam
Comment 5 Adam Weinberger freebsd_committer freebsd_triage 2002-11-11 23:51:22 UTC
The program dies from line 85 of ${WRKSRC}/IceMenuSave.cpp.

The developer has been notified, and I'd like to see a fix
incorporated, rather than having to mark icemc broken.

/Adam
Comment 6 Adam Weinberger freebsd_committer freebsd_triage 2002-11-29 06:35:39 UTC
State Changed
From-To: feedback->closed

Thanks to this PR, the author was able to fix this problem promptly, 
and the port was updated to a new version that fixes this problem. 

It's worth noting that now if the menu has been edited the program 
will dump core upon exit, but the menu doesn't get truncated, and 
that's a darn good improvement IMO. 

Thanks for noticing this and submitting the PR! 

# Adam