From: Carl B. P. <cb...@co...> - 2000-12-29 06:50:25
|
Hi there, I have previously tested an older version of hpoj on a AMD K6 300Mhz and = a HP Officejet 590. Now I have downloaded version hpoj-0.7 and compiled it on a SUSE 6.3 with= kernel 2.2.18, using the same hw. Using the hpo to scan, hpo scan bw, it always ended in a segmentation fau= lt which annoyed me. Using gdb, I traced the problem to PMLClose() in pml.c. void PMLClose(void) { static trap_t *curtrap; /* Unregister all traps */ while(traps !=3D NULL) { PMLUnregisterTrap(traps->oid); PMLProcess(); curtrap =3D traps; <---------- CRASHED HERE!!! traps =3D traps->next; free(curtrap); } free(rcv_buf); MlcCon_close(connection); delete_MlcCon(connection); } After the PMLUnregisterTrap(), the traps pointer might be NULL because th= e trap might have been free'd. Adding a test after PMLProcess((), no more segmentation faults appears. void PMLClose(void) { static trap_t *curtrap; /* Unregister all traps */ while(traps !=3D NULL) { PMLUnregisterTrap(traps->oid); PMLProcess(); if( traps =3D=3D NULL ) <--- Added break; <--- Added. curtrap =3D traps; traps =3D traps->next; free(curtrap); } free(rcv_buf); MlcCon_close(connection); delete_MlcCon(connection); } Now is the problem to figure out how to use the scanned data. The 590 is not supported by the current SANE interface(ptal-connect) as f= ar as I can figure out. Haven't tried the printing yet as one of the std. HP deskjet drivers usually works. Carl B. Pedersen e-mail: cb...@co... |