Opened 2 years ago

Closed 2 years ago

#13445 closed bug (fixed)

[SoftwareUpdater] crash

Reported by: diver Owned by: perelandra
Priority: normal Milestone: Unscheduled
Component: Applications/SoftwareUpdater Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All

Description

hrev51114.

SoftwareUpdater crashed when started with no network connection.

Attachments (1)

SoftwareUpdater-28670-debug-24-04-2017-13-43-32.report (15.2 KB) - added by diver 2 years ago.

Download all attachments as: .zip

Change History (10)

comment:1 Changed 2 years ago by diver

Has a Patch: set

comment:2 Changed 2 years ago by perelandra

Resolution: fixed
Status: newclosed

Thanks for the report. This will be fixed in version 1.0.1. Strangely this only happened on x64.

diff --git a/src/apps/softwareupdater/UpdateManager.cpp b/src/apps/softwareupdater/UpdateManager.cpp
index 12fa3b0..5041380 100644
--- a/src/apps/softwareupdater/UpdateManager.cpp
+++ b/src/apps/softwareupdater/UpdateManager.cpp
@@ -243,8 +243,8 @@ UpdateManager::Warn(status_t error, const char* format, ...)
        char buffer[256];
        va_list args;
        va_start(args, format);
-       vfprintf(stderr, format, args);
        vsnprintf(buffer, sizeof(buffer), format, args);
+       fprintf(stderr, buffer);
        va_end(args);
 
        if (error == B_OK)

comment:3 Changed 2 years ago by korli

@perelandra we usually leave the bug report open until the fix actually lands in git master with a hrev to be tested by the reporter.

comment:4 in reply to:  3 Changed 2 years ago by perelandra

Resolution: fixed
Status: closedreopened

Replying to korli:

@perelandra we usually leave the bug report open until the fix actually lands in git master with a hrev to be tested by the reporter.

OK

comment:5 Changed 2 years ago by axeld

Also, it's not a good idea to use fprintf() when you don't actually have any formatting to do. Use fputs() instead.

comment:6 Changed 2 years ago by perelandra

In all the code I've browsed through I don't recall seeing fputs or puts used so that doesn't seem to be strictly enforced. I had to look those up to know what they do. How about using: fprintf(stderr, "%s", string) ?

comment:7 Changed 2 years ago by pulkomandy

Has a Patch: unset

comment:8 Changed 2 years ago by perelandra

Fixed code in hrev51148, also removed the ability to "Continue anyway" when no network is detected since there relly is no point in doing so.

comment:9 Changed 2 years ago by perelandra

Resolution: fixed
Status: reopenedclosed
Note: See TracTickets for help on using tickets.