Bug 1908 - LogComponentEnable causes SIGILL with static and optimized build
LogComponentEnable causes SIGILL with static and optimized build
Status: NEW
Product: ns-3
Classification: Unclassified
Component: core
ns-3.19
PC Linux
: P5 major
Assigned To: Peter Barnes
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-04-27 11:50 EDT by Hajime Tazaki
Modified: 2014-09-24 00:08 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hajime Tazaki 2014-04-27 11:50:59 EDT
Environment: Ubuntu 12.04 64bit (32bits also)
$ hg tip
changeset:   10701:37823f33885f
tag:         tip
user:        Tomasz Seweryn <tomasz.seweryn7@gmail.com>
date:        Sat Apr 26 23:01:09 2014 +0200
summary:     Bug 1873 - Energy source checked to be aggregated to the node

$ hg dif
diff -r 37823f33885f scratch/scratch-simulator.cc
--- a/scratch/scratch-simulator.cc      Sat Apr 26 23:01:09 2014 +0200
+++ b/scratch/scratch-simulator.cc      Mon Apr 28 00:46:05 2014 +0900
@@ -23,6 +23,8 @@
 int 
 main (int argc, char *argv[])
 {
+  LogComponentEnable ("PacketSink", LOG_LEVEL_INFO);
+
   NS_LOG_UNCOND ("Scratch Simulator");
 
   Simulator::Run ();

the program ./waf --run scratch-simulator causes crash, by SIGILL.

Program terminated with signal 4, Illegal instruction.
#0  0x0000000000d2e3f4 in Enable (level=ns3::LOG_LEVEL_INFO, this=0x12c3630) at ../src/core/model/log.cc:266
266       m_levels |= (level & ~m_mask);
(gdb) bt
#0  0x0000000000d2e3f4 in Enable (level=ns3::LOG_LEVEL_INFO, this=0x12c3630) at ../src/core/model/log.cc:266
#1  ns3::LogComponentEnable (name=0xe076fa "PacketSink", level=ns3::LOG_LEVEL_INFO)
    at ../src/core/model/log.cc:328
#2  0x0000000000406613 in main (argc=<optimized out>, argv=<optimized out>) at ../scratch/scratch-simulator.cc:29

This won't happen in ubuntu 10.04 (64bit), Ubuntu 12.10, 13.04, 13.10 (64bit), and Fedora 18 (32bit) at least.
Comment 1 Hajime Tazaki 2014-04-28 04:50:06 EDT
bisect told me the following changeset introduces this issue.

changeset:   10626:16bbfc4cb29d
user:        Peter D. Barnes, Jr. <barnes26@llnl.gov>
date:        Fri Feb 21 16:27:43 2014 -0800
summary:     [Bug 1862] NS_LOG="Time=*|prefix_time" causes stack overflow


Peter, could you make a time to investigate it ?
Comment 2 Peter Barnes 2014-05-14 18:52:28 EDT
I can't reproduce this.

What compiler are you using?

Could you please look at this post and see if it's relevant:
http://peeterjoot.wordpress.com/2010/05/26/a-fun-and-curious-dig-gcc-generation-of-a-ud2a-instruction-sigill/
Comment 3 Hajime Tazaki 2014-05-17 09:35:39 EDT
(In reply to Peter Barnes from comment #2)
> I can't reproduce this.
> 
> What compiler are you using?

- for Ubuntu 12.04 64bits
jenkins@u1204-64:~$ gcc --version
gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 12.04 LTS
Release:        12.04
Codename:       precise

- for Ubuntu 12.04 32bits
$ gcc --version
gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 12.04.4 LTS
Release:        12.04
Codename:       precise

 
> Could you please look at this post and see if it's relevant:
> http://peeterjoot.wordpress.com/2010/05/26/a-fun-and-curious-dig-gcc-
> generation-of-a-ud2a-instruction-sigill/

I don't see the following warning in my build.

  sqluedus.C:1700: warning: cannot pass objects of non-POD type 'struct 
  sqlrw_request_cb' through '...'; call will abort at runtime

see full output of my jenkins.

http://ns-3-dce.cloud.wide.ad.jp/jenkins/job/daily-dce/label=Ubuntu1204-32/436/consoleFull

"CRASH: TestSuite dce-mptcp" has the same code pasted in the first message (LogComponentEnable...).