Memory leak with custom style
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 35/100
- Tipo de issue
- Bug
- Clareza
- Razoavelmente clara
- Status de atividade
- Estagnada
- Stack de tecnologia
- cpp, objective-c
- Domínio
- devtools
Direção de pesquisa
Reproduza a falha no projeto XcodeClangFormat usando o estilo .clang-format do Blender e o exemplo de C++ de 18 linhas; em seguida, inspecione o caminho de Extension e o ponto de entrada ClangFormatCommand mencionado no trace. Está concluído quando formatar o arquivo uma segunda vez não falhar mais, a Extension não acumular aproximadamente 500 MB e a conexão XPC continuar utilizável.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
- Setup the Xcode project for XcodeClangFormat for debugging.
- Build the app and set the style to https://github.com/blender/blender/blob/master/.clang-format
- Run Extension this time and Xcode launches. Wait for the debugger to attach to the extension.
- New Xcode command line tool project of C++ language.
- In the C++ file, select all, paste the code given in the summary. [1] it's total 18 lines.
- Editor > clang format > format entire file. It will format it correctly.
- Select all again, paste the code still in your clipboard.
- Editor > clang format > format entire file. It will fail & the original Xcode instance shows memory increase that settles around 500 MB. The trace appears in the console [2] & UI looks like this [3].
[1] Code to copy
//
// main.cpp
// clang-format-test
//
// Copyright © 2020 ak. All rights reserved.
//
#include <iostream>
#include "main.hh"
int main(int argc, const char *argv[])
{
// Long comment that must be broken down in multiple lines.
// insert code here... insert code here... insert code here... insert code here... insert code here... insert code here...
std::cout << "Hello, World!\n";
return 0;
}
[2] Trace in console
2020-08-03 00:39:49.395275+0530 clang-format[6941:258937] [User Defaults] Couldn't read values in CFPrefsPlistSource<0x60b000012c00> (Domain: XcodeClangFormat, User: kCFPreferencesAnyUser, ByHost: Yes, Container: (null), Contents Need Refresh: Yes): Using kCFPreferencesAnyUser with a container is only allowed for System Containers, detaching from cfprefsd
2020-08-03 00:40:00.626852+0530 clang-format[6941:258937] [general] <NSXPCConnection: 0x60d000017bb0> connection from pid 6924: Warning: Exception caught during invocation of received message, dropping incoming message and invalidating the connection.
Exception: *** -[__NSArrayM objectAtIndex:]: index 18 beyond bounds [0 .. 17]
*** -[__NSArrayM objectAtIndex:]: index 18 beyond bounds [0 .. 17]
(
0 CoreFoundation 0x00007fff46876a7d __exceptionPreprocess + 256
1 libobjc.A.dylib 0x00007fff70f4ba17 objc_exception_throw + 48
2 CoreFoundation 0x00007fff468b5a74 -[CFPrefsConfigurationFileSource initWithConfigurationPropertyList:containingPreferences:] + 0
3 CoreFoundation 0x00007fff467b21de -[CFPrefsSearchListSource addNamedVolatileSourceForIdentifier:] + 0
4 clang-format 0x0000000105a5ce7b -[ClangFormatCommand performCommandWithInvocation:completionHandler:] + 9099
5 XcodeKit 0x000000010ae192f4 -[_XCSourceEditorService performCommandInvocation:commandIdentifier:request:reply:] + 494
6 Foundation 0x00007fff48a8da0b __NSXPCCONNECTION_IS_CALLING_OUT_TO_EXPORTED_OBJECT_S4__ + 12
7 Foundation 0x00007fff48a3298f -[NSXPCConnection _decodeAndInvokeMessageWithEvent:flags:] + 2499
8 Foundation 0x00007fff48a31d63 message_handler + 215
9 libxpc.dylib 0x00007fff7294df08 _xpc_connection_call_event_handler + 56
10 libxpc.dylib 0x00007fff7294be9e _xpc_connection_mach_event + 933
11 libdispatch.dylib 0x00007fff726cc6dd _dispatch_client_callout4 + 9
12 libdispatch.dylib 0x00007fff726e10d6 _dispatch_mach_msg_invoke + 436
13 libdispatch.dylib 0x00007fff726d2792 _dispatch_lane_serial_drain + 268
14 libdispatch.dylib 0x00007fff726e1c19 _dispatch_mach_invoke + 481
15 libdispatch.dylib 0x00007fff726d2792 _dispatch_lane_serial_drain + 268
16 libdispatch.dylib 0x00007fff726d33c6 _dispatch_lane_invoke + 433
17 libdispatch.dylib 0x00007fff726db6ed _dispatch_workloop_worker_thread + 598
18 libsystem_pthread.dylib 0x00007fff7290c611 _pthread_wqthread + 421
19 libsystem_pthread.dylib 0x00007fff7290c3fd start_wqthread + 13
)
[3] UI looks like

- Linguagem predominante
- Objective-C++
- Estrelas
- 806
- Forks
- 102
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de mapbox/XcodeClangFormat
-
can't show in xcode on M2Aberta
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 20/100
mapbox/XcodeClangFormat#61 ·
-
Clang Format 14 supportAberta
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 35/100
mapbox/XcodeClangFormat#60 ·
-
OC怎么自定义代码规范规则?Aberta
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 25/100
mapbox/XcodeClangFormat#58 · 1 comentário ·
-
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 25/100
mapbox/XcodeClangFormat#57 ·
-
Not work on Xcode 12Aberta
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 20/100
mapbox/XcodeClangFormat#53 · 34 comentários · 1 reação ·
Todas as issues de mapbox/XcodeClangFormat
Issues semelhantes
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 84/100
NVIDIA/DeepStream#78 ·
-
documentation good first issue help wanted
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 85/100
zmo2s/agent-toolbox#23 ·
-
raised-by:worker
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
medici-finance/assay#2486 ·
Mantenedores costumam responder em até 1 dia
-
bug traffic
Dificuldade 2/5 Menos de uma hora Facilidade para iniciantes 74/100
-
enhancement good first issue Stellar Wave trivial
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
StellarCanary/ProtocolCanary-Fixtures#258 ·
Mantenedores costumam responder em até 1 dia