[sane-devel] the pre-c++ genesys.c file has deficiencies
r. a. schmied
uwppp at flash.net
Thu Jun 13 19:25:27 BST 2019
olaf, povilas other interested saners
i have yet to update to the c++ genesys stuff but working
with sane-backends-master-e13b80fa i have again found that
there are still uninitialized elements of the
Genesys_Scanner * s object.
don't know if this is applicable to the c++ update, but it
really should be applied to the pre-c++ repo.
in normal operation these un-inits are not a problem, but
setting SANE_DEBUG_GENESYS=7 causes a seg fault.
below i attach a gnu diff -uBitwb (an edit of the full
diff output because of the huge number of changes to
genesys.c) that adds the things missing in backend/genesys.c
that fix this seg fault issue.
i have just applied this patch without problem; re-compiled
sane-backends-master-e13b80fa and ran the command (bash 3.00.16)
$ ( SANE_DEBUG_SANEI_CONFIG=8 SANE_DEBUG_GENESYS=7 \
./frontend/scanimage -y 25.4 \
--calibration-file $HOME/.sane/.default_canon-lide-200.cal \
-o 4x1exxon_page_opts_40.png )
seg fault problem resolved.
note patch will probably require one to name the file to be patched
--- ./sane-backends-master-e13b80fa/backend/genesys.c 2019-05-11 20:11:00.000000000 -0700
+++ ./sane-backends-1.0.27/backend/genesys.c 2018-12-24 17:38:00.983124000 -0800
@@ -5311,6 +5541,7 @@
s->val[OPT_NUM_OPTS].w = NUM_OPTIONS;
/* "Mode" group: */
+ s->opt[OPT_MODE_GROUP].name = "scanmode-group";
s->opt[OPT_MODE_GROUP].title = SANE_I18N ("Scan Mode");
s->opt[OPT_MODE_GROUP].desc = "";
s->opt[OPT_MODE_GROUP].type = SANE_TYPE_GROUP;
@@ -5394,6 +5625,7 @@
s->val[OPT_RESOLUTION].w = min_dpi;
/* "Geometry" group: */
+ s->opt[OPT_GEOMETRY_GROUP].name = SANE_NAME_GEOMETRY;
s->opt[OPT_GEOMETRY_GROUP].title = SANE_I18N ("Geometry");
s->opt[OPT_GEOMETRY_GROUP].desc = "";
s->opt[OPT_GEOMETRY_GROUP].type = SANE_TYPE_GROUP;
@@ -5454,6 +5686,7 @@
s->val[OPT_BR_Y].w = y_range->max;
/* "Enhancement" group: */
+ s->opt[OPT_ENHANCEMENT_GROUP].name = SANE_NAME_ENHANCEMENT;
s->opt[OPT_ENHANCEMENT_GROUP].title = SANE_I18N ("Enhancement");
s->opt[OPT_ENHANCEMENT_GROUP].desc = "";
s->opt[OPT_ENHANCEMENT_GROUP].type = SANE_TYPE_GROUP;
@@ -5589,6 +5822,7 @@
s->val[OPT_CONTRAST].w = 0;
/* "Extras" group: */
+ s->opt[OPT_EXTRAS_GROUP].name = "Extras";
s->opt[OPT_EXTRAS_GROUP].title = SANE_I18N ("Extras");
s->opt[OPT_EXTRAS_GROUP].desc = "";
s->opt[OPT_EXTRAS_GROUP].type = SANE_TYPE_GROUP;
@@ -5726,6 +5960,7 @@
s->opt[OPT_LAMP_OFF].constraint_type = SANE_CONSTRAINT_NONE;
s->val[OPT_LAMP_OFF].w = SANE_FALSE;
+ s->opt[OPT_SENSOR_GROUP].name = "sensors";
s->opt[OPT_SENSOR_GROUP].title = SANE_TITLE_SENSORS;
s->opt[OPT_SENSOR_GROUP].desc = SANE_DESC_SENSORS;
s->opt[OPT_SENSOR_GROUP].type = SANE_TYPE_GROUP;
@@ -5856,6 +6091,7 @@
s->last_val[OPT_NEED_CALIBRATION_SW].b = 0;
/* button group */
+ s->opt[OPT_BUTTON_GROUP].name = "buttons";
s->opt[OPT_BUTTON_GROUP].title = SANE_I18N ("Buttons");
s->opt[OPT_BUTTON_GROUP].desc = "";
s->opt[OPT_BUTTON_GROUP].type = SANE_TYPE_GROUP;
More information about the sane-devel
mailing list