-
-
Notifications
You must be signed in to change notification settings - Fork 91
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
Memory corruption crashes every few days #319
Comments
As a curious user considering migrating from xbar, can I ask: when it crashes, do the icons disappear from your menubar (i.e. SwiftBar is completely gone/stopped) or is it just that it stops updating? I'm asking because I'm motivated to move by xbar issue #714 ("Crashing after a large number of refreshes") and there's no point migrating if the same behaviour occurs here! I'd be surprised if it is the same error, but wanted to check. 😄 |
@gimbo It crashes and the items leave the menubar. An older version (1.4.1 iirc) had an issue where items stopped updating, but that was fixed and I haven't had any problems with updating since. |
I'm trying to catch this in a debug session, I've been running 3 simple plugins with 5s refresh period for a week and a half now... no luck. I'll try to have more complex plugins and somehow trigger sleep-wake. Stay tuned... |
@joeshaw can you share with me any of your plugins? So far SwiftBar is solid for me, with two caveats:
|
Similar experience here - two SIGSEGV crashes this week, on 1.4.3 (422), on M1 running 12.4. |
@bobobox plz give me an example plugin, I can't catch this |
I run 3, but I can only give you two of them.
#!/bin/bash
exec date -u +':globe: %H:%M | size=13'
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
)
type result struct {
Chart struct {
Result []struct {
Meta struct {
Symbol string `json:"symbol"`
Price float64 `json:"regularMarketPrice"`
PrevPrice float64 `json:"chartPreviousClose"`
} `json:"meta"`
} `json:"result"`
} `json:"chart"`
}
const urlFmt = "https://query1.finance.yahoo.com/v7/finance/chart/%s?interval=1d"
func main() {
symbols := []string{"AAPL", "^SPX"}
for i, s := range symbols {
u := fmt.Sprintf(urlFmt, s)
resp, err := http.Get(u)
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
log.Fatal(err)
}
if resp.StatusCode != http.StatusOK {
log.Fatalf("%d: %s", resp.StatusCode, body)
}
var r result
if err := json.Unmarshal(body, &r); err != nil {
log.Fatalf("%v: %s", err, body)
}
price := r.Chart.Result[0].Meta.Price
prev := r.Chart.Result[0].Meta.PrevPrice
net := price - prev
pct := net / prev * 100
var arrow string
if net > 0 {
arrow = "↑"
} else if net < 0 {
arrow = "↓"
}
if i == 0 {
fmt.Printf("%s $%.2f%s | size=13\n", s, price, arrow)
fmt.Println("---")
}
fmt.Printf("%s %.2f %+.2f (%+.2f%%)\n", s, price, net, pct)
}
} The third is another Go program that runs every 5s. Unfortunately I can't share that one. |
@joeshaw hey, I think I'm ready to give up... I've been running these two plugins on two different machines(Intel and M1) for two weeks straight, with at least 20 sleep-wake cycle on both of them. It just works.🤷♂️ |
@melonamin Is there anything more I can do to help? A debugging build, additional logs, anything like that? I appreciate your effort trying to reproduce it so far. |
I’m researching how to add a better crash reporting at the moment |
@joeshaw I've added crash reportiing, please try running this build SwiftBar.1.4.4b448.zip |
Just as an FYI, I've been running this build for about a week now without any crashes. I'll update if and when I see one. |
Hey @adamkdean, since you are expiriencing a simmilar issue in xbar, I would love you to take this build of SwiftBar for a spin. |
@melonamin once I'm done with testing xbar, I'll give SwiftBar a whirl too and get back to you |
@joeshaw please tell me it's been rock solid for you all this time, I want to release 1.4.4 soon-ish |
@melonamin No issues here. I feel comfortable with it, and I think you can probably close this issue now. I'll reopen it or file another if I start seeing the issue again. I'm sorry we couldn't precisely identify it! |
Describe the bug
I have been seeing SwiftBar crashes (either SIGSEGV or SIGABRT) due to memory corruption.
I haven't been able to detect a consistent pattern with the crashes. They seem to happen every couple of days, typically after I've put my machine to sleep. They seem to happen when my machine does a macOS "power nap" wakeup, though I am not certain on that.
I'm attaching 3 crash reports to the bug. Two are segfaults (SIGSEGV) and one is a SIGABRT triggered by
malloc()
detecting heap corruption.Environment:
Additional Context:
I have 3 scripts running:
I do run Bartender. I have not (yet) tried running without it, though I previously ran earlier 1.4.x versions under it without issue.
I've attached the crash reports generated my macOS below. GitHub did not like the original
ips
extension, so I appended.txt
to them. They are JSON files, however, but can be rendered more prettily by Console.app.SwiftBar-2022-05-05-191332.ips.txt
SwiftBar-2022-05-06-165801.ips.txt
SwiftBar-2022-05-11-205124.ips.txt
The text was updated successfully, but these errors were encountered: