Segmentation faults
Brought to you by:
dmallery,
sir_maniac
After executing gtk_main_quit(), the program reg2 causes a segmentation fault. The same applies to tkt_print, but this affects on void data passed to the lpr pipe.
I formated the directory slips, the directory have the right permissions (u+rwx), changed the line where the base directory is defined according to my home directory, so there are no problems with directory access.
I noticed that there are no tickets after a sale, they are generated only when I press the Suspend button.
I use Red Hat 7.0, I have a paralel printer correctly configured on lp0, gtk+ 1.2.8-7, kernel 2.2.16-22 on a i586 and 64 MB RAM.
Problem found. On line 43, on tkt_print.c, the size of fbuf is lited to 32 bytes. If the data stored (filename and path) is greater that 32 bytes, causes a segmentation fault. A quick solution is to increase fbuf to a grater value, but I recomend to use a pointer instead of an array of chars.
Fixed in cvs, 22-dec-2000.
Simply a matter of checking the file pointer for nullness before fclose()ing it
Also , I got really bad crashes happening on exit when I had CVS directories in the goods heirachy - not unexpected !!
Made a quick hack to reg2.c to ignore CVS directories in the goods area.
The GCC that ships with RedHat 7.0 is broken. See
http://x58.deja.com/threadmsg_ct.xp?AN=705169495.1&mhitnum=1&CONTEXT=976973433.7
for an explanation from the man himself, Linus.
~Kevin
:)