dglent / meteo-qt

System tray application for weather status information
GNU General Public License v3.0
82 stars 21 forks source link

Crash due to translating first city right after adding #66

Closed pmattern closed 7 years ago

pmattern commented 7 years ago

Recent meteo-qt is crashing and dumping core when an attempt is made to translate the first city on a new user profile right after adding.

Steps to reproduce

  1. Make sure meteo-qt isn't running and $XDG_CONFIG_HOME/meteo-qt doesn't preexist. Launch meteo-qt and confirm the desktop notification informing that no city has been configured yet. Open the settings, file an OpenWeatherMap key in its form and hit "Apply".
  2. Open dialogue "Cities" ("meteo-qt" before 5284a59) by clicking the wrench right of form "City". Open dialogue "Find a city" ("meteo-qt" as well before 5284a59) by clicking "Add", add an arbitrary city as usual and leave the dialogue by clicking "OK". Back in dialogue "Cities" click "Translate" without taking any further action before. The last step will make meteo-qt crash and dump core.

5284a59 or c78082b on Arch Linux. Except some minor differences within the traces same findings within an LXQt and Xfce session. The problem can not be seen when dialogue "Cities" is closed by clicking "OK" without clicking "Translate" before. Once the dialogue was closed that way the crashes can no longer be provoked by adding additional cities according to "2." of the steps to reproduce.

Traces can be found in this GIST.

EDIT Reflect renaming of dialogue windows in question in 5284a59

dglent commented 7 years ago

I think that this happened because the unique city in the cities list is not selected by the mouse. When there are more cities this doesn't occur because there is one focused by default. I couldn't reproduced if i clicked on the city twice to translate it.

pmattern commented 7 years ago

I couldn't reproduced if i clicked on the city twice to translate it.

Sure. The crashes only take place following the steps depicted above. But they are 100% reproducible that way here.

I think that this happened because the unique city in the cities list is not selected by the mouse.

No, unlike I first thought as well this isn't involved. You can see this as follows

  1. Set up one or more cities as usual without provoking the crash we're discussing here. Restart meteo-qt.
  2. Open dialogue "Cities" from the settings. One of the cities will be marked by some semi-transparent highlighting. Open dialogue "City translation" by clicking button "Translate", leave this dialogue by clicking "Cancel" without taking any action.
  3. Back in dialogue "Cities" no city will be selected in any way. Yet clicking "Translate" does not trigger the crash.

Doesn't the CLI output in the GIST linked above suggest the problem is due to some variable not having assigned a value yet under the conditions in question?

dglent commented 7 years ago

I could reproduce it only in this case:

At all other cases the first city was activated by default by the dialogue.

pmattern commented 7 years ago

Yes, the crashes could only be seen under the conditions named above. But the problem can no longer be seen running d84a7bc here.

dglent commented 7 years ago

Ok, thanks very much for your help