Cool VL Viewer forum

View unanswered posts | View active topics It is currently 2024-03-28 13:42:23



Reply to topic  [ 6 posts ] 
64-Bit buld fails for 1.26.18 (8) 
Author Message

Joined: 2010-04-07 08:23:18
Posts: 210
Reply with quote
Hello Henri,

building the latest viewer fails:

Code:
[ 74%] Building CXX object newview/CMakeFiles/CoolVLViewer.dir/lllogchat.cpp.o
[ 74%] Building CXX object newview/CMakeFiles/CoolVLViewer.dir/llloginhandler.cpp.o
/home/upps/linden/indra/newview/lllogchat.cpp: In static member function 'static void LLLogChat::loadHistory(std::string, void (*)(LLLogChat::ELogLineType, std::string, void*), void*)':
/home/upps/linden/indra/newview/lllogchat.cpp:191:28: error: ignoring return value of 'char* fgets(char*, int, FILE*)', declared with attribute warn_unused_result [-Werror=unused-result]
/home/upps/linden/indra/../include/boost/system/error_code.hpp: At global scope:
/home/upps/linden/indra/../include/boost/system/error_code.hpp:221:36: error: 'boost::system::posix_category' defined but not used [-Werror=unused-variable]
/home/upps/linden/indra/../include/boost/system/error_code.hpp:222:36: error: 'boost::system::errno_ecat' defined but not used [-Werror=unused-variable]
/home/upps/linden/indra/../include/boost/system/error_code.hpp:223:36: error: 'boost::system::native_ecat' defined but not used [-Werror=unused-variable]
cc1plus: all warnings being treated as errors
make[2]: *** [newview/CMakeFiles/CoolVLViewer.dir/lllogchat.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory `/home/upps/linden/indra/viewer-linux-x86_64-release'
make[1]: *** [newview/CMakeFiles/CoolVLViewer.dir/all] Error 2
make[1]: Leaving directory `/home/upps/linden/indra/viewer-linux-x86_64-release'
make: *** [all] Error 2
make: Leaving directory `/home/upps/linden/indra/viewer-linux-x86_64-release'
Error: the command 'make' exited with status 2


Love,
Lia


2016-06-04 18:36:43
Profile

Joined: 2009-03-17 18:42:51
Posts: 5523
Reply with quote
Not a bug...

Simply use -i in the command line of the "buildlinux[64].sh" script: depending on your compiler version, it might be more pedantic than mine, which causes harmless warnings that you can safely ignore.
Alternatively, add a (void) before the "offending" fgets()...


2016-06-04 19:34:18
Profile WWW

Joined: 2010-04-07 08:23:18
Posts: 210
Reply with quote
Hi again,

I actually did look at the code and flinched slightly, then added the cast at first. The resulting viewer crashed at the first incoming IM. I ended up if()-ing the relevant block on a NULL return, which seems to be behaving well so far. Just sayin'.

Love,
Lia


2016-06-04 20:14:04
Profile

Joined: 2009-03-17 18:42:51
Posts: 5523
Reply with quote
I would have noticed (got dozens of IMs and no crash, and there's the test for EOF before the fgets() is called, so it should always succeed). Not sure what your compiler did with its optimizations however: what version is it ?


2016-06-04 21:15:49
Profile WWW

Joined: 2010-04-07 08:23:18
Posts: 210
Reply with quote
Hello again,

gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3

Love,
Lia


2016-06-05 03:38:21
Profile

Joined: 2009-03-17 18:42:51
Posts: 5523
Reply with quote
v4.6.3 had a few serious bugs, which could explain the warning (which v4.6.4 doesn't show) and the crash you got. Try v4.6.4...

The original implementation used:
Code:
while (fgets(buffer, bsize, fp) && !feof(fp))
Which was wrong and could cause to miss the last lines of the log file (because, depending on the way it is implemented, fgets() coud set the EOF marker when it notices it read the last byte in the log, and then !feof(fp) would be false, causing the chunk that just got fetched to be skipped), and that's why I moved fgets() inside the while() loop.

For the next releases, I simply got rid of the (actually redundant, since fgets() does test for EOF and returns NULL when at EOF) !feof(fp) in the while() and put the fgets() in its place: this way there will be unused return value and we cover the (improbable, but theoretically possible) case where: 1.- the file seeks OK and is not at EOF, 2.- fgets() fails due to a read error (i.e. the file is on a bad sector of a bad medium), 3.- the fgets() implementation doesn't add a '\0' character in the buffer when it errors out during a read (this is not in fgets() implementation specifications, so it depends on the implementer), 4.- the buffer doesn't contain any '\0' character, causing the next strlen() to overflow it and trigger a segfault...


2016-06-05 07:15:29
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 6 posts ] 

Who is online

Users browsing this forum: No registered users and 13 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.