Обсуждение: Bug: Overwrites incorrect file

Поиск
Список
Период
Сортировка

Bug: Overwrites incorrect file

От
David Jarvis
Дата:
<b>Configuration</b><br />pgAdmin3<br />./configure --prefix=/usr/local<br />$ uname -a<br />Linux jaguar
2.6.32-22-generic#36-Ubuntu SMP Thu Jun 3 19:31:57 UTC 2010 x86_64 GNU/Linux<br /><br />$ psql --version<br />psql
(PostgreSQL)8.4.4<br /><br /><b>Reproduce the Problem</b><br /><ol><li>Create an empty directory; put some empty files
inside.<li>Makesome empty directories in the formerly empty directory.<li>In the following steps, make sure you use
thatempty directory created in step 1 or you might lose work.<br /><li>Click the "Execute arbitrary queries"
button<li>Typein some text<br /><li>Type: Alt-f<li>Type: a<li>Type: Alt-n<li>Type: joe.sql<li>Type: Alt-s<li>Repeat
steps2 - 7, but for step 6 use <b>joe2.sql</b><li>Type: Alt-f<li>Type: a<li>Click joe2.sql<li>Click
Save</ol><b>ExpectedResults</b><br />The file joe2.sql should contain some text.<br /><br /><b>Actual Results</b><br
/>Atthis point one of two things will happen:<br /><ul><li>another file in the same directory as joe2.sql will be
overwritten<li>pgadmin3will crash:</ul><div style="margin-left: 40px;">**<br
/>Gtk:ERROR:/build/buildd/gtk+2.0-2.20.1/gtk/gtkfilechooserdefault.c:8125:get_display_name_from_file_list:assertion
failed:(had_selection)<br /> Aborted<br /></div><br /><b>Addendum</b><br />Crashing is good. Overwriting other files
is...bad.<br /><br />This might not be a pgAdmin error. If it is not, please let me know where I should direct the
problem,as it is quite severe.<br /><br />Dave<br /><br /> 

Re: Bug: Overwrites incorrect file

От
David Jarvis
Дата:
Sorry, I shifted the sequence. The correct order is:
  1. Make some empty directories in the formerly empty directory.
  2. In the following steps, make sure you use that empty directory created in step 1 or you might lose work.
  3. Click the "Execute arbitrary queries" button
  4. Type in some text
  5. Type: Alt-f
  6. Type: a
  7. Type: Alt-n
  8. Type: joe.sql
  9. Type: Alt-s
  10. Repeat steps 4 - 9, but for step 8 use joe2.sql
  11. Type: Alt-f
  12. Type: a
  13. Click joe2.sql
  14. Click Save
Dave

Re: Bug: Overwrites incorrect file

От
Dave Page
Дата:
On Fri, Jun 25, 2010 at 9:29 AM, David Jarvis <thangalin@gmail.com> wrote:
> Sorry, I shifted the sequence. The correct order is:
>
> Make some empty directories in the formerly empty directory.
> In the following steps, make sure you use that empty directory created in
> step 1 or you might lose work.
> Click the "Execute arbitrary queries" button
> Type in some text
> Type: Alt-f
> Type: a
> Type: Alt-n
> Type: joe.sql
> Type: Alt-s
> Repeat steps 4 - 9, but for step 8 use joe2.sql
> Type: Alt-f
> Type: a
> Click joe2.sql
> Click Save

First off, what version of pgAdmin is this? It certainly doesn't seem
to be 1.12.x. It looks like it might be 1.10, but I can't see what
pressing Alt-n is supposed to do in a Save As dialog (it does nothing
here in CentOS 5).

Ignoring the Alt-n issue, it works as I'd expect here.


-- 
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise Postgres Company


Re: Bug: Overwrites incorrect file

От
David Jarvis
Дата:
Alt-n focuses the cursor to the Name field.<br /><br />pgAdmin v1.10.3<br /><br />Dave<br /><br />

Re: Bug: Overwrites incorrect file

От
Dave Page
Дата:
On Fri, Jun 25, 2010 at 11:20 AM, David Jarvis <thangalin@gmail.com> wrote:
> Alt-n focuses the cursor to the Name field.
>
> pgAdmin v1.10.3

I can't find anything wrong when following your instructions. It
always updates the file that is named/selected.

Does the 'overwrite file?' warning show the correct filename?

-- 
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise Postgres Company


Re: Bug: Overwrites incorrect file

От
David Jarvis
Дата:
Hi,<br /><br />Here is the sequence of events:<br /><br /><div style="margin-left: 40px;"><a
href="http://i.imgur.com/2MCY4.png">http://i.imgur.com/2MCY4.png</a><br/></div><br />Dave<br /><br /> 

Re: Bug: Overwrites incorrect file

От
Dave Page
Дата:
On Fri, Jun 25, 2010 at 12:06 PM, David Jarvis <thangalin@gmail.com> wrote:
> Hi,
>
> Here is the sequence of events:
>
> http://i.imgur.com/2MCY4.png

"image not found"


-- 
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise Postgres Company


Re: Bug: Overwrites incorrect file

От
David Jarvis
Дата:
I am very off my game tonight, my apologies once more.<br /><br /><div style="margin-left: 40px;"><a
href="http://imgur.com/y5CCl">http://imgur.com/y5CCl</a><br/></div><br />Dave<br /><br /> 

Re: Bug: Overwrites incorrect file

От
Dave Page
Дата:
On Fri, Jun 25, 2010 at 12:08 PM, David Jarvis <thangalin@gmail.com> wrote:
> I am very off my game tonight, my apologies once more.
>
> http://imgur.com/y5CCl

I certainly don't see anything like that. Anyone else?

-- 
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise Postgres Company


Re: Bug: Overwrites incorrect file

От
David Jarvis
Дата:
I haven't been able to track down what file it picks "at random". At first I thought it was an off-by-one error because
itseemed to pick the file (or directory) above the one I selected. In this case, "work".<br /><br />However, the more I
lookedinto it, no pattern emerged.<br /><br />Either way, it should not have selected the <b>.openshot</b> folder when
Iasked it to select the plr_stations SQL file. :-)<br /><br />Let me know if there's anything else I can do to help --
tomorrow.<br/><br />Good night!<br />Dave<br /><br /> 

Re: Bug: Overwrites incorrect file

От
Guillaume Lelarge
Дата:
Le 25/06/2010 13:10, Dave Page a écrit :
> On Fri, Jun 25, 2010 at 12:08 PM, David Jarvis <thangalin@gmail.com> wrote:
>> I am very off my game tonight, my apologies once more.
>>
>> http://imgur.com/y5CCl
> 
> I certainly don't see anything like that. Anyone else?
> 

I tried tonight a few times. I don't see any issue, the behaviour seems
right to me. I don't have the issue mentioned by David. FYI, I checked
on Linux (Xubuntu 10.04, with XFCE 4.6).


-- 
Guillaumehttp://www.postgresql.frhttp://dalibo.com


Re: Bug: Overwrites incorrect file

От
David Jarvis
Дата:
Hi,<br /><br />I compiled a debug version of pgAdmin3. The problem still happens. I have not yet made it crash, but it
continuallyuses the previous file (or directory) in the dialog. The ldd:<br /><br />        linux-vdso.so.1 => 
(0x00007fff8bbff000)<br/>         libkrb5.so.3 => /usr/lib/libkrb5.so.3 (0x00007f1e3ca96000)<br />       
libwx_gtk2ud_stc-2.8.so.0=> /usr/lib/libwx_gtk2ud_stc-2.8.so.0 (0x00007f1e3c791000)<br />       
libwx_gtk2ud_ogl-2.8.so.0=> /usr/lib/libwx_gtk2ud_ogl-2.8.so.0 (0x00007f1e3c524000)<br />        
libwx_gtk2ud_richtext-2.8.so.0=> /usr/lib/libwx_gtk2ud_richtext-2.8.so.0 (0x00007f1e3c226000)<br />       
libwx_gtk2ud_aui-2.8.so.0=> /usr/lib/libwx_gtk2ud_aui-2.8.so.0 (0x00007f1e3bfa8000)<br />       
libwx_gtk2ud_xrc-2.8.so.0=> /usr/lib/libwx_gtk2ud_xrc-2.8.so.0 (0x00007f1e3bcfd000)<br />        
libwx_gtk2ud_qa-2.8.so.0=> /usr/lib/libwx_gtk2ud_qa-2.8.so.0 (0x00007f1e3bad9000)<br />       
libwx_gtk2ud_html-2.8.so.0=> /usr/lib/libwx_gtk2ud_html-2.8.so.0 (0x00007f1e3b820000)<br />       
libwx_gtk2ud_adv-2.8.so.0=> /usr/lib/libwx_gtk2ud_adv-2.8.so.0 (0x00007f1e3b52d000)<br />        
libwx_gtk2ud_core-2.8.so.0=> /usr/lib/libwx_gtk2ud_core-2.8.so.0 (0x00007f1e3aec6000)<br />       
libwx_baseud_xml-2.8.so.0=> /usr/lib/libwx_baseud_xml-2.8.so.0 (0x00007f1e3acb9000)<br />       
libwx_baseud_net-2.8.so.0=> /usr/lib/libwx_baseud_net-2.8.so.0 (0x00007f1e3aa86000)<br />        
libwx_baseud-2.8.so.0=> /usr/lib/libwx_baseud-2.8.so.0 (0x00007f1e3a6f7000)<br />        libxml2.so.2 =>
/usr/lib/libxml2.so.2(0x00007f1e3a3a7000)<br />        libxslt.so.1 => /usr/lib/libxslt.so.1 (0x00007f1e3a16b000)<br
/>        libpq.so.5 => /usr/lib/libpq.so.5 (0x00007f1e39f43000)<br />        libstdc++.so.6 =>
/usr/lib/libstdc++.so.6(0x00007f1e39c2f000)<br />        libm.so.6 => /lib/libm.so.6 (0x00007f1e399ab000)<br
/>       libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00007f1e39794000)<br />         libpthread.so.0 =>
/lib/libpthread.so.0(0x00007f1e39577000)<br />        libc.so.6 => /lib/libc.so.6 (0x00007f1e391f4000)<br />       
libk5crypto.so.3=> /usr/lib/libk5crypto.so.3 (0x00007f1e38fce000)<br />        libcom_err.so.2 =>
/lib/libcom_err.so.2(0x00007f1e38dca000)<br />         libkrb5support.so.0 => /usr/lib/libkrb5support.so.0
(0x00007f1e38bc1000)<br/>        libkeyutils.so.1 => /lib/libkeyutils.so.1 (0x00007f1e389be000)<br />       
libresolv.so.2=> /lib/libresolv.so.2 (0x00007f1e387a5000)<br />         libgtk-x11-2.0.so.0 =>
/usr/lib/libgtk-x11-2.0.so.0(0x00007f1e38182000)<br />        libgdk-x11-2.0.so.0 => /usr/lib/libgdk-x11-2.0.so.0
(0x00007f1e37ed5000)<br/>        libatk-1.0.so.0 => /usr/lib/libatk-1.0.so.0 (0x00007f1e37cb4000)<br />        
libpangoft2-1.0.so.0=> /usr/lib/libpangoft2-1.0.so.0 (0x00007f1e37a89000)<br />        libgdk_pixbuf-2.0.so.0 =>
/usr/lib/libgdk_pixbuf-2.0.so.0(0x00007f1e3786d000)<br />        libgio-2.0.so.0 => /usr/lib/libgio-2.0.so.0
(0x00007f1e375ba000)<br/>         libpango-1.0.so.0 => /usr/lib/libpango-1.0.so.0 (0x00007f1e3736f000)<br />       
libfreetype.so.6=> /usr/lib/libfreetype.so.6 (0x00007f1e370e9000)<br />        libfontconfig.so.1 =>
/usr/lib/libfontconfig.so.1(0x00007f1e36eb4000)<br />         libgobject-2.0.so.0 => /usr/lib/libgobject-2.0.so.0
(0x00007f1e36c6b000)<br/>        libgmodule-2.0.so.0 => /usr/lib/libgmodule-2.0.so.0 (0x00007f1e36a67000)<br
/>       libgthread-2.0.so.0 => /usr/lib/libgthread-2.0.so.0 (0x00007f1e36862000)<br />         librt.so.1 =>
/lib/librt.so.1(0x00007f1e36659000)<br />        libglib-2.0.so.0 => /lib/libglib-2.0.so.0 (0x00007f1e3637b000)<br
/>       libXinerama.so.1 => /usr/lib/libXinerama.so.1 (0x00007f1e36178000)<br />         libSM.so.6 =>
/usr/lib/libSM.so.6(0x00007f1e35f6e000)<br />        libpng12.so.0 => /lib/libpng12.so.0 (0x00007f1e35d47000)<br
/>       libz.so.1 => /lib/libz.so.1 (0x00007f1e35b30000)<br />        libjpeg.so.62 => /usr/lib/libjpeg.so.62
(0x00007f1e3590b000)<br/>         libtiff.so.4 => /usr/lib/libtiff.so.4 (0x00007f1e356a9000)<br />        libdl.so.2
=>/lib/libdl.so.2 (0x00007f1e354a5000)<br />        libexpat.so.1 => /lib/libexpat.so.1 (0x00007f1e3527a000)<br
/>       libssl.so.0.9.8 => /lib/libssl.so.0.9.8 (0x00007f1e3502a000)<br />         libcrypto.so.0.9.8 =>
/lib/libcrypto.so.0.9.8(0x00007f1e34c99000)<br />        libgssapi_krb5.so.2 => /usr/lib/libgssapi_krb5.so.2
(0x00007f1e34a65000)<br/>        libcrypt.so.1 => /lib/libcrypt.so.1 (0x00007f1e3482c000)<br />        
libldap_r-2.4.so.2=> /usr/lib/libldap_r-2.4.so.2 (0x00007f1e345df000)<br />        /lib64/ld-linux-x86-64.so.2
(0x00007f1e3cd81000)<br/>        libXext.so.6 => /usr/lib/libXext.so.6 (0x00007f1e343cd000)<br />       
libXrender.so.1=> /usr/lib/libXrender.so.1 (0x00007f1e341c2000)<br />         libXi.so.6 => /usr/lib/libXi.so.6
(0x00007f1e33fb2000)<br/>        libXrandr.so.2 => /usr/lib/libXrandr.so.2 (0x00007f1e33da9000)<br />       
libXcursor.so.1=> /usr/lib/libXcursor.so.1 (0x00007f1e33b9e000)<br />         libpangocairo-1.0.so.0 =>
/usr/lib/libpangocairo-1.0.so.0(0x00007f1e33991000)<br />        libX11.so.6 => /usr/lib/libX11.so.6
(0x00007f1e3365b000)<br/>        libXcomposite.so.1 => /usr/lib/libXcomposite.so.1 (0x00007f1e33457000)<br />
       libXdamage.so.1 => /usr/lib/libXdamage.so.1 (0x00007f1e33254000)<br />        libXfixes.so.3 =>
/usr/lib/libXfixes.so.3(0x00007f1e3304e000)<br />        libcairo.so.2 => /usr/lib/libcairo.so.2
(0x00007f1e32dca000)<br/>         libpcre.so.3 => /lib/libpcre.so.3 (0x00007f1e32b9c000)<br />       
libselinux.so.1=> /lib/libselinux.so.1 (0x00007f1e3297d000)<br />        libICE.so.6 => /usr/lib/libICE.so.6
(0x00007f1e32762000)<br/>        libuuid.so.1 => /lib/libuuid.so.1 (0x00007f1e3255c000)<br />        
liblber-2.4.so.2=> /usr/lib/liblber-2.4.so.2 (0x00007f1e3234e000)<br />        libsasl2.so.2 =>
/usr/lib/libsasl2.so.2(0x00007f1e32133000)<br />        libgnutls.so.26 => /usr/lib/libgnutls.so.26
(0x00007f1e31e91000)<br/>         libxcb.so.1 => /usr/lib/libxcb.so.1 (0x00007f1e31c74000)<br />       
libpixman-1.so.0=> /usr/lib/libpixman-1.so.0 (0x00007f1e31a1b000)<br />        libdirectfb-1.2.so.0 =>
/usr/lib/libdirectfb-1.2.so.0(0x00007f1e31798000)<br />         libfusion-1.2.so.0 => /usr/lib/libfusion-1.2.so.0
(0x00007f1e3158d000)<br/>        libdirect-1.2.so.0 => /usr/lib/libdirect-1.2.so.0 (0x00007f1e31374000)<br />       
libxcb-render-util.so.0=> /usr/lib/libxcb-render-util.so.0 (0x00007f1e31170000)<br />         libxcb-render.so.0
=>/usr/lib/libxcb-render.so.0 (0x00007f1e30f66000)<br />        libtasn1.so.3 => /usr/lib/libtasn1.so.3
(0x00007f1e30d55000)<br/>        libgcrypt.so.11 => /lib/libgcrypt.so.11 (0x00007f1e30adc000)<br />        
libXau.so.6=> /usr/lib/libXau.so.6 (0x00007f1e308d8000)<br />        libXdmcp.so.6 => /usr/lib/libXdmcp.so.6
(0x00007f1e306d2000)<br/>        libgpg-error.so.0 => /lib/libgpg-error.so.0 (0x00007f1e304cd000)<br /><br />I have
pgadmin3loaded up in ddd. If someone wants to tell me where I should set a break-point, that would be great.<br /><br
/>Dave<br/><br /> 

Re: Bug: Overwrites incorrect file

От
David Jarvis
Дата:
Try this:<br /><ol><li>cd $HOME<li>touch <b>.xsession-errors</b><li>pgadmin3<li>Connect to a database<li>Click on
tables<li>Clickthe Execute arbitrary statements button<li>Type some text<li> Save as ... test.sql</ol>Next:<br
/><ol><li>Type<b>Alt-f</b><li>Type <b>a</b><li>Click test.sql<li>Click Save<li>Click Replace</ol>You should now receive
anerror that the file could not be saved (because you are saving over a directory) <b>OR</b> it will overwrite an
existingfile..<br /><br />If the file .xsession-errors is in the same directory that you are saving, the save as
routinewill "randomly" select a different file to save over.<br /><br />I discovered this by:<br /><ol><li>Saving the
fileinto <b>/tmp</b>: there was no error.<li>Recreating all of the hidden "dot" subdirectories from $HOME directory
into<b>/home/temp</b>.<li>Saving the file into <b>/home/temp</b>; there was no error.<br /></ol>This meant that the
maindifference was that there are hidden "dot" files in $HOME but not in <b>/home/temp</b>. (Admittedly, it could have
beena combination of dot directories, dot files, the number of files, or some weird sum of name lengths issue.)<br
/><br/>I then noticed I had a 100k .xsession-errors file in $HOME that I did not need. After I deleted it, I could no
longerrecreate the bug. Certainly more than a coincidence. ;-)<br /><br />Dave<br /><br /> 

Re: Bug: Overwrites incorrect file

От
Guillaume Lelarge
Дата:
Le 27/06/2010 02:21, David Jarvis a écrit :
> Try this:
> 
>    1. cd $HOME
>    2. touch *.xsession-errors*
>    3. pgadmin3
>    4. Connect to a database
>    5. Click on tables
>    6. Click the Execute arbitrary statements button
>    7. Type some text
>    8. Save as ... test.sql
> 
> Next:
> 
>    1. Type *Alt-f*
>    2. Type *a*
>    3. Click test.sql
>    4. Click Save
>    5. Click Replace
> 
> You should now receive an error that the file could not be saved
> (because you are saving over a directory) *OR* it will overwrite an
> existing file..
> 
> If the file .xsession-errors is in the same directory that you are
> saving, the save as routine will "randomly" select a different file to
> save over.
> 
> I discovered this by:
> 
>    1. Saving the file into */tmp*: there was no error.
>    2. Recreating all of the hidden "dot" subdirectories from $HOME
>       directory into */home/temp*.
>    3. Saving the file into */home/temp*; there was no error.
> 
> This meant that the main difference was that there are hidden "dot"
> files in $HOME but not in */home/temp*. (Admittedly, it could have been
> a combination of dot directories, dot files, the number of files, or
> some weird sum of name lengths issue.)
> 
> I then noticed I had a 100k .xsession-errors file in $HOME that I did
> not need. After I deleted it, I could no longer recreate the bug.
> Certainly more than a coincidence. ;-)
> 

Tried it, worked fine to me.


-- 
Guillaumehttp://www.postgresql.frhttp://dalibo.com


Re: Bug: Overwrites incorrect file

От
David Jarvis
Дата:
Salut, Guillaume.<br /><br />$ ls -la $(which pgadmin3)<br />-rwxr-xr-x 1 root root 45324803 2010-06-26 16:26
/usr/local/bin/pgadmin3<br/><br />That was built using:<br /><br /><div style="margin-left: 40px;">./configure
--prefix=/usr/local--enable-debug<br /> make && make install<br /></div><br />I have posted my debug build at
(16MB):<br/><br /><div style="margin-left: 40px;"><a
href="http://whitemagicsoftware.com/pgadmin3.gz">http://whitemagicsoftware.com/pgadmin3.gz</a><br/></div><br />The
binaryis shared (not static) because I am missing the static version of wxWidgets.<br /><br />I wonder if it's strictly
aproblem with the GTK libraries used by Kubuntu 10.04?<br /><br />I can reproduce the problem 100% of the time on my
machine.Are there any particular versions of libraries (relating to that dialog box) that I should have installed?<br
/><br/>Dave<br /><br /> 

Re: Bug: Overwrites incorrect file

От
Guillaume Lelarge
Дата:
Le 27/06/2010 12:14, David Jarvis a écrit :
> Salut, Guillaume.
> 

Hi David :)

> $ ls -la $(which pgadmin3)
> -rwxr-xr-x 1 root root 45324803 2010-06-26 16:26 /usr/local/bin/pgadmin3
> 
> That was built using:
> 
> ./configure --prefix=/usr/local --enable-debug
> make && make install
> 
> I have posted my debug build at (16MB):
> 
> http://whitemagicsoftware.com/pgadmin3.gz
> 
> The binary is shared (not static) because I am missing the static
> version of wxWidgets.
> 
> I wonder if it's strictly a problem with the GTK libraries used by
> Kubuntu 10.04?
> 
> I can reproduce the problem 100% of the time on my machine. Are there
> any particular versions of libraries (relating to that dialog box) that
> I should have installed?
> 

I tried your debug binary and it works correctly on my Xubuntu. A test
you can do is try your binary on Gnome.


-- 
Guillaumehttp://www.postgresql.frhttp://dalibo.com


Re: Bug: Overwrites incorrect file

От
David Jarvis
Дата:
Hi,<br /><br />Cannot install Gnome, sorry.<br /><br />Any other way to isolate the cause?<br /><br />Dave<br /><br />

Re: Bug: Overwrites incorrect file

От
Guillaume Lelarge
Дата:
Le 27/06/2010 22:20, David Jarvis a écrit :
> Hi,
> 
> Cannot install Gnome, sorry.
> 
> Any other way to isolate the cause?
> 

Sorry, I don't see another one. It works without any issues on 1.10.3+
and 1.12beta2+ on my linux.


-- 
Guillaumehttp://www.postgresql.frhttp://dalibo.com