Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when switching to "Browse Data" #2288

Closed
8 tasks
th opened this issue Jun 18, 2020 · 26 comments
Closed
8 tasks

Crash when switching to "Browse Data" #2288

th opened this issue Jun 18, 2020 · 26 comments
Assignees
Labels
bug Confirmed bugs or reports that are very likely to be bugs.
Milestone

Comments

@th
Copy link

th commented Jun 18, 2020

Details for the issue

What did you do?

Loaded my project file, which starts me in the Execute SQL view. Clicked on the Brose Data Tab.

I could share the project file (and SQLite database), but don't want to make it publically available on GitHub.

It's an SQLite database with less than 2000 rows. I have added a view that picks out about zero to thirty rows (depending on the current day):

CREATE VIEW eligible as SELECT * FROM entries WHERE date < date('now','-28 months') OR (date < date('now','-6 months') AND (leaveout = 'FALSE')) ORDER BY date ASC

I can query in the Execute SQL tab using SELECT * FROM eligible limit 2; without problems.

I also have two triggers:

CREATE TRIGGER eligible_change_leaveout
INSTEAD OF UPDATE OF leaveout ON eligible
BEGIN
UPDATE submissions SET leaveout=NEW.leaveout
WHERE id=NEW.id;
END

CREATE TRIGGER eligible_change_date
INSTEAD OF UPDATE OF date ON eligible
BEGIN
UPDATE submissions SET date=NEW.date
WHERE id=NEW.id;
END

What did you expect to see?

My data, starting in a view I have added and used previously.

What did you see instead?

The application crashes without any error message.

Useful extra information

The info below often helps, please fill it out if you're able to. :)

What operating system are you using?

  • [X ] Windows: ( version: 10 H2___ )
  • Linux: ( distro: ___ )
  • macOS: ( version: ___ )
  • Other: ___

What is your DB4S version?

  • [X ] 3.12.0-(release)
  • 3.11.2
  • 3.11.1
  • 3.10.1
  • Other: ___

Did you also

@justinclift justinclift added the bug Confirmed bugs or reports that are very likely to be bugs. label Jun 18, 2020
@justinclift
Copy link
Member

Ouch. Ok, you're welcome to email the database and project file to me (justin@postgresql.org), and I can forward it to whichever of our developers wants to pick this up. 😄

@chrisjlocke
Copy link
Member

Just as a 'see what breaks', what happens if you create a copy of the database without the triggers, open the database (not a project file) and browse the data - is that all good?
What happens if you keep the triggers, open the database, then browse the data?
What happens if you ... etc. If you haven't got time for that, feel free to email me the database / project file at db4s [at] chrisjlocke.co.uk. While I'm not a developer per se, I have the time to fiddle and find out where its breaking to pass on to someone who knows more.... 😃

@justinclift
Copy link
Member

@th Thanks, received the files. I've just forwarded them to @chrisjlocke so he can experiment with them. 😄

@chrisjlocke
Copy link
Member

👍

@chrisjlocke
Copy link
Member

chrisjlocke commented Jun 18, 2020

Well, its reproducible. The information from WinDbg isn't that hot though.

ModLoad: 5d280000 5d30b000   C:\Windows\SysWOW64\Windows.StateRepositoryPS.dll
shell\comdlg32\fileopensave.cpp(14414)\COMDLG32.dll!76AB700A: (caller: 76AE7641) ReturnHr(1) tid(403c) 80004005 Unspecified error
    CallContext:[\PickerModalLoop] 
ModLoad: 0b490000 0b734000   C:\WINDOWS\SysWOW64\MsftEdit.dll
ModLoad: 0b490000 0b734000   C:\WINDOWS\SysWOW64\MsftEdit.dll
ModLoad: 63e60000 63e8b000   C:\WINDOWS\SysWOW64\xmllite.dll
ModLoad: 79860000 798ec000   C:\WINDOWS\SysWOW64\wpdshext.dll
ModLoad: 6ff30000 70099000   C:\WINDOWS\WinSxS\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.18362.900_none_5f56e39582231feb\gdiplus.dll
ModLoad: 799b0000 799f0000   C:\WINDOWS\SysWOW64\audiodev.dll
ModLoad: 799f0000 79bfd000   C:\WINDOWS\SysWOW64\WMVCore.DLL
ModLoad: 5e3d0000 5e4d6000   C:\WINDOWS\SysWOW64\mfperfhelper.dll
ModLoad: 79c00000 79c3d000   C:\WINDOWS\SysWOW64\WMASF.DLL
shell\comdlg32\fileopensave.cpp(14414)\COMDLG32.dll!76AB700A: (caller: 76AE7641) ReturnHr(2) tid(403c) 80004005 Unspecified error
    CallContext:[\PickerModalLoop] 
(758.403c): Access violation - code c0000005 (first chance)
First chance exceptions are reported before any exception handling.
This exception may be expected and handled.
eax=0c0aa708 ebx=04aa09d0 ecx=04aa0ba8 edx=00000000 esi=00000000 edi=04f98204
eip=00c2a026 esp=0133c23c ebp=0133c270 iopl=0         nv up ei ng nz ac po cy
cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00210293
DB_Browser_for_SQLite+0x10a026:
00c2a026 ff7610          push    dword ptr [esi+10h]  ds:002b:00000010=????????

Call stack:
image

I might need a version that outputs debug info (preferably to a file and not the console though, as that doesn't work too well when running the actual application)

When opening the project file, table 'submissions' shows no records (0 - 0 of 0) with no filters applied. By opening the database itself, it shows 1847 rows.
When opening the project file, any attempt to view the view 'eligible' crashes DB4S (with no error). By opening the database itself, this view opens fine with 15 rows.

Opening the project file, saving it, closing the current one and opening the new one has no effect.
Viewing the view in the Execute SQL tab works fine.
4 low flying helicopters just went overhead! Exciting. Red Arrows due later too. Nice day.
Anyway.
Created a new view (using the 'copy create statement' of the original view) and that worked. Saved the project. Reloaded, and still worked. HOWEVER.
Deleted old view, renamed copy (eligible2) to the old name (eligible) and the crash returned.

An integrity check of the database passed.

As a side note (I haven't human-read the project file yet) when I open the project file, DB4S asks for the database to use. It doesn't do that when I save it and reload it. I assume this is by design.
It is, so shut up Chris.

As another side note, open the project file, and it'll open. Immediately open it again and it'll crash.
https://vimeo.com/430390533
I just created a new database, saved that to a new project, and couldn't replicate this error, so its something in this project file.

@th - If you open the database itself, all should be good. You can open more than one copy of DB4S at the same time, so work on the project file in one copy and browse the table in another copy. Not ideal in the slightest, but a hacky workaround until this is fixed.

@scottfurry
Copy link
Contributor

scottfurry commented Jun 18, 2020

Been a while since I debugged Win apps, but...

shell\comdlg32\fileopensave.cpp(14414)\COMDLG32.dll!76AB700A: (caller: 76AE7641) ReturnHr(1) tid(403c) 80004005 Unspecified error
    CallContext:[\PickerModalLoop] 

... COMDLG is the Windows common dialog dll. Suffixed w/ 32 means it's the 32 bit variant. This leaves me with the impression there's mixing of 32 bit/64 bit libraries happening.
Was QT built with correct instructions vis a vis 64 bit application?

@scottfurry
Copy link
Contributor

scottfurry commented Jun 18, 2020

As a sidebar to this....
On the linux side, when I was debugging things, I got the following:

QFont::fromString: Invalid description '(empty)'

when running latest and switching from/to the Browse tab. It wasn't a priority for me at the moment and I was going to come back to root out the source. Seems relevant in these circumstances.

@chrisjlocke
Copy link
Member

Was QT built with correct instructions vis a vis 64 bit application?

Good point. I had tested with only the 32bit version of DB4S, but just tried again, and the crash still occurs if I use the 64bit version.

@justinclift
Copy link
Member

Forwarded the database bits to @MKleusberg as well. 😄

MKleusberg added a commit that referenced this issue Jun 19, 2020
Fix loading of project files with empty filter values. If an empty
filter value was saved in a project file, it did not show up in the UI
but was partially added to the query anyway. This lead to an invalid
query with no results.

Also fix a possible loophole which at least in theory could lead to an
empty filter value being stored in the project file.

See issue #2288.
@MKleusberg
Copy link
Member

Unfortunately it doesn't crash on my system. So it might be a Windows thing after all. I did however also notice that you don't see any rows in the view. This was because of some empty values for the filter in the project file and it's fixed now.I don't think this leads to the crash but it's still worth trying the next nightly build and see if that changes anything.

@th
Copy link
Author

th commented Jun 21, 2020

I just tried the nightly (Windows, 64 bit, zip) from 2020-06-21, and everything works as expected on first glance.

Thank you!

@justinclift
Copy link
Member

@th Just to confirm... it's no longer crashing for you?

@th
Copy link
Author

th commented Jun 22, 2020

That's correct.

@justinclift
Copy link
Member

justinclift commented Jun 22, 2020

Awesome. 😄

@MKleusberg Good work. Sounds like we'd better include that patch in 3.12.1.

@justinclift justinclift added this to the 3.12.1 milestone Jun 22, 2020
MKleusberg added a commit that referenced this issue Jun 23, 2020
Fix loading of project files with empty filter values. If an empty
filter value was saved in a project file, it did not show up in the UI
but was partially added to the query anyway. This lead to an invalid
query with no results.

Also fix a possible loophole which at least in theory could lead to an
empty filter value being stored in the project file.

See issue #2288.
@MKleusberg
Copy link
Member

@justinclift Definitely 😄 I've just cherry-picked the commit to the v3.12.x branch.

@scottfurry
Copy link
Contributor

Maybe associated (or I'm conflating issues):

I tried latest (Linux x86_64) and the error message of QFont::fromString: Invalid description '(empty)' is still appearing. However, it only shows when opening a DB file and switching to the Browse tab or when closing a DB file.

@justinclift
Copy link
Member

@scottfurry Sounds like that string error needs further debugging work, to figure out exactly wtf is causing it. 😦

Not sure if it's this issue, but probably good to get it resolved from a safety point of view just in case?

@MKleusberg
Copy link
Member

@scottfurry I can't reproduce this message. Can you maybe give me a step by step explanation of what you're doing and at what exact step the message appears. Maybe this helps narrowing this down even if it doesn't happen on my system 😄

@scottfurry
Copy link
Contributor

@MKleusberg - Not doing anything fancy.
Build w/ external libraries enabled and SQLCipher. Qt Version 5.14.2. Start from command line. Open any DB file. Switch to "Browse" tab(get error message on console). Error appears again when closing DB file.

MKleusberg added a commit that referenced this issue Jul 1, 2020
When the index of the selected cell is invalid, i.e. no cell is
selected, we cannot retrieve the font of the selected cell. Trying to
look up the empty font name for updating the font combo box in the
Format toolbar then fails, outputting a warning with some Qt versions.

See issue #2288.
@MKleusberg
Copy link
Member

@scottfurry Thanks for the extra details! Can you check tomorrow's nightly build and see if the warning disappears? It's definitely a completely harmless warning though 😄

@scottfurry
Copy link
Contributor

Still seeing QFont::fromString: Invalid description '(empty)' on master branch.

@scottfurry
Copy link
Contributor

Using latest repo master, this problem seems to have disappeared. I suspect that something done to resolve #2310 may have fixed this one. I'm good to close this if there is no objections.

@justinclift
Copy link
Member

Is #2310 the right one? Looking at that, there doesn't seem to be any (even tentative) commits to fix it yet?

@scottfurry
Copy link
Contributor

scottfurry commented Jul 4, 2020

Not sure exactly what but something in the last 3 days fixed it.
Looks like this commit ea6d008 fixed the issue.

@justinclift
Copy link
Member

Cool. 😄

@MKleusberg
Copy link
Member

Yep, that was the commit which I thought should fix it 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed bugs or reports that are very likely to be bugs.
Projects
None yet
Development

No branches or pull requests

5 participants