Menu

#1 Segmentation faults

open
nobody
None
5
2000-12-12
2000-12-12
No

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.

Discussion

  • Eduardo I. Osorio

    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.

     
  • Steve OConnor

    Steve OConnor - 2000-12-21

    Fixed in cvs, 22-dec-2000.

    Simply a matter of checking the file pointer for nullness before fclose()ing it

     
  • Steve OConnor

    Steve OConnor - 2000-12-21

    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.

     

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.