Skip to content

Dart_Snapshot conflicting uses #3

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

Closed
DartBot opened this issue Oct 10, 2011 · 19 comments
Closed

Dart_Snapshot conflicting uses #3

DartBot opened this issue Oct 10, 2011 · 19 comments
Assignees

Comments

@DartBot
Copy link

DartBot commented Oct 10, 2011

This issue was originally filed by nelson....@gmail.com


Trying to build Dart after clean checkout from SVN gives me :

runtime/vm/dart_api_impl.cc: In function ‘void* dart::Dart_CreateIsolate(void*, void*)’:
runtime/vm/dart_api_impl.cc:38:71: error: declaration of ‘void* dart::Dart_CreateIsolate(void*, void*)’ with C language linkage
runtime/include/dart_api.h:185:26: error: conflicts with previous declaration ‘void* Dart_CreateIsolate(const Dart_Snapshot*, void*)’

I ended up changing the dart_api_impl.cc declaration to use const Dart_Snapshot* and did a cast to (void*) in order to call Dart::CreateIsolate((void*)snapshot, data);

@DartBot
Copy link
Author

DartBot commented Oct 10, 2011

This comment was originally written by puffnfresh@gmail.com


Also getting this. I have GCC 4.5.2 installed.

@DartBot
Copy link
Author

DartBot commented Oct 10, 2011

This comment was originally written by zundel@google.com


FYI, successful build with gcc 4.4.3

@DartBot
Copy link
Author

DartBot commented Oct 10, 2011

This comment was originally written by nelson....@gmail.com


I'm also using GCC 4.5.2

@DartBot
Copy link
Author

DartBot commented Oct 10, 2011

This comment was originally written by rajaram...@gmail.com


Me too getting same GCC 4.5.2

gcc -v gives following error


Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5.2/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.5.2-8ubuntu4' --with-bugurl=file:///usr/share/doc/gcc-4.5/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.5 --enable-shared --enable-multiarch --with-multiarch-defaults=x86_64-linux-gnu --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib/x86_64-linux-gnu --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.5 --libdir=/usr/lib/x86_64-linux-gnu --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-plugin --enable-gold --enable-ld=default --with-plugin-ld=ld.gold --enable-objc-gc --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.5.2 (Ubuntu/Linaro 4.5.2-8ubuntu4)

@DartBot
Copy link
Author

DartBot commented Oct 10, 2011

This comment was originally written by zundel@google.com


Issue #8 has been merged into this issue.

@DartBot
Copy link
Author

DartBot commented Oct 10, 2011

This comment was originally written by zundel@google.com


Issue #9 has been merged into this issue.

@DartBot
Copy link
Author

DartBot commented Oct 10, 2011

This comment was originally written by waqn...@gmail.com


And again, the other errors from issue #9 (using ghc 4.6.1)

third_party/v8/src/ia32/full-codegen-ia32.cc: In member function ‘virtual void v8::internal::FullCodeGenerator::VisitCompareOperation(v8::internal::CompareOperation*)’:
third_party/v8/src/ia32/full-codegen-ia32.cc:4085:12: warning: variable ‘strict’ set but not used [-Wunused-but-set-variable]
  CXX(host) out/Debug_ia32/obj.host/v8_base/third_party/v8/src/ia32/lithium-gap-resolver-ia32.o
third_party/v8/src/ia32/lithium-codegen-ia32.cc: In member function ‘void v8::internal::LCodeGen::DoLoadKeyedFastDoubleElement(v8::internal::LLoadKeyedFastDoubleElement*)’:
third_party/v8/src/ia32/lithium-codegen-ia32.cc:2235:12: warning: variable ‘elements’ set but not used [-Wunused-but-set-variable]
third_party/v8/src/ia32/lithium-codegen-ia32.cc: In member function ‘void v8::internal::LCodeGen::DoStoreKeyedFastDoubleElement(v8::internal::LStoreKeyedFastDoubleElement*)’:
third_party/v8/src/ia32/lithium-codegen-ia32.cc:3100:12: warning: variable ‘elements’ set but not used [-Wunused-but-set-variable]
third_party/v8/src/ia32/lithium-codegen-ia32.cc:3101:12: warning: variable ‘key’ set but not used [-Wunused-but-set-variable]

third_party/v8/src/ia32/full-codegen-ia32.cc: In member function ‘virtual void v8::internal::FullCodeGenerator::VisitCompareOperation(v8::internal::CompareOperation*)’:
third_party/v8/src/ia32/full-codegen-ia32.cc:4085:12: warning: variable ‘strict’ set but not used [-Wunused-but-set-variable]
  CXX(target) out/Debug_ia32/obj.target/v8_base/third_party/v8/src/ia32/lithium-gap-resolver-ia32.o
third_party/v8/src/ia32/lithium-codegen-ia32.cc: In member function ‘void v8::internal::LCodeGen::DoLoadKeyedFastDoubleElement(v8::internal::LLoadKeyedFastDoubleElement*)’:
third_party/v8/src/ia32/lithium-codegen-ia32.cc:2235:12: warning: variable ‘elements’ set but not used [-Wunused-but-set-variable]
third_party/v8/src/ia32/lithium-codegen-ia32.cc: In member function ‘void v8::internal::LCodeGen::DoStoreKeyedFastDoubleElement(v8::internal::LStoreKeyedFastDoubleElement*)’:
third_party/v8/src/ia32/lithium-codegen-ia32.cc:3100:12: warning: variable ‘elements’ set but not used [-Wunused-but-set-variable]
third_party/v8/src/ia32/lithium-codegen-ia32.cc:3101:12: warning: variable ‘key’ set but not used [-Wunused-but-set-variable]

@DartBot
Copy link
Author

DartBot commented Oct 10, 2011

This comment was originally written by sa...@gmail.com


Workaround: Remove -Werror from dart/tools/gyp/configurations_make.gypi.

@DartBot
Copy link
Author

DartBot commented Oct 10, 2011

This comment was originally written by ghchi...@gmail.com


Using comment 8 workaround was able to build dart on 11.04 x32 gcc 4.5.2

@DartBot
Copy link
Author

DartBot commented Oct 11, 2011

This comment was originally written by sanxiy...@gmail.com


With r321, it compiles fine with GCC 4.6.1.

@madsager
Copy link
Contributor

Issue #46 has been merged into this issue.

@DartBot
Copy link
Author

DartBot commented Oct 11, 2011

This comment was originally written by me....@gmail.com


latest revision r322 compiles fine with Ubuntu 11.04, GCC 4.5.2

@DartBot
Copy link
Author

DartBot commented Oct 11, 2011

This comment was originally written by drfibonacci@google.com


Set owner to zundel@google.com.
Added Accepted label.

@DartBot
Copy link
Author

DartBot commented Oct 11, 2011

This comment was originally written by zundel@google.com


Passing the buck to the VM team.


Set owner to @iposva-google.

@DartBot
Copy link
Author

DartBot commented Oct 11, 2011

This comment was originally written by zundel@google.com


Issue #52 has been merged into this issue.

@DartBot
Copy link
Author

DartBot commented Oct 11, 2011

This comment was originally written by ghchin...@gmail.com


r329 also compiles fine with Ubuntu 11.04, gcc 4.5.2

@DartBot
Copy link
Author

DartBot commented Oct 11, 2011

This comment was originally written by waq...@gmail.com


in r330, the "conflicts with previous declaration"-type errors are gone, however the "variable ‘X’ set but not used"-errors still occur with gcc 4.6.1 (prerelease on arch linux)

@iposva-google
Copy link
Contributor

Fixed in https://code.google.com/p/dart/source/detail?r=321 which should be merged to trunk shortly.


Set owner to @a-siva.
Added Fixed label.

@DartBot
Copy link
Author

DartBot commented Oct 11, 2011

This comment was originally written by waq...@gmail.com


Could you revoke the classification of issue #9 as a duplicate, then? Issue #9 has been merged into this issue here, and it has not been fixed.

copybara-service bot pushed a commit that referenced this issue Oct 22, 2024
See: b/374689139.

https://dart-review.googlesource.com/c/sdk/+/390941 is blocking an SDK roll.

Root cause:


```
Action threw an exception: type 'ConstructorMember' is not a subtype of type 'ConstructorFragment' in type cast
#0      InterfaceTypeImpl.constructors2.<anonymous closure> (package:analyzer/src/dart/element/type.dart:569)
#1      MappedListIterable.elementAt (dart:_internal/iterable.dart:435)
#2      ListIterator.moveNext (dart:_internal/iterable.dart:364)
#3      new _GrowableList._ofEfficientLengthIterable (dart:core-patch/growable_array.dart:189)
#4      new _GrowableList.of (dart:core-patch/growable_array.dart:150)
#5      new List.of (dart:core-patch/array_patch.dart:39)
#6      ListIterable.toList (dart:_internal/iterable.dart:224)
#7      InterfaceTypeImpl.constructors2 (package:analyzer/src/dart/element/type.dart:570)
#8      _Visitor._hasConstConstructorInvocation (package:linter/src/rules/prefer_const_constructors_in_immutables.dart:110)
#9      _Visitor.visitConstructorDeclaration (package:linter/src/rules/prefer_const_constructors_in_immutables.dart:58)
```


To verify the fix locally:

```
  solo_test_X() async {
    await assertNoErrorsInCode(r'''
class A<T> {}
''');

    var A = findElement.class_('A').instantiate(
      typeArguments: [intType],
      nullabilitySuffix: NullabilitySuffix.none,
    );
    A.constructors2;
  }
```


Bug: b/374689139
Change-Id: I70034d938d840dc0c3939db27e7116164e4617e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/391483
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
@ARDUTECH0 ARDUTECH0 mentioned this issue Dec 28, 2024
copybara-service bot pushed a commit that referenced this issue Feb 11, 2025
This is a possible fix for the following benign TSAN error:

WARNING: ThreadSanitizer: data race (pid=40436)
  Read of size 8 at 0x7b7c000bfa48 by thread T6 (mutexes: write M0):
    #0 dart::Page::object_end() const out/ReleaseTSANX64/../../runtime/vm/heap/page.h (dart+0x25ade83)
    #1 dart::Page::used() const out/ReleaseTSANX64/../../runtime/vm/heap/page.h:107:34 (dart+0x25ade83)
    #2 dart::SemiSpace::used_in_words() const out/ReleaseTSANX64/../../runtime/vm/heap/scavenger.h:46:18 (dart+0x25ade83)
    #3 dart::Scavenger::UsedInWords() const out/ReleaseTSANX64/../../runtime/vm/heap/scavenger.h:157:17 (dart+0x25ade83)
    #4 dart::GetProcessMemoryUsageHelper(dart::JSONStream*)::$_0::operator()(dart::IsolateGroup*) const out/ReleaseTSANX64/../../runtime/vm/service.cc:4729:50 (dart+0x25ade83)

  Previous write of size 8 at 0x7b7c000bfa48 by thread T9:
    #0 dart::Thread::set_top(unsigned long) out/ReleaseTSANX64/../../runtime/vm/thread.h:698:34 (dart+0x2622071)
    #1 dart::Scavenger::TryAllocateFromTLAB(dart::Thread*, long) out/ReleaseTSANX64/../../runtime/vm/heap/scavenger.h:256:13 (dart+0x2622071)
    #2 dart::Scavenger::TryAllocate(dart::Thread*, long) out/ReleaseTSANX64/../../runtime/vm/heap/scavenger.h:139:12 (dart+0x2622071)
    #3 dart::Heap::AllocateNew(dart::Thread*, long) out/ReleaseTSANX64/../../runtime/vm/heap/heap.cc:84:27 (dart+0x2622071)
    #4 dart::Heap::Allocate(dart::Thread*, long, dart::Heap::Space) out/ReleaseTSANX64/../../runtime/vm/heap/heap.h:87:16 (dart+0x2416cab)

TEST=ci

Change-Id: Id9077cff2c1143adf999b2b26c941701d63cd844
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/409180
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
copybara-service bot pushed a commit that referenced this issue Feb 12, 2025
…terrupted

Thread interrupts can be disabled after thread interrupter decided to
interrupt a thread but before thread actually receives and handles
a signal.

This may cause a data race accessing a Sample between profiler which
initializes and adds a Sample and the main thread using
Profiler::sample_block_buffer() in the profiler unit tests.

This is a possible fix for the following benign TSAN error:

WARNING: ThreadSanitizer: data race (pid=5824)
  Write of size 4 at 0x7f53e8e53a98 by thread T6:
    #0 dart::Sample::set_thread_task(dart::Thread::TaskKind) out/ReleaseTSANX64/../../runtime/vm/profiler.h:325:12 (run_vm_tests+0x292cab2)
    #1 dart::SetupSample(dart::Thread*, bool, unsigned long) out/ReleaseTSANX64/../../runtime/vm/profiler.cc:1226:11 (run_vm_tests+0x292cab2)
    #2 dart::Profiler::SampleThread(dart::Thread*, dart::InterruptedThreadState const&) out/ReleaseTSANX64/../../runtime/vm/profiler.cc:1381:7 (run_vm_tests+0x292cab2)
    #3 dart::ThreadInterrupterLinux::ThreadInterruptSignalHandler(int, siginfo_t*, void*) out/ReleaseTSANX64/../../runtime/vm/thread_interrupter_linux.cc:44:5 (run_vm_tests+0x2a064b0)
    #4 __tsan::CallUserSignalHandler(__tsan::ThreadState*, bool, bool, int, __sanitizer::__sanitizer_siginfo*, void*) ../staging/llvm_build/tools/clang/stage2-bins/runtimes/runtimes-x86_64-unknown-linux-gnu-bins/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp:2122:5 (run_vm_tests+0x1fc057f)
    #5 dart::Mutex::Unlock() out/ReleaseTSANX64/../../runtime/vm/os_thread_linux.cc:367:16 (run_vm_tests+0x2924b89)

  Previous read of size 4 at 0x7f53e8e53a98 by main thread:
    #0 dart::Sample::head_sample() const out/ReleaseTSANX64/../../runtime/vm/profiler.h:350:59 (run_vm_tests+0x22c70e7)
    #1 dart::SampleBuffer::VisitSamples(dart::SampleVisitor*) out/ReleaseTSANX64/../../runtime/vm/profiler.h:589:20 (run_vm_tests+0x22c70e7)
    #2 dart::SampleBlockBuffer::VisitSamples(dart::SampleVisitor*) out/ReleaseTSANX64/../../runtime/vm/profiler.h:752:18 (run_vm_tests+0x22c70e7)
    #3 dart::Dart_TestHelperProfiler_GetSourceReport(dart::Thread*) out/ReleaseTSANX64/../../runtime/vm/profiler_test.cc:2241:26 (run_vm_tests+0x22c70e7)
    #4 dart::Dart_TestProfiler_GetSourceReport() out/ReleaseTSANX64/../../runtime/vm/profiler_test.cc:2206:1 (run_vm_tests+0x22c70e7)
    #5 dart::TestCase::Run() out/ReleaseTSANX64/../../runtime/bin/run_vm_tests.cc:53:3 (run_vm_tests+0x203fe6c)

--- Re-run this test:
python3 tools/test.py -n vm-tsan-linux-release-x64 vm/cc/Profiler_GetSourceReport

Also, this change is a possible fix for #44089.

TEST=ci

Change-Id: I8ad87c340580325cbd6e22b5f068e1e33b0a7d46
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/409460
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
copybara-service bot pushed a commit that referenced this issue Feb 21, 2025
This test has a few independent calls to asyncExpectThrows which uses
asyncStart/asyncEnd. However, multiple top-level asyncStart/asyncEnd
are not allowed, which causes the following flaky error:

```
Unhandled exception:
Exception: Fatal: asyncStart() was called even though we are done with testing.. This is most likely a bug in your test.
#0      asyncStart (package:expect/async_helper.dart:53)
#1      asyncExpectThrows (package:expect/async_helper.dart:140)
#2      testMalformedAuthenticateHeaderWithAuthHandler.<anonymous closure> (file:///b/s/w/ir/cache/builder/sdk/tests/standalone/io/http_auth_digest_test.dart:345)
#3      Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:951)
#4      Future._propagateToListeners (dart:async/future_impl.dart:980)
#5      Future._completeWithValue (dart:async/future_impl.dart:723)
#6      Future._asyncCompleteWithValue.<anonymous closure> (dart:async/future_impl.dart:807)
#7      _microtaskLoop (dart:async/schedule_microtask.dart:40)
#8      _startMicrotaskLoop (dart:async/schedule_microtask.dart:49)
#9      _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:128)
#10     _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:195)

--- Re-run this test:
python3 tools/test.py -n vm-aot-ubsan-linux-release-x64 standalone/io/http_auth_digest_test
```

This change attempts to fix this by adding a top-level asyncStart/asyncEnd
and also asyncStart/asyncEnd to the server start/shutdown to
enclose each test case into asyncStart/asyncEnd and avoid printing
"unittest-suite-success" marker before all test cases are finished.

TEST=standalone/io/http_auth_digest_test

Change-Id: I950e7c6c09f5c2144da874ab3be3cd3a130d3790
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/411086
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants