Bug#487475: xsane: Control/menu selection problem with epson backends via net driver [patch]

2008-07-26 Thread Brad Sawatzky
On Fri, 25 Jul 2008, Julien BLACHE wrote: Glad you narrowed it down. I've been on vacation the last couple of weeks and had to put it on hold. Bad: - I think your patch may be the best option to fix this issue... - ... but I'm afraid it may be leaking memory [ . . . ] Could you rework

Bug#487475: xsane: Control/menu selection problem with epson backends via net driver [patch]

2008-07-26 Thread Julien BLACHE
Brad Sawatzky [EMAIL PROTECTED] wrote: Hi, Yeah, it will leak a few ten's of bytes every time that menu is constructed... I couldn't see a simple workaround but I'll take another look and see if I can rework the patch. I've done it in the meantime. I was investigating another fix without

Bug#487475: xsane: Control/menu selection problem with epson backends via net driver [patch]

2008-07-25 Thread Julien BLACHE
Brad Sawatzky [EMAIL PROTECTED] wrote: Hi, The patch fixes this problem by making a copy of the option name and setting menu_items[].label to point to the new string (removing xsane's dependence on a volatile memory structure). Good and bad news. Good: - I can reproduce the issue here (a

Bug#487475: xsane: Control/menu selection problem with epson backends via net driver [patch]

2008-07-10 Thread Julien BLACHE
Brad Sawatzky [EMAIL PROTECTED] wrote: Hi, What is the intent of duplicating s-opt into s-local_opt? If it is to provide a stable local version of the scanner descriptors then shouldn't Per the SANE standard, the descriptors have to remain available at the same location until the device is

Bug#487475: xsane: Control/menu selection problem with epson backends via net driver [patch]

2008-07-10 Thread Brad Sawatzky
On Thu, 10 Jul 2008, Julien BLACHE wrote: Brad Sawatzky [EMAIL PROTECTED] wrote: What is the intent of duplicating s-opt into s-local_opt? If it is to provide a stable local version of the scanner descriptors then shouldn't Per the SANE standard, the descriptors have to remain

Bug#487475: xsane: Control/menu selection problem with epson backends via net driver [patch]

2008-07-10 Thread Julien BLACHE
Brad Sawatzky [EMAIL PROTECTED] wrote: Hi, b) The pointer in the menu.label for the active source menu (in this case) is not being kept current. - FIX: Recreate/update the gtk menu and do a panel_rebuild every time the net backend changes the NON-local opt array (since that is the

Bug#487475: xsane: Control/menu selection problem with epson backends via net driver [patch]

2008-07-10 Thread Brad Sawatzky
On Thu, 10 Jul 2008, Julien BLACHE wrote: Brad Sawatzky [EMAIL PROTECTED] wrote: b) The pointer in the menu.label for the active source menu (in this case) is not being kept current. - FIX: Recreate/update the gtk menu and do a panel_rebuild every time the net backend

Bug#487475: xsane: Control/menu selection problem with epson backends via net driver [patch]

2008-07-10 Thread Julien BLACHE
Brad Sawatzky [EMAIL PROTECTED] wrote: Hi, AFAICT, the fact that the Source menu for other backends work at all over the netowrk is simply due to good fortune. It is indeed highly probable that the epson backend is a special case that exposes the bug. Per the SANE standard, the descriptors

Bug#487475: xsane: Control/menu selection problem with epson backends via net driver [patch]

2008-07-09 Thread Brad Sawatzky
On Sun, 22 Jun 2008, Julien BLACHE wrote: [ . . . ] Anything in the option descriptor can change after the backend tells the frontend to reload the options, and I think that's what you're seeing with gdb when the net backend refreshes the option descriptors. But the memory allocated by

Bug#487475: xsane: Control/menu selection problem with epson backends via net driver [patch]

2008-07-02 Thread Brad Sawatzky
On Wed, 25 Jun 2008, Julien BLACHE wrote: Brad Sawatzky [EMAIL PROTECTED] wrote: Up to that point, you're seeing the preferences loading code setting options in a loop, resetting the options each time a reload is called for by the backend, except for the options that caused a reload. In

Bug#487475: xsane: Control/menu selection problem with epson backends via net driver [patch]

2008-06-25 Thread Julien BLACHE
Brad Sawatzky [EMAIL PROTECTED] wrote: Hi, Up to that point, you're seeing the preferences loading code setting options in a loop, resetting the options each time a reload is called for by the backend, except for the options that caused a reload. In that code, XSane is not yet taking memory

Bug#487475: xsane: Control/menu selection problem with epson backends via net driver [patch]

2008-06-22 Thread Julien BLACHE
Brad Sawatzky [EMAIL PROTECTED] wrote: Hi, From what I found, I think it really is a bug in xsane. (xsane assumes a memory structure is static but this is not guaranteed when the network backend is used.) Thanks for spending time on this one! However I am a bit doubtful as to the origin of

Bug#487475: xsane: Control/menu selection problem with epson backends via net driver [patch]

2008-06-22 Thread Julien BLACHE
reassign 487475 libsane retitle 487475 libsane: net backend option descriptors handling incorrect, breaking SANE standard tags 487475 - patch merge 487475 307088 thanks Brad Sawatzky [EMAIL PROTECTED] wrote: The problem occurs in xsane when accessing an epson/epkowa driver through the network

Bug#487475: xsane: Control/menu selection problem with epson backends via net driver [patch]

2008-06-22 Thread Brad Sawatzky
On Sun, 22 Jun 2008, Julien BLACHE wrote: However I am a bit doubtful as to the origin of the bug. I'd expect the problem would manifest itself with other backends too. Yeah, I had though so too... AFAICT the opt pointer that xsane used was directed into a generic buffer that sanei_* used for

Bug#487475: xsane: Control/menu selection problem with epson backends via net driver [patch]

2008-06-22 Thread Julien BLACHE
Brad Sawatzky [EMAIL PROTECTED] wrote: Hi, I'll admit to getting a little lost in the sanei_* calls that do the dirty work though... That actually indicates you still have some sanity left :-) Anyway, yes, the string list in the option descriptors are not stable and can change over time,

Bug#487475: xsane: Control/menu selection problem with epson backends via net driver [patch]

2008-06-22 Thread Julien BLACHE
Brad Sawatzky [EMAIL PROTECTED] wrote: everything would just work. However, if you use gdb to break on writes to the memory location stored during the initial menu_items[i].label = str_list[i]; line (in the unpatched xsane-front-gtk.c:xsane_option_menu_new() function) you should find that it

Bug#487475: xsane: Control/menu selection problem with epson backends via net driver [patch]

2008-06-22 Thread Julien BLACHE
Brad Sawatzky [EMAIL PROTECTED] wrote: everything would just work. However, if you use gdb to break on writes to the memory location stored during the initial menu_items[i].label = str_list[i]; line (in the unpatched xsane-front-gtk.c:xsane_option_menu_new() function) you should find that it

Bug#487475: xsane: Control/menu selection problem with epson backends via net driver [patch]

2008-06-22 Thread Brad Sawatzky
OK, here's a summarized gdb session. Sorry about the length, I hope it's useful... I set a breakpoint on xsane_option_menu_new() and wait for my menu-item of interest (the source menu which should eventually contain Flatbed and Transparency Unit) to trigger. When the Flatbed menu item is

Bug#487475: xsane: Control/menu selection problem with epson backends via net driver [patch]

2008-06-21 Thread Brad Sawatzky
Package: xsane Version: 0.995-3 Severity: normal Tags: patch The problem occurs in xsane when accessing an epson/epkowa driver through the network backend. Trying to change options like binary/gray/color, resolutions, etc., in xsane results in a dialog box with 'Failed to set value of option