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

Do not add extra new line if there is one exist #8538

Merged
merged 2 commits into from
Feb 21, 2024

Conversation

AGulev
Copy link
Contributor

@AGulev AGulev commented Feb 14, 2024

PR checklist

  • Code
    • Add engine and/or editor unit tests.
    • New and changed code follows the overall code style of existing code
    • Add comments where needed
  • Documentation
    • Make sure that API documentation is updated in code comments
    • Make sure that manuals are updated (in github.com/defold/doc)
  • Prepare pull request and affected issue for automatic release notes generator
    • Pull request - Write a message that explains what this pull request does. What was the problem? How was it solved? What are the changes to APIs or the new APIs introduced? This message will be used in the generated release notes. Make sure it is well written and understandable for a user of Defold.
    • Pull request - Write a pull request title that in a sentence summarises what the pull request does. Do not include "Issue-1234 ..." in the title. This text will be used in the generated release notes.
    • Pull request - Link the pull request to the issue(s) it is closing. Use on of the approved closing keywords.
    • Affected issue - Assign the issue to a project. Do not assign the pull request to a project if there is an issue which the pull request closes.
    • Affected issue - Assign the "breaking change" label to the issue if introducing a breaking change.
    • Affected issue - Assign the "skip release notes" is the issue should not be included in the generated release notes.

Example of a well written PR description:

  1. Start with the user facing changes. This will end up in the release notes.
  2. Add one of the GitHub approved closing keywords
  3. Optionally also add the technical changes made. This is information that might help the reviewer. It will not show up in the release notes. Technical changes are identified by a line starting with one of these:
    1. ### Technical changes
    2. Technical changes:
    3. Technical notes:
There was a anomaly in the carbon chroniton propeller, introduced in version 8.10.2. This fix will make sure to reset the phaser collector on application startup.

Fixes #1234

### Technical changes
* Pay special attention to line 23 of phaser_collector.clj as it contains some interesting optimizations
* The propeller code was not taking into account a negative phase.

@@ -333,7 +333,7 @@ namespace dmCrash
if (lineend && lineend < end)
*lineend = 0;

dmLogError("%s\n", p);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was the problem?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Crash creates an extra new line symbol on each likne even if we know there is a new line symbol in the end of line.

that's how crash looks before

INFO:CRASH: Successfully wrote Crashdump to file: /Users/agulev/Library/Application Support/Defold/_crash
ERROR:CRASH: CALL STACK:


ERROR:CRASH: 0   dmengine                            0x000000010113b304 _ZN7dmCrash7OnCrashEi + 104

ERROR:CRASH: 1   libsystem_platform.dylib            0x0000000181209a24 _sigtramp + 56

ERROR:CRASH: 2   dmengine                            0x0000000100f3b954 _ZN12dmGameSystem16AcquireResourcesEPNS_14PhysicsContextEPN10dmResource16SResourceFactoryEPKvjPNS_23CollisionObjectResourceEPKc + 1780

ERROR:CRASH: 3   dmengine                            0x0000000100f3c2ec _ZN12dmGameSystem24ResCollisionObjectCreateERKN10dmResource20ResourceCreateParamsE + 116

ERROR:CRASH: 4   dmengine                            0x0000000100ed4d60 _ZN10dmResourceL16DoCreateResourceEPNS_16SResourceFactoryEPNS_13SResourceTypeEPKcS5_yPvjPS6_ + 184

ERROR:CRASH: 5   dmengine                            0x0000000100ed52d0 _ZN10dmResource3GetEPNS_16SResourceFactoryEPKcPPv + 800

ERROR:CRASH: 6   dmengine                            0x0000000100ecb378 _ZN12dmGameObjectL16AcquireResourcesEPN10dmResource16SResourceFactoryEPNS_8RegisterEPN15dmGameObjectDDF13PrototypeDescEPNS_9PrototypeEPKc + 272

ERROR:CRASH: 7   dmengine                            0x0000000100ecb000 _ZN12dmGameObjectL19ResGameObjectCreateERKN10dmResource20ResourceCreateParamsE + 96

ERROR:CRASH: 8   dmengine                            0x0000000100ed4d60 _ZN10dmResourceL16DoCreateResourceEPNS_16SResourceFactoryEPNS_13SResourceTypeEPKcS5_yPvjPS6_ + 184

ERROR:CRASH: 9   dmengine                            0x0000000100ed52d0 _ZN10dmResource3GetEPNS_16SResourceFactoryEPKcPPv + 800

ERROR:CRASH: 10  dmengine                            0x0000000100eca750 _ZN12dmGameObjectL16AcquireResourcesEPKcPN10dmResource16SResourceFactoryEPNS_8RegisterEPN15dmGameObjectDDF14CollectionDescES1_PPNS_16CollectionHandleE + 396

ERROR:CRASH: 11  dmengine                            0x0000000100eca2ec _ZN12dmGameObjectL19ResCollectionCreateERKN10dmResource20ResourceCreateParamsE + 52

ERROR:CRASH: 12  dmengine                            0x0000000100ed4d60 _ZN10dmResourceL16DoCreateResourceEPNS_16SResourceFactoryEPNS_13SResourceTypeEPKcS5_yPvjPS6_ + 184

ERROR:CRASH: 13  dmengine                            0x0000000100ed52d0 _ZN10dmResource3GetEPNS_16SResourceFactoryEPKcPPv + 800

ERROR:CRASH: 14  dmengine                            0x0000000100ea1140 _ZN8dmEngine4InitEPNS_6EngineEiPPc + 10640

ERROR:CRASH: 15  dmengine                            0x0000000100ea339c _Z14dmEngineCreateiPPc + 104

ERROR:CRASH: 16  dmengine                            0x0000000100ea5b98 _ZN8dmEngine7RunLoopEPKNS_13RunLoopParamsE + 168

ERROR:CRASH: 17  dmengine                            0x0000000100ea597c _ZL10EngineMainiPPc + 120

ERROR:CRASH: 18  dmengine                            0x0000000100ea58f8 _Z11engine_mainiPPc + 32

ERROR:CRASH: 19  dmengine                            0x0000000100e9d734 main + 36

ERROR:CRASH: 20  dyld                                0x0000000180e590e0 start + 2360

ERROR:CRASH:

[1]    62848 segmentation fault  ./tmp/dynamo_home/bin/arm64-macos/dmengine

and here is how it looks with the fix

ERROR:CRASH: CALL STACK:


ERROR:CRASH: 0   dmengine                            0x0000000101127240 _ZN7dmCrash7OnCrashEi + 144
ERROR:CRASH: 1   dmengine                            0x00000001011274f0 _ZN7dmCrashL7HandlerEiP9__siginfoPv + 60
ERROR:CRASH: 2   libsystem_platform.dylib            0x0000000181209a24 _sigtramp + 56
ERROR:CRASH: 3   dmengine                            0x0000000100f27014 _ZN12dmGameSystem16AcquireResourcesEPNS_14PhysicsContextEPN10dmResource16SResourceFactoryEPKvjPNS_23CollisionObjectResourceEPKc + 1780
ERROR:CRASH: 4   dmengine                            0x0000000100f279ac _ZN12dmGameSystem24ResCollisionObjectCreateERKN10dmResource20ResourceCreateParamsE + 116
ERROR:CRASH: 5   dmengine                            0x0000000100ec0430 _ZN10dmResourceL16DoCreateResourceEPNS_16SResourceFactoryEPNS_13SResourceTypeEPKcS5_yPvjPS6_ + 184
ERROR:CRASH: 6   dmengine                            0x0000000100ec09a0 _ZN10dmResource3GetEPNS_16SResourceFactoryEPKcPPv + 800
ERROR:CRASH: 7   dmengine                            0x0000000100eb6a48 _ZN12dmGameObjectL16AcquireResourcesEPN10dmResource16SResourceFactoryEPNS_8RegisterEPN15dmGameObjectDDF13PrototypeDescEPNS_9PrototypeEPKc + 272
ERROR:CRASH: 8   dmengine                            0x0000000100eb66d0 _ZN12dmGameObjectL19ResGameObjectCreateERKN10dmResource20ResourceCreateParamsE + 96
ERROR:CRASH: 9   dmengine                            0x0000000100ec0430 _ZN10dmResourceL16DoCreateResourceEPNS_16SResourceFactoryEPNS_13SResourceTypeEPKcS5_yPvjPS6_ + 184
ERROR:CRASH: 10  dmengine                            0x0000000100ec09a0 _ZN10dmResource3GetEPNS_16SResourceFactoryEPKcPPv + 800
ERROR:CRASH: 11  dmengine                            0x0000000100eb5e20 _ZN12dmGameObjectL16AcquireResourcesEPKcPN10dmResource16SResourceFactoryEPNS_8RegisterEPN15dmGameObjectDDF14CollectionDescES1_PPNS_16CollectionHandleE + 396
ERROR:CRASH: 12  dmengine                            0x0000000100eb59bc _ZN12dmGameObjectL19ResCollectionCreateERKN10dmResource20ResourceCreateParamsE + 52
ERROR:CRASH: 13  dmengine                            0x0000000100ec0430 _ZN10dmResourceL16DoCreateResourceEPNS_16SResourceFactoryEPNS_13SResourceTypeEPKcS5_yPvjPS6_ + 184
ERROR:CRASH: 14  dmengine                            0x0000000100ec09a0 _ZN10dmResource3GetEPNS_16SResourceFactoryEPKcPPv + 800
ERROR:CRASH: 15  dmengine                            0x0000000100e8c810 _ZN8dmEngine4InitEPNS_6EngineEiPPc + 10640
ERROR:CRASH: 16  dmengine                            0x0000000100e8ea6c _Z14dmEngineCreateiPPc + 104
ERROR:CRASH: 17  dmengine                            0x0000000100e91268 _ZN8dmEngine7RunLoopEPKNS_13RunLoopParamsE + 168
ERROR:CRASH: 18  dmengine                            0x0000000100e9104c _ZL10EngineMainiPPc + 120
ERROR:CRASH: 19  dmengine                            0x0000000100e90fc8 _Z11engine_mainiPPc + 32
ERROR:CRASH: 20  dmengine                            0x0000000100e88e04 main + 36
ERROR:CRASH: 21  dyld                                0x0000000180e590e0 start + 2360
ERROR:CRASH:

[1]    63869 segmentation fault  ./tmp/dynamo_home/bin/arm64-macos/dmengine

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then dmLogError("%s", p); should suffice imho.

The lineend is for terminating the p string, and also exitin the loop.

@AGulev AGulev requested a review from JCash February 20, 2024 09:25
Copy link
Contributor

@JCash JCash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, small change needed

@@ -333,7 +333,7 @@ namespace dmCrash
if (lineend && lineend < end)
*lineend = 0;

dmLogError("%s\n", p);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then dmLogError("%s", p); should suffice imho.

The lineend is for terminating the p string, and also exitin the loop.

@AGulev AGulev requested a review from JCash February 20, 2024 09:36
@AGulev AGulev merged commit a2c8424 into dev Feb 21, 2024
22 checks passed
@AGulev AGulev deleted the remove_extra_new_linw_in_crash branch February 21, 2024 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants