You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SR-6422 Encountering "Constant strings cannot be deallocated" in Linux foundation
Issue Description:
I have a block of code throwing this fatal error, that seems to require a larger setup to occur.
import Foundation
func default_components(bucket:String, key:String?=nil, query_items:[URLQueryItem]=[])->URLComponents{varcomponents=URLComponents()
components.scheme ="https"
components.host ="endpoint"
components.path = key ==nil?"/\(bucket)":"/\(bucket)/\(key!)"
components.queryItems = query_items
return components
}func list_objects(in bucket:String, prefix:String="", marker:String="", delimiter:String="", max_keys:Int=1000)->URLRequest{varcomponents=default_components(bucket: bucket)
components.queryItems?.append(URLQueryItem(name:"prefix", value: prefix))
components.queryItems?.append(URLQueryItem(name:"max-keys", value:String(max_keys))) // I think this is the line that crashes. But reducing further than this somehow eliminates the crash
components.queryItems?.append(URLQueryItem(name:"marker", value: marker))
components.queryItems?.append(URLQueryItem(name:"delimiter", value: delimiter))letheaders:[String:String]=["Date":"\(Date())",]varrequest=URLRequest(url: components.url!, timeoutInterval:60)
request.httpMethod ="GET"for(key, value)in headers {
request.addValue(value, forHTTPHeaderField: key)}return request
}list_objects(
in:"bucket",
marker:"")
Something about the `components.queryItems?.append(URLQueryItem(name: "max-keys", value: String(max_keys)))` part is causing this to trip, but I can't isolate it further than this. But the above block seems to reproduce reliably for me.
Environment
Linux w/ Swift 4
Additional Detail from JIRA
md5: 8f4158106464e25abf1dd3e4e488841a
is duplicated by:
Issue Description:
I have a block of code throwing this fatal error, that seems to require a larger setup to occur.
Something about the `components.queryItems?.append(URLQueryItem(name: "max-keys", value: String(max_keys)))` part is causing this to trip, but I can't isolate it further than this. But the above block seems to reproduce reliably for me.
The text was updated successfully, but these errors were encountered: